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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2267653005: Resolving drawImage issue with canvases that contain bitmap images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index f2bfec4694d5ea0db8288d6798317bef582b67cc..9f7cab7b53375376b33aeaec58540fac3d84f35e 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -1101,7 +1101,12 @@ PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(SourceImageStatus*
m_context->paintRenderingResultsToCanvas(BackBuffer);
}
- RefPtr<SkImage> image = buffer()->newSkImageSnapshot(hint, reason);
+ RefPtr<SkImage> image;
+ if (renderingContext()->getContextType() == CanvasRenderingContext::ContextImageBitmap)
Justin Novosad 2016/08/22 19:42:25 Avoid explicit type checks when possible. In this
zakerinasab 2016/08/22 19:55:50 Done.
+ image = renderingContext()->getImage()->imageForCurrentFrame();
+ else
+ image = buffer()->newSkImageSnapshot(hint, reason);
+
if (image) {
*status = NormalSourceImageStatus;
return StaticBitmapImage::create(image.release());

Powered by Google App Engine
This is Rietveld 408576698