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

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: const Created 7 years, 8 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/platform/graphics/BitmapImage.cpp
diff --git a/Source/core/platform/graphics/BitmapImage.cpp b/Source/core/platform/graphics/BitmapImage.cpp
index 0e7e1c3528f4ccd51ffbb7dbb2bd3ae7b64ca555..c6c2f8c6da0beaf25adc34aca0302f32540526fa 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()

Powered by Google App Engine
This is Rietveld 408576698