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

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: 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 7e5b822909b7c109cac91a7f54b752d721097ace..d45d129e413cb033bb3176c2de56b924a1f50dc4 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -87,6 +87,16 @@ ImageBitmap::ImageBitmap(Image* image, const IntRect& cropRect)
m_image = cropImage(image->imageForCurrentFrame(), cropRect);
}
+ImageBitmap::ImageBitmap(SkImage* image)
+{
+ m_image = adoptRef(image);
+}
+
+PassRefPtr<SkImage> ImageBitmap::transfer()
+{
+ return m_image.release();
Justin Novosad 2015/11/11 05:29:08 From the postMessage spec: "If any object is liste
xidachen 2015/11/16 18:00:51 Done.
+}
+
ImageBitmap::~ImageBitmap()
{
}
@@ -127,6 +137,11 @@ PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(Image* image, const IntR
return adoptRefWillBeNoop(new ImageBitmap(image, normalizedCropRect));
}
+PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(SkImage* image)
+{
+ return adoptRefWillBeNoop(new ImageBitmap(image));
+}
+
PassRefPtr<SkImage> ImageBitmap::cropImage(PassRefPtr<SkImage> image, const IntRect& cropRect)
{
ASSERT(image);

Powered by Google App Engine
This is Rietveld 408576698