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

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

Issue 2388293002: Disable GPU acceleration on 2D canvas when readbacks are needed (Closed)
Patch Set: fixed tests Created 4 years, 2 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 3d4ef0a1a3c796c9c8924e38c78b2339033c701f..e5b4a2b4db5de78fa9b5dd1cbcd68d44fd68f5bd 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -1290,6 +1290,12 @@ PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(
? buffer()->newSkImageSnapshot(hint, reason)
: createTransparentImage(size())->imageForCurrentFrame();
} else {
+ if (ExpensiveCanvasHeuristicParameters::
+ DisableAccelerationToAvoidReadbacks &&
+ !RuntimeEnabledFeatures::canvas2dFixedRenderingModeEnabled() &&
+ hint == PreferNoAcceleration && m_context->isAccelerated() &&
+ hasImageBuffer())
+ buffer()->disableAcceleration();
RefPtr<blink::Image> image = renderingContext()->getImage(hint, reason);
skImage = image ? image->imageForCurrentFrame()
: createTransparentImage(size())->imageForCurrentFrame();

Powered by Google App Engine
This is Rietveld 408576698