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

Unified Diff: Source/core/html/HTMLImageElement.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/HTMLImageElement.h
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index 3722c30c26b5613deb6cb779550ad78e617038cb..9df604e3cd90b5c190b57ed80a9a14344484abca 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -26,6 +26,7 @@
#include "core/html/HTMLElement.h"
#include "core/html/HTMLImageLoader.h"
+#include "core/html/canvas/CanvasImageSource.h"
#include "platform/graphics/GraphicsTypes.h"
#include "wtf/WeakPtr.h"
@@ -33,7 +34,7 @@ namespace WebCore {
class HTMLFormElement;
-class HTMLImageElement FINAL : public HTMLElement {
+class HTMLImageElement FINAL : public HTMLElement, public CanvasImageSource {
public:
static PassRefPtr<HTMLImageElement> create(Document&);
static PassRefPtr<HTMLImageElement> create(Document&, HTMLFormElement*);
@@ -84,6 +85,12 @@ public:
virtual HTMLFormElement* formOwner() const OVERRIDE;
void formRemovedFromTree(const Node* formRoot);
+ // CanvasImageSourceImplementations
+ virtual PassRefPtr<Image> getSourceImageForCanvas(HTMLCanvasElement*, ExceptionState&, CanvasImageSourceUsage, bool* isVolatile) const;
+ virtual bool wouldTaintOrigin(CanvasRenderingContext* destination) const OVERRIDE;
+ virtual FloatSize sourceSize() const OVERRIDE;
+ virtual FloatSize defaultDestinationSize() const OVERRIDE;
+
protected:
explicit HTMLImageElement(Document&, HTMLFormElement* = 0);

Powered by Google App Engine
This is Rietveld 408576698