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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 388253004: Drawing an animated image to a canvas now behave as expected (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding test Created 6 years, 5 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: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 829cdb8fb66916bdd22a5e9a786b74057c50b9d2..38958118a8d33c78ce1e8e279d2ef2fa865ba29b 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,8 @@ void CanvasRenderingContext2D::drawImageInternal(CanvasImageSource* imageSource,
if (srcRect.isEmpty())
return;
+ image = image->imageForDefaultFrame();
Justin Novosad 2014/07/18 15:22:32 Wait a minute.. according to the spec, the behavio
Rémi Piotaix 2014/07/18 16:04:35 Done.
+
FloatRect dirtyRect = clipBounds;
if (imageSource->isVideoElement()) {
drawVideo(static_cast<HTMLVideoElement*>(imageSource), srcRect, dstRect);
« no previous file with comments | « LayoutTests/fast/canvas/canvas-drawImage-animated-expected.txt ('k') | Source/platform/graphics/BitmapImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698