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

Unified Diff: Source/platform/graphics/BitmapImage.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: Correcting bug and moving logic to HTMLImageElenemt 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/platform/graphics/BitmapImage.cpp
diff --git a/Source/platform/graphics/BitmapImage.cpp b/Source/platform/graphics/BitmapImage.cpp
index db9b62e819318acf71093cee5a3b1019b8b1296a..bca46ea8245cb64607434c2e838d65661d2ddc7f 100644
--- a/Source/platform/graphics/BitmapImage.cpp
+++ b/Source/platform/graphics/BitmapImage.cpp
@@ -367,6 +367,14 @@ PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame()
return frameAtIndex(currentFrame());
}
+PassRefPtr<Image> BitmapImage::imageForDefaultFrame()
+{
+ if (isBitmapImage() && maybeAnimated())
+ return BitmapImage::create(frameAtIndex(0));
+
+ return Image::imageForDefaultFrame();
+}
+
bool BitmapImage::frameHasAlphaAtIndex(size_t index)
{
if (m_frames.size() <= index)

Powered by Google App Engine
This is Rietveld 408576698