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

Unified Diff: Source/core/imagebitmap/ImageBitmapFactories.cpp

Issue 758493004: canvas: make a temporary buffer when a context doesn't exist. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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: Source/core/imagebitmap/ImageBitmapFactories.cpp
diff --git a/Source/core/imagebitmap/ImageBitmapFactories.cpp b/Source/core/imagebitmap/ImageBitmapFactories.cpp
index ac39e7032e001e5c89048930235a59cff6d70ac8..9dd9d6a1ee11870129e87d99cab288f7502cde72 100644
--- a/Source/core/imagebitmap/ImageBitmapFactories.cpp
+++ b/Source/core/imagebitmap/ImageBitmapFactories.cpp
@@ -178,7 +178,8 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState,
}
// FIXME: make ImageBitmap creation asynchronous crbug.com/258082
- return fulfillImageBitmap(scriptState, canvas->buffer() ? ImageBitmap::create(canvas, IntRect(sx, sy, sw, sh)) : nullptr);
+ RefPtr<Image> canvasImage = canvas->copiedImage(BackBuffer);
Justin Novosad 2014/11/27 00:49:31 This seems like a step in the wrong direction. We
dshwang 2014/11/27 15:12:11 Thank you for explaining. I rollback this change.
+ return fulfillImageBitmap(scriptState, canvasImage ? ImageBitmap::create(canvasImage.get(), IntRect(sx, sy, sw, sh)) : nullptr);
}
ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, Blob* blob, ExceptionState& exceptionState)

Powered by Google App Engine
This is Rietveld 408576698