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

Unified Diff: third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h

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/platform/graphics/Canvas2DImageBufferSurface.h
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h b/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h
index 813a9484c3af7d43b2078e641c957919d8f2674e..f95a07d355333b6aefb4f5963c3a98c28efdf9fb 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h
@@ -43,6 +43,18 @@ public:
: ImageBufferSurface(size, opacityMode)
, m_layerBridge(Canvas2DLayerBridge::create(size, msaaSampleCount, opacityMode, accelerationMode))
{
+ init();
+ }
+
+ Canvas2DImageBufferSurface(PassRefPtr<Canvas2DLayerBridge> bridge, const IntSize& size)
+ : ImageBufferSurface(size, bridge->opacityMode())
+ , m_layerBridge(std::move(bridge))
+ {
+ init();
+ }
+
+ void init()
+ {
clear();
if (isValid())
m_layerBridge->flush();

Powered by Google App Engine
This is Rietveld 408576698