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

Unified Diff: Source/core/frame/ImageBitmap.h

Issue 181693006: Refactoring source image usage in CanvasRenderingContext2D (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: applied last corrections 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/core.gypi ('k') | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ImageBitmap.h
diff --git a/Source/core/frame/ImageBitmap.h b/Source/core/frame/ImageBitmap.h
index 7f62bdaee9948f3105ad84c6f1f62e3ebe3ed015..1a4fd08ecb0bde9d3756a4fbf89e0001921ea640 100644
--- a/Source/core/frame/ImageBitmap.h
+++ b/Source/core/frame/ImageBitmap.h
@@ -7,6 +7,7 @@
#include "bindings/v8/ScriptWrappable.h"
#include "core/html/HTMLImageElement.h"
+#include "core/html/canvas/CanvasImageSource.h"
#include "platform/geometry/IntRect.h"
#include "platform/graphics/Image.h"
#include "wtf/PassRefPtr.h"
@@ -18,7 +19,7 @@ class HTMLCanvasElement;
class HTMLVideoElement;
class ImageData;
-class ImageBitmap FINAL : public RefCounted<ImageBitmap>, public ScriptWrappable, public ImageLoaderClient {
+class ImageBitmap FINAL : public RefCounted<ImageBitmap>, public ScriptWrappable, public ImageLoaderClient, public CanvasImageSource {
public:
static PassRefPtr<ImageBitmap> create(HTMLImageElement*, const IntRect&);
@@ -32,7 +33,6 @@ public:
PassRefPtr<HTMLImageElement> imageElement() const { return m_imageElement; }
IntRect bitmapRect() const { return m_bitmapRect; }
- IntPoint bitmapOffset() const { return m_bitmapOffset; }
int width() const { return m_cropRect.width(); }
int height() const { return m_cropRect.height(); }
@@ -40,6 +40,12 @@ public:
virtual ~ImageBitmap();
+ // CanvasImageSource implementation
+ virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceImageStatus*) const OVERRIDE;
+ virtual bool wouldTaintOrigin(SecurityOrigin*) const OVERRIDE { return false; };
+ virtual void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const OVERRIDE;
+ virtual FloatSize sourceSize() const OVERRIDE;
+
private:
ImageBitmap(HTMLImageElement*, const IntRect&);
ImageBitmap(HTMLVideoElement*, const IntRect&);
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698