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

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

Issue 181693006: Refactoring source image usage in CanvasRenderingContext2D (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 88ab866e8a51534575039c07b19336efe0dfe468..31bc0f8251537655f576973b393430033bda244e 100644
--- a/Source/core/html/HTMLCanvasElement.h
+++ b/Source/core/html/HTMLCanvasElement.h
@@ -29,6 +29,7 @@
#define HTMLCanvasElement_h
#include "core/html/HTMLElement.h"
+#include "core/html/canvas/CanvasImageSource.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/IntSize.h"
#include "platform/graphics/Canvas2DLayerBridge.h"
@@ -59,7 +60,7 @@ public:
virtual void canvasDestroyed(HTMLCanvasElement*) = 0;
};
-class HTMLCanvasElement FINAL : public HTMLElement, public DocumentVisibilityObserver {
+class HTMLCanvasElement FINAL : public HTMLElement, public DocumentVisibilityObserver, public CanvasImageSource {
public:
static PassRefPtr<HTMLCanvasElement> create(Document&);
virtual ~HTMLCanvasElement();
@@ -116,7 +117,7 @@ public:
SecurityOrigin* securityOrigin() const;
void setOriginTainted() { m_originClean = false; }
- bool originClean() const { return m_originClean; }
+ virtual bool originClean() const { return m_originClean; }
AffineTransform baseTransform() const;
@@ -131,6 +132,11 @@ public:
// DocumentVisibilityObserver implementation
virtual void didChangeVisibilityState(PageVisibilityState) OVERRIDE;
+ // CanvasImageSource implementation
+ virtual PassRefPtr<Image> getSourceImageForCanvas(HTMLCanvasElement*, ExceptionState&, CanvasImageSourceUsage, bool* isVolatile) const OVERRIDE;
+ virtual bool wouldTaintOrigin(CanvasRenderingContext* destination) const OVERRIDE;
+ virtual FloatSize sourceSize() const OVERRIDE;
+
protected:
virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698