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

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

Issue 1423513005: Reland of: Make Imagebitmap Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: should-work code 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.cpp
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
index 137ab66a97f4e3ae3c1ab6d31e35407fb3659670..ddd4a86b58293da2028e6df44b9ecee79cf99221 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -106,6 +106,18 @@ ImageBitmap::ImageBitmap(Image* image, const IntRect& cropRect)
m_image = cropImage(static_cast<StaticBitmapImage*>(image), cropRect);
}
+ImageBitmap::ImageBitmap(PassRefPtr<StaticBitmapImage> image)
+{
+ m_image = image;
+}
+
+PassRefPtr<StaticBitmapImage> ImageBitmap::transfer()
+{
+ ASSERT(!isNeutered());
+ m_isNeutered = true;
+ return m_image.release();
+}
+
ImageBitmap::~ImageBitmap()
{
}
@@ -146,6 +158,11 @@ PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(Image* image, const IntR
return adoptRefWillBeNoop(new ImageBitmap(image, normalizedCropRect));
}
+PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(PassRefPtr<StaticBitmapImage> image)
+{
+ return adoptRefWillBeNoop(new ImageBitmap(image));
+}
+
unsigned long ImageBitmap::width() const
{
if (!m_image)
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmap.h ('k') | third_party/WebKit/Source/web/WebSerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698