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

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

Issue 1423513005: Reland of: Make Imagebitmap Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: third_party/WebKit/Source/core/frame/ImageBitmap.h
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.h b/third_party/WebKit/Source/core/frame/ImageBitmap.h
index 71fd4a52f3b7c348eb5679ca5c961ad580afda69..3917d8e19335eeb418fc631aa286f4cbc993e6e1 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.h
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.h
@@ -33,12 +33,16 @@ public:
static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageData*, const IntRect&);
static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageBitmap*, const IntRect&);
static PassRefPtrWillBeRawPtr<ImageBitmap> create(Image*, const IntRect&);
+ static PassRefPtrWillBeRawPtr<ImageBitmap> create(SkImage*);
Justin Novosad 2015/11/11 05:29:08 SkImage* => PassRefPtr<SkImage>
xidachen 2015/11/16 18:00:51 Done.
SkImage* skImage() const { return (m_image) ? m_image.get() : nullptr; }
int width() const { return (m_image) ? m_image->width(): 0; }
int height() const { return (m_image) ? m_image->height(): 0; }
IntSize size() const { return (m_image) ? IntSize(m_image->width(), m_image->height()) : IntSize(); }
+ bool isNeutered() const { return !m_image; }
Justin Novosad 2015/11/11 05:29:08 are we 100% sure that !m_image always means that t
xidachen 2015/11/16 18:00:51 This is a good point. I think we should have a pri
+ PassRefPtr<SkImage> transfer();
+
~ImageBitmap() override;
// CanvasImageSource implementation
@@ -56,6 +60,7 @@ private:
ImageBitmap(ImageData*, const IntRect&);
ImageBitmap(ImageBitmap*, const IntRect&);
ImageBitmap(Image*, const IntRect&);
+ ImageBitmap(SkImage*);
PassRefPtr<SkImage> cropImage(PassRefPtr<SkImage>, const IntRect&);

Powered by Google App Engine
This is Rietveld 408576698