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

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

Issue 2063473002: Make 2D canvas disable gpu acceleration when getImageData is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments and fix test failures Created 4 years, 6 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 fd63a8c4c28799f5b87de40cc57d89f3b1e1f93c..5b5d29e843231598da863f36a4d5c0a8304b907c 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