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

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: Corrections according to comments + rebase master 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
« no previous file with comments | « Source/platform/graphics/BitmapImage.h ('k') | Source/platform/graphics/Image.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/BitmapImage.cpp
diff --git a/Source/platform/graphics/BitmapImage.cpp b/Source/platform/graphics/BitmapImage.cpp
index b9e49de05d2a61f129c7ba950b7af31ebf590547..60aef55c5dbf910920c7970e9ce8267350d26fc2 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)
« no previous file with comments | « Source/platform/graphics/BitmapImage.h ('k') | Source/platform/graphics/Image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698