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

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

Issue 211503006: Implementation of 2D canvas context lost/restored events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 9 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
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerBridge.cpp ('k') | Source/platform/graphics/ImageBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/ImageBuffer.h
diff --git a/Source/platform/graphics/ImageBuffer.h b/Source/platform/graphics/ImageBuffer.h
index 7e7717f38ee020efe536f41cd74bac28531f4eec..5d8fb103fd7b87d83e16a3c2bc8c5a8690ca1483 100644
--- a/Source/platform/graphics/ImageBuffer.h
+++ b/Source/platform/graphics/ImageBuffer.h
@@ -55,6 +55,7 @@ namespace WebCore {
class DrawingBuffer;
class Image;
+class ImageBufferClient;
class IntPoint;
class IntRect;
@@ -81,8 +82,12 @@ public:
~ImageBuffer();
+ void setClient(ImageBufferClient* client) { m_client = client; }
+
const IntSize& size() const { return m_surface->size(); }
bool isAccelerated() const { return m_surface->isAccelerated(); }
+ bool isSurfaceValid() const;
+ bool restoreSurface() const;
void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); }
@@ -117,9 +122,10 @@ public:
void flush();
+ void notifySurfaceInvalid();
+
private:
ImageBuffer(PassOwnPtr<ImageBufferSurface>);
- bool isValid() const;
void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::WebBlendModeNormal);
void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing = IntSize());
@@ -133,6 +139,7 @@ private:
OwnPtr<ImageBufferSurface> m_surface;
OwnPtr<GraphicsContext> m_context;
+ ImageBufferClient* m_client;
};
struct ImageDataBuffer {
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerBridge.cpp ('k') | Source/platform/graphics/ImageBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698