Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| index 751fc5eb2408c10122df21f26b728efe6570c8f7..75ad841674aa06586451d8dff55af896f057b515 100644 |
| --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| @@ -1182,6 +1182,7 @@ void WebGLRenderingContextBase::initializeNewContext() { |
| ASSERT(drawingBuffer()); |
| m_markedCanvasDirty = false; |
| + m_animationFrameInProgress = false; |
| m_activeTextureUnit = 0; |
| m_packAlignment = 4; |
| m_unpackAlignment = 4; |
| @@ -1397,17 +1398,23 @@ void WebGLRenderingContextBase::markContextChanged( |
| if (!canvas()) |
| return; |
| - LayoutBox* layoutBox = canvas()->layoutBox(); |
| - if (layoutBox && layoutBox->hasAcceleratedCompositing()) { |
| - layoutBox->contentChanged(changeType); |
| - } |
| - if (!m_markedCanvasDirty) { |
| - m_markedCanvasDirty = true; |
| + m_markedCanvasDirty = true; |
|
xlai (Olivia)
2017/02/21 19:56:56
Just a bit curious: does this m_markedCanvasDirty
|
| + |
| + if (!m_animationFrameInProgress) { |
| + m_animationFrameInProgress = true; |
|
Justin Novosad
2017/02/21 18:06:21
I renamed this variable. I think it is more readab
|
| + LayoutBox* layoutBox = canvas()->layoutBox(); |
| + if (layoutBox && layoutBox->hasAcceleratedCompositing()) { |
| + layoutBox->contentChanged(changeType); |
| + } |
| IntSize canvasSize = clampedCanvasSize(); |
| didDraw(SkIRect::MakeXYWH(0, 0, canvasSize.width(), canvasSize.height())); |
| } |
| } |
| +void WebGLRenderingContextBase::finalizeFrame() { |
| + m_animationFrameInProgress = false; |
| +} |
| + |
| void WebGLRenderingContextBase::onErrorMessage(const char* message, |
| int32_t id) { |
| if (m_synthesizedErrorsToConsole) |