Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| index b967171ef7eaaa503f805f4cca17ac8717e9f088..8922902d31a53ea4dac4694618cf3453343b2300 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp |
| @@ -168,8 +168,8 @@ DrawingBuffer::~DrawingBuffer() { |
| } |
| bool DrawingBuffer::markContentsChanged() { |
| - if (m_contentsChangeCommitted || !m_contentsChanged) { |
| - m_contentsChangeCommitted = false; |
| + if (m_contentsChangeResolved || !m_contentsChanged) { |
| + m_contentsChangeResolved = false; |
| m_contentsChanged = true; |
| return true; |
| } |
| @@ -284,8 +284,7 @@ bool DrawingBuffer::prepareTextureMailboxInternal( |
| (*m_newMailboxCallback)(); |
| // Resolve the multisampled buffer into m_backColorBuffer texture. |
| - if (m_antiAliasingMode != None) |
| - resolveMultisampleFramebufferInternal(); |
| + resolve(); |
| if (m_softwareRendering && !forceGpuResult) { |
| return finishPrepareTextureMailboxSoftware(outMailbox, outReleaseCallback); |
| @@ -695,8 +694,7 @@ bool DrawingBuffer::copyToPlatformTexture(gpu::gles2::GLES2Interface* gl, |
| ScopedStateRestorer scopedStateRestorer(this); |
| if (m_contentsChanged) { |
| - if (m_antiAliasingMode != None) |
| - resolveMultisampleFramebufferInternal(); |
| + resolve(); |
| m_gl->Flush(); |
| } |
| @@ -971,7 +969,7 @@ bool DrawingBuffer::resizeFramebufferInternal(const IntSize& newSize) { |
| void DrawingBuffer::resolveAndBindForReadAndDraw() { |
| { |
| ScopedStateRestorer scopedStateRestorer(this); |
| - resolveMultisampleFramebufferInternal(); |
| + resolve(); |
| } |
| m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); |
| } |
| @@ -979,7 +977,7 @@ void DrawingBuffer::resolveAndBindForReadAndDraw() { |
| void DrawingBuffer::resolveMultisampleFramebufferInternal() { |
| DCHECK(m_stateRestorer); |
| m_stateRestorer->setFramebufferBindingDirty(); |
| - if (wantExplicitResolve() && !m_contentsChangeCommitted) { |
| + if (wantExplicitResolve() && !m_contentsChangeResolved) { |
| m_stateRestorer->setClearStateDirty(); |
| m_gl->BindFramebuffer(GL_READ_FRAMEBUFFER_ANGLE, m_multisampleFBO); |
| m_gl->BindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, m_fbo); |
| @@ -1009,7 +1007,12 @@ void DrawingBuffer::resolveMultisampleFramebufferInternal() { |
| m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); |
| if (m_antiAliasingMode == ScreenSpaceAntialiasing) |
| m_gl->ApplyScreenSpaceAntialiasingCHROMIUM(); |
| - m_contentsChangeCommitted = true; |
| +} |
| + |
| +void DrawingBuffer::resolve() { |
|
Justin Novosad
2017/03/31 20:26:53
Nit: In blink, we like to use the suffix "IfNeeded
|
| + if (m_antiAliasingMode != None) |
| + resolveMultisampleFramebufferInternal(); |
| + m_contentsChangeResolved = true; |
| } |
| void DrawingBuffer::restoreFramebufferBindings() { |