Chromium Code Reviews| Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| index d71fa2918bff5ff9cda380ecc013c34614338c6e..5dd6509af524b176c9527359cfa176b8c7cf3ddf 100644 |
| --- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| +++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
| @@ -61,6 +61,7 @@ |
| #include "core/rendering/RenderTheme.h" |
| #include "platform/fonts/FontCache.h" |
| #include "platform/geometry/FloatQuad.h" |
| +#include "platform/graphics/BitmapImage.h" |
| #include "platform/graphics/DrawLooperBuilder.h" |
| #include "platform/graphics/GraphicsContextStateSaver.h" |
| #include "platform/text/TextRun.h" |
| @@ -1508,6 +1509,9 @@ void CanvasRenderingContext2D::drawImageInternal(CanvasImageSource* imageSource, |
| if (srcRect.isEmpty()) |
| return; |
| + if (image->isBitmapImage() && image->maybeAnimated()) |
| + image = BitmapImage::create(static_cast<BitmapImage*>(image.get())->frameAtIndex(0)); |
|
Justin Novosad
2014/07/16 19:36:02
Would be cleaner to put this logic inside BitmapIm
Rémi Piotaix
2014/07/17 17:38:20
Done.
|
| + |
| FloatRect dirtyRect = clipBounds; |
| if (imageSource->isVideoElement()) { |
| drawVideo(static_cast<HTMLVideoElement*>(imageSource), srcRect, dstRect); |