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

Unified Diff: Source/core/platform/image-decoders/ImageDecoder.cpp

Issue 23068027: Animated WebP: Optimize decoding in case of seeking (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add_noblend_image
Patch Set: Renames and comments Created 7 years, 4 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/image-decoders/ImageDecoder.cpp
diff --git a/Source/core/platform/image-decoders/ImageDecoder.cpp b/Source/core/platform/image-decoders/ImageDecoder.cpp
index 917161f10527eb91c1636fd73868dfe04515499f..65ee260b91ed56fa263f9b9b669a70ab3ee327a4 100644
--- a/Source/core/platform/image-decoders/ImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/ImageDecoder.cpp
@@ -152,7 +152,7 @@ void ImageDecoder::clearFrameBuffer(size_t frameIndex)
m_frameBufferCache[frameIndex].clearPixelData();
}
-size_t ImageDecoder::findRequiredPreviousFrame(size_t frameIndex)
+size_t ImageDecoder::findRequiredPreviousFrame(size_t frameIndex, bool frameRectIsOpaque)
{
ASSERT(frameIndex <= m_frameBufferCache.size());
if (!frameIndex) {
@@ -160,6 +160,11 @@ size_t ImageDecoder::findRequiredPreviousFrame(size_t frameIndex)
return notFound;
}
+ const ImageFrame* const currBuffer = &m_frameBufferCache[frameIndex];
+ if ((frameRectIsOpaque || currBuffer->alphaBlendSource() == ImageFrame::BlendAtopBgcolor)
+ && currBuffer->originalFrameRect().contains(IntRect(IntPoint(), size())))
Peter Kasting 2013/08/22 20:04:36 Nit: Since we clamp the frame rect to not extend o
urvang (Google) 2013/08/22 23:25:14 Good question! I have wondered the same because al
Peter Kasting 2013/08/22 23:39:31 I probably wasn't sure (as I'm still not sure, off
urvang (Google) 2013/08/23 00:13:35 Yes, the frames are clamed to image size for GIF a
+ return notFound;
+
// The starting state for this frame depends on the previous frame's
// disposal method.
size_t prevFrame = frameIndex - 1;

Powered by Google App Engine
This is Rietveld 408576698