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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2123623002: Reland: Make 2D canvas disable gpu acceleration when getImageData is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 5 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/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index bfd4ac0787e2ea883278e4d58ee0d8d7ac8ddab9..968d1f06022216cc6a3ffbeb13c212c5bddb39e5 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -318,6 +318,13 @@ void HTMLCanvasElement::didFinalizeFrame()
m_dirtyRect = FloatRect();
}
+void HTMLCanvasElement::didDisableAcceleration()
+{
+ // We must force a paint invalidation on the canvas even if it's
+ // content did not change because it layer was destroyed.
+ didDraw(FloatRect(0, 0, size().width(), size().height()));
+}
+
void HTMLCanvasElement::restoreCanvasMatrixClipStack(SkCanvas* canvas) const
{
if (m_context)

Powered by Google App Engine
This is Rietveld 408576698