Chromium Code Reviews| Index: Source/core/page/ImageBitmap.h |
| diff --git a/Source/core/page/ImageBitmap.h b/Source/core/page/ImageBitmap.h |
| index 8b8c01c740152758474622c112de18a4dcdc193b..0e427df5defe04af435b9b69e3c406058bdc93f5 100644 |
| --- a/Source/core/page/ImageBitmap.h |
| +++ b/Source/core/page/ImageBitmap.h |
| @@ -6,7 +6,6 @@ |
| #define ImageBitmap_h |
| #include "bindings/v8/ScriptWrappable.h" |
| -#include "core/dom/ScriptExecutionContext.h" |
| #include "core/platform/graphics/BitmapImage.h" |
| #include "core/platform/graphics/ImageBuffer.h" |
| #include "core/platform/graphics/IntRect.h" |
| @@ -19,42 +18,44 @@ class HTMLCanvasElement; |
| class HTMLImageElement; |
| class HTMLVideoElement; |
| class ImageData; |
| -class ImageBitmapCallback; |
| class ImageBitmap : public RefCounted<ImageBitmap>, public ScriptWrappable { |
| public: |
| - static PassRefPtr<ImageBitmap> create(HTMLImageElement*, IntRect); |
| - static PassRefPtr<ImageBitmap> create(HTMLVideoElement*, IntRect); |
| - static PassRefPtr<ImageBitmap> create(HTMLCanvasElement*, IntRect); |
| - static PassRefPtr<ImageBitmap> create(ImageData*, IntRect); |
| - static PassRefPtr<ImageBitmap> create(ImageBitmap*, IntRect); |
| + static PassRefPtr<ImageBitmap> create(HTMLImageElement*, const IntRect&); |
| + static PassRefPtr<ImageBitmap> create(HTMLVideoElement*, const IntRect&); |
| + static PassRefPtr<ImageBitmap> create(HTMLCanvasElement*, const IntRect&); |
| + static PassRefPtr<ImageBitmap> create(ImageData*, const IntRect&); |
| + static PassRefPtr<ImageBitmap> create(ImageBitmap*, const IntRect&); |
| - BitmapImage* bitmapImage() const { return m_bitmap.get(); } |
| + PassRefPtr<Image> bitmapImage(); |
| + |
| + int bitmapWidth() const { return m_bitmapSize.width(); } |
| + int bitmapHeight() const { return m_bitmapSize.height(); } |
| + IntSize bitmapSize() const { return m_bitmapSize; } |
| - int bitmapWidth() const { return m_bitmap->width(); } |
| - int bitmapHeight() const { return m_bitmap->height(); } |
| - IntSize bitmapSize() const { return m_bitmap->size(); } |
| IntPoint bitmapOffset() const { return m_bitmapOffset; } |
| - int width() const { return m_size.width(); } |
| - int height() const { return m_size.height(); } |
| - IntSize size() const { return m_size; } |
| + int width() const { return m_cropRect.width(); } |
| + int height() const { return m_cropRect.height(); } |
| + IntSize size() const { return m_cropRect.size(); } |
| ~ImageBitmap() { }; |
| private: |
| - ImageBitmap(HTMLImageElement*, IntRect); |
| - ImageBitmap(HTMLVideoElement*, IntRect); |
| - ImageBitmap(HTMLCanvasElement*, IntRect); |
| - ImageBitmap(ImageData*, IntRect); |
| - ImageBitmap(ImageBitmap*, IntRect); |
| + ImageBitmap(HTMLImageElement*, const IntRect&); |
| + ImageBitmap(HTMLVideoElement*, const IntRect&); |
| + ImageBitmap(HTMLCanvasElement*, const IntRect&); |
| + ImageBitmap(ImageData*, const IntRect&); |
| + ImageBitmap(ImageBitmap*, const IntRect&); |
| - RefPtr<BitmapImage> m_bitmap; |
| + RefPtr<Image> m_bitmap; |
|
Justin Novosad
2013/07/16 23:05:53
Need a comment to explain that m_bitmap is not use
|
| OwnPtr<ImageBuffer> m_buffer; |
| + HTMLImageElement* m_imageElement; |
| IntPoint m_bitmapOffset; // offset applied to the image when it is drawn to the context |
| - IntSize m_size; // user defined size of the ImageBitmap |
| + IntSize m_bitmapSize; // actual size of the BitmapImage |
| + IntRect m_cropRect; |
| }; |
| } // namespace WebCore |