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

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: Rebase. LayoutTests: Replace assert_array_equals with an for-each: assert_aprox_equals 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..030f89640ef5fd937a18e87847908c40100e3fb9 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -7,6 +7,7 @@
#include "core/html/HTMLCanvasElement.h"
#include "core/html/HTMLVideoElement.h"
#include "core/html/ImageData.h"
+#include "platform/graphics/skia/SkiaUtils.h"
#include "platform/image-decoders/ImageDecoder.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "wtf/RefPtr.h"
@@ -402,6 +403,12 @@ void ImageBitmap::close()
m_isNeutered = true;
}
+// static
+ImageBitmap* ImageBitmap::take(ScriptPromiseResolver*, sk_sp<SkImage> image)
+{
+ return ImageBitmap::create(StaticBitmapImage::create(fromSkSp(image)));
+}
+
PassOwnPtr<uint8_t[]> ImageBitmap::copyBitmapData(AlphaDisposition alphaOp)
{
SkImageInfo info = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, (alphaOp == PremultiplyAlpha) ? kPremul_SkAlphaType : kUnpremul_SkAlphaType);

Powered by Google App Engine
This is Rietveld 408576698