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

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: 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/core/events/EventTypeNames.in ('k') | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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&);
« no previous file with comments | « Source/core/events/EventTypeNames.in ('k') | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698