Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2699713005: Fix missing finalizeFrame barriers in WebGL animations (Closed)
Patch Set: Comments + readability improvements Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698