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

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

Issue 1307143005: Make 2D canvas smarter about chosing whether or not to use GPU acceleration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: migrated to chromium repo Created 5 years, 3 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 e1d2414c2d215ac8ad09376a6d453ae37c5f5f78..b215d35575939f2697ac03b6c679f76b04f45e13 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DImageBufferSurface.h
@@ -39,9 +39,9 @@ namespace blink {
// This shim necessary because ImageBufferSurfaces are not allowed to be RefCounted
class Canvas2DImageBufferSurface final : public ImageBufferSurface {
public:
- Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = NonOpaque, int msaaSampleCount = 1)
+ Canvas2DImageBufferSurface(const IntSize& size, int msaaSampleCount, OpacityMode opacityMode, Canvas2DLayerBridge::AccelerationMode accelerationMode)
: ImageBufferSurface(size, opacityMode)
- , m_layerBridge(Canvas2DLayerBridge::create(size, opacityMode, msaaSampleCount))
+ , m_layerBridge(Canvas2DLayerBridge::create(size, msaaSampleCount, opacityMode, accelerationMode))
{
clear();
if (isValid())
@@ -69,9 +69,10 @@ public:
void didDraw(const FloatRect& rect) override { m_layerBridge->didDraw(rect); }
void flush() override { m_layerBridge->flush(); }
void flushGpu() override { m_layerBridge->flushGpu(); }
+ void prepareSurfaceForPaintingIfNeeded() override { m_layerBridge->prepareSurfaceForPaintingIfNeeded(); }
bool writePixels(const SkImageInfo& origInfo, const void* pixels, size_t rowBytes, int x, int y) override { return m_layerBridge->writePixels(origInfo, pixels, rowBytes, x, y); }
- PassRefPtr<SkImage> newImageSnapshot() override { return m_layerBridge->newImageSnapshot(); }
+ PassRefPtr<SkImage> newImageSnapshot(AccelerationHint hint) override { return m_layerBridge->newImageSnapshot(hint); }
private:
RefPtr<Canvas2DLayerBridge> m_layerBridge;
};

Powered by Google App Engine
This is Rietveld 408576698