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

Unified Diff: Source/core/html/HTMLCanvasElement.h

Issue 211503006: Implementation of 2D canvas context lost/restored events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: adding missing file 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
Index: Source/core/html/HTMLCanvasElement.h
diff --git a/Source/core/html/HTMLCanvasElement.h b/Source/core/html/HTMLCanvasElement.h
index fa8c45a47d6ccb08159bd6df9a23cfbd02b31988..eb52f06dd4cd8ffa9ea719ca1c980d9af64b93c0 100644
--- a/Source/core/html/HTMLCanvasElement.h
+++ b/Source/core/html/HTMLCanvasElement.h
@@ -34,6 +34,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
@@ -61,7 +62,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();
@@ -124,7 +125,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;
@@ -138,6 +141,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;
@@ -152,8 +158,8 @@ private:
PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount);
void createImageBuffer();
+ void createImageBufferInternal();
void clearImageBuffer();
- void discardImageBuffer();
void setSurfaceSize(const IntSize&);

Powered by Google App Engine
This is Rietveld 408576698