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

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: Change SkImage to use srcRect pointer. 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..da08ea49ca3a06d4f1b7487a0ea662f7806038c3 100644
--- a/Source/core/page/ImageBitmap.h
+++ b/Source/core/page/ImageBitmap.h
@@ -30,16 +30,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; }
+ bool derivedFromCanvas() const { return m_derivedFromCanvas; }
- 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 +52,14 @@ private:
ImageBitmap(ImageData*, IntRect);
ImageBitmap(ImageBitmap*, IntRect);
- RefPtr<BitmapImage> m_bitmap;
+ RefPtr<Image> m_bitmap;
Justin Novosad 2013/07/22 15:35:41 With what we've discussed, should this be CachedIm
OwnPtr<ImageBuffer> m_buffer;
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
+
+ bool m_derivedFromCanvas;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698