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

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

Issue 2699713005: Fix missing finalizeFrame barriers in WebGL animations (Closed)
Patch Set: fixed test failures 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
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..e6e7081a33e8b15cd35d1fafb308138015f7ffd6 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_paintInvalidatedForCurrentFrame = 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;
+
+ if (!m_paintInvalidatedForCurrentFrame) {
+ m_paintInvalidatedForCurrentFrame = true;
+ 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_paintInvalidatedForCurrentFrame = false;
+}
+
void WebGLRenderingContextBase::onErrorMessage(const char* message,
int32_t id) {
if (m_synthesizedErrorsToConsole)

Powered by Google App Engine
This is Rietveld 408576698