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..be2bb7fe8c39e6613628acafd5bc20a58fdeb84a 100644 |
| --- a/Source/core/page/ImageBitmap.h |
| +++ b/Source/core/page/ImageBitmap.h |
| @@ -13,6 +13,8 @@ |
| #include "wtf/PassRefPtr.h" |
| #include "wtf/RefCounted.h" |
| +class SkImage; |
| + |
| namespace WebCore { |
| class HTMLCanvasElement; |
| @@ -30,16 +32,18 @@ public: |
| static PassRefPtr<ImageBitmap> create(ImageData*, IntRect); |
| static PassRefPtr<ImageBitmap> create(ImageBitmap*, IntRect); |
| - BitmapImage* bitmapImage() const { return m_bitmap.get(); } |
| + PassRefPtr<Image> bitmapImage() const { return m_bitmap; } |
| + SkImage* canvasImage() const { return m_canvasImage; } |
| - int bitmapWidth() const { return m_bitmap->width(); } |
| - int bitmapHeight() const { return m_bitmap->height(); } |
| - IntSize bitmapSize() const { return m_bitmap->size(); } |
| + int bitmapWidth() const { return m_bitmapSize.width(); } |
| + int bitmapHeight() const { return m_bitmapSize.height(); } |
| + IntSize bitmapSize() const { return m_bitmapSize; } |
| 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(); } |
| + IntRect cropRect() const { return m_cropRect; } |
| ~ImageBitmap() { }; |
| @@ -50,11 +54,12 @@ private: |
| ImageBitmap(ImageData*, IntRect); |
| ImageBitmap(ImageBitmap*, IntRect); |
| - RefPtr<BitmapImage> m_bitmap; |
| + RefPtr<Image> m_bitmap; |
| OwnPtr<ImageBuffer> m_buffer; |
| - |
| + SkImage* m_canvasImage; |
|
Justin Novosad
2013/07/22 15:35:41
We should no use SkImage directly. Could we have
|
| 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; // user defined size of the ImageBitmap |
| }; |
| } // namespace WebCore |