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

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

Issue 19705006: Use SkImage as a backing store for copying 2d Contexts to ImageBitmaps. Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/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

Powered by Google App Engine
This is Rietveld 408576698