Index: Source/core/html/HTMLCanvasElement.h |
diff --git a/Source/core/html/HTMLCanvasElement.h b/Source/core/html/HTMLCanvasElement.h |
index 05f54d0194b6253af1a8654d778cb7dbb5d540fd..67d374af52a8b9630e63aee72d23b573d9acd0b5 100644 |
--- a/Source/core/html/HTMLCanvasElement.h |
+++ b/Source/core/html/HTMLCanvasElement.h |
@@ -35,6 +35,7 @@ |
#include "platform/geometry/IntSize.h" |
#include "platform/graphics/Canvas2DLayerBridge.h" |
#include "platform/graphics/GraphicsTypes.h" |
+#include "platform/graphics/ImageBufferClient.h" |
#include "wtf/Forward.h" |
#define CanvasDefaultInterpolationQuality InterpolationLow |
@@ -62,7 +63,7 @@ public: |
virtual void canvasDestroyed(HTMLCanvasElement*) = 0; |
}; |
-class HTMLCanvasElement FINAL : public HTMLElement, public DocumentVisibilityObserver, public CanvasImageSource { |
+class HTMLCanvasElement FINAL : public HTMLElement, public DocumentVisibilityObserver, public CanvasImageSource, public ImageBufferClient { |
public: |
static PassRefPtr<HTMLCanvasElement> create(Document&); |
virtual ~HTMLCanvasElement(); |
@@ -125,7 +126,9 @@ public: |
bool is3D() const; |
- bool hasImageBuffer() const { return m_imageBuffer.get(); } |
+ bool hasImageBuffer() const { return m_imageBuffer; } |
+ bool hasValidImageBuffer() const; |
+ void discardImageBuffer(); |
bool shouldAccelerate(const IntSize&) const; |
@@ -139,6 +142,9 @@ public: |
virtual bool wouldTaintOrigin(SecurityOrigin*) const OVERRIDE; |
virtual FloatSize sourceSize() const OVERRIDE; |
+ // ImageBufferClient implementation |
+ virtual void notifySurfaceInvalid() OVERRIDE; |
+ |
protected: |
virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; |
@@ -153,8 +159,8 @@ private: |
PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount); |
void createImageBuffer(); |
+ void createImageBufferInternal(); |
void clearImageBuffer(); |
- void discardImageBuffer(); |
void setSurfaceSize(const IntSize&); |