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

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

Issue 1899403002: MediaStream Image Capture (2): Platform::ImageCaptureFrameGrabber and grabFrame() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: 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 62de013040fc6482f6dc4be6e11273456b045b58..3ff4fe1fab70d5afa179a017448541b9773dd6ae 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -402,6 +402,15 @@ void ImageBitmap::close()
m_isNeutered = true;
}
+// static
+ImageBitmap* ImageBitmap::take(ScriptPromiseResolver*, PassOwnPtr<SkBitmap> bitmap)
+{
+ RefPtr<StaticBitmapImage> image = StaticBitmapImage::create(
+ adoptRef(SkImage::NewFromBitmap(*bitmap.leakPtr())));
Reilly Grant (use Gerrit) 2016/04/25 22:37:33 I think you just want SkImage::NewFromBitmap(*bitm
mcasas 2016/04/27 00:51:29 Done.
+
+ return ImageBitmap::create(image.release());
Reilly Grant (use Gerrit) 2016/04/25 22:37:33 It shouldn't be necessary to call release here. Th
mcasas 2016/04/27 00:51:28 Done.
+}
+
PassOwnPtr<uint8_t[]> ImageBitmap::copyBitmapData(AlphaDisposition alphaOp)
{
SkImageInfo info = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, (alphaOp == PremultiplyAlpha) ? kPremul_SkAlphaType : kUnpremul_SkAlphaType);
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmap.h ('k') | third_party/WebKit/Source/modules/imagecapture/ImageCapture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698