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

Unified Diff: Source/core/platform/graphics/BitmapImage.cpp

Issue 14317005: Checking if frame is complete and access duration doesn't need a decode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: done Created 7 years, 7 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/WebKit/chromium/tests/GIFImageDecoderTest.cpp ('k') | Source/core/platform/graphics/ImageSource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/BitmapImage.cpp
diff --git a/Source/core/platform/graphics/BitmapImage.cpp b/Source/core/platform/graphics/BitmapImage.cpp
index 119507f93c0b782604984efe6aaf9fbbff5408fa..2f5390b8280360e4dc19f68cf50d2284ba8e2dcd 100644
--- a/Source/core/platform/graphics/BitmapImage.cpp
+++ b/Source/core/platform/graphics/BitmapImage.cpp
@@ -308,16 +308,16 @@ PassNativeImagePtr BitmapImage::frameAtIndex(size_t index)
bool BitmapImage::frameIsCompleteAtIndex(size_t index)
{
- if (!ensureFrameIsCached(index))
- return false;
- return m_frames[index].m_isComplete;
+ if (index < m_frames.size() && m_frames[index].m_haveMetadata && m_frames[index].m_isComplete)
+ return true;
+ return m_source.frameIsCompleteAtIndex(index);
}
float BitmapImage::frameDurationAtIndex(size_t index)
{
- if (!ensureFrameIsCached(index))
- return 0;
- return m_frames[index].m_duration;
+ if (index < m_frames.size() && m_frames[index].m_haveMetadata)
+ return m_frames[index].m_duration;
+ return m_source.frameDurationAtIndex(index);
}
PassNativeImagePtr BitmapImage::nativeImageForCurrentFrame()
« no previous file with comments | « Source/WebKit/chromium/tests/GIFImageDecoderTest.cpp ('k') | Source/core/platform/graphics/ImageSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698