Chromium Code Reviews| 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()); |