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

Unified Diff: Source/core/platform/graphics/ImageBuffer.h

Issue 19705006: Use SkImage as a backing store for copying 2d Contexts to ImageBitmaps. Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 4 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: Source/core/platform/graphics/ImageBuffer.h
diff --git a/Source/core/platform/graphics/ImageBuffer.h b/Source/core/platform/graphics/ImageBuffer.h
index b4c0af9f3398dd1bf1c444c0504560a68ecf1f4a..32c7b0a34b0234185cdcccc09aedece2281691ac 100644
--- a/Source/core/platform/graphics/ImageBuffer.h
+++ b/Source/core/platform/graphics/ImageBuffer.h
@@ -43,6 +43,7 @@
#include "wtf/Vector.h"
class SkCanvas;
+class SkSurface;
namespace WebKit { class WebLayer; }
@@ -104,6 +105,7 @@ public:
GraphicsContext* context() const;
+ PassRefPtr<Image> imageSnapshot() const;
PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const;
// Give hints on the faster copyImage Mode, return DontCopyBackingStore if it supports the DontCopyBackingStore behavior
// or return CopyBackingStore if it doesn't.
@@ -132,6 +134,8 @@ public:
private:
bool isValid() const;
+ void createAcceleratedCanvas(const IntSize&, OwnPtr<Canvas2DLayerBridge>*, OpacityMode);
+ void createNonPlatformCanvas(const IntSize&);
void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, BlendMode);
@@ -145,6 +149,7 @@ private:
IntSize m_logicalSize;
float m_resolutionScale;
OwnPtr<SkCanvas> m_canvas;
+ OwnPtr<SkSurface> m_surface;
OwnPtr<GraphicsContext> m_context;
OwnPtr<Canvas2DLayerBridge> m_layerBridge;

Powered by Google App Engine
This is Rietveld 408576698