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

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

Issue 2506043002: Allow ImageBitmap objects to be created from placeholder canvases. (Closed)
Patch Set: add test Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-placeholder-createImageBitmap.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 585a6413355182680312eb3e2765569e5f6d0c8d..c1cb64a471998ea3f1508f3306a180c6237de77a 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
@@ -469,7 +469,11 @@ ImageBitmap::ImageBitmap(HTMLCanvasElement* canvas,
Optional<IntRect> cropRect,
const ImageBitmapOptions& options) {
ASSERT(canvas->isPaintable());
- RefPtr<Image> input = canvas->copiedImage(BackBuffer, PreferAcceleration);
+ RefPtr<Image> input;
+ if (canvas->placeholderFrame())
+ input = canvas->placeholderFrame();
+ else
+ input = canvas->copiedImage(BackBuffer, PreferAcceleration);
ParsedOptions parsedOptions =
parseOptions(options, cropRect, IntSize(input->width(), input->height()));
if (dstBufferSizeHasOverflow(parsedOptions))
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-placeholder-createImageBitmap.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698