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

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: fix vector pre-allocation issue 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..8ae958f71726a5d1011c358c4bfa5aa628a2089d 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(PassRefPtr<SkImage>);
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_isNeutered; }
+ 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(PassRefPtr<SkImage>);
PassRefPtr<SkImage> cropImage(PassRefPtr<SkImage>, const IntRect&);
@@ -64,6 +69,7 @@ private:
bool requestsHighLiveResourceCachePriority() override { return true; }
RefPtr<SkImage> m_image;
+ bool m_isNeutered;
sof 2015/11/16 20:56:17 nit: if you provide the initial value here (bool m
xidachen 2015/11/17 15:24:27 Done.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698