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

Issue 16260002: Reland "Decode GIF image frames on demand". (Closed)

Created:
7 years, 6 months ago by Xianzhu
Modified:
7 years, 6 months ago
CC:
blink-reviews, jamesr, eae+blinkwatch, danakj, Rik, f(malita), pdr, Stephen Chennney, jeez, pdr.
Visibility:
Public.

Description

Reland "Decode GIF image frames on demand". Change over the original patch: workaround const_reverse_iterator issue of Android compiler. Previously GIFImageDecoder::frameBufferAtIndex() decodes all frames from the last decoded frame to the requested frame. This causes delays when skipping to specific frames. With this change, GIFImageDecoder decodes only necessary frames based on previous frames' disposal methods. Added ImageDecoder::findRequiredPreviousFrame() to find the required previous frame based on the disposal methods. Also changed the behavior of GIFImageDecoder::clearFrameBufferCache() (moved to ImageDecoder because it can be shared between multi-frame decoders) because the original semantics no longer apply with on-demand frame decoding. Instead of clearing before the given frame, now clear from the whole frame buffer cache, preserving the frames that are likely to be used soon. BUG=238242 TEST=ImageDecoderTest.requiredPreviousFrameIndex*, ImageDecoderTest.clearCacheExceptFrame*, GIFImageDecoderTest.updateRequiredPreviousFrameAfterFirstDecode, GIFImageDecoderTest.randomFrameDecode, GIFImageDecoderTest.randomDecodeAfterClearFrameBufferCache, GIFImageDecoderTest.resumePartialDecodeAfterClearFrameBufferCache TBR=abarth@chromium.org, pkasting@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151564

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+728 lines, -671 lines) Patch
M Source/WebKit/chromium/WebKit.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M Source/WebKit/chromium/tests/DragImageTest.cpp View 2 chunks +6 lines, -8 lines 0 comments Download
D Source/WebKit/chromium/tests/GIFImageDecoderTest.cpp View 1 chunk +0 lines, -324 lines 0 comments Download
M Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp View 3 chunks +9 lines, -11 lines 0 comments Download
M Source/core/core.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/platform/graphics/BitmapImage.h View 5 chunks +20 lines, -24 lines 0 comments Download
M Source/core/platform/graphics/BitmapImage.cpp View 4 chunks +12 lines, -26 lines 0 comments Download
M Source/core/platform/graphics/GeneratedImage.h View 1 chunk +10 lines, -11 lines 0 comments Download
M Source/core/platform/graphics/Image.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/platform/graphics/ImageSource.h View 2 chunks +15 lines, -23 lines 0 comments Download
M Source/core/platform/graphics/ImageSource.cpp View 1 chunk +2 lines, -11 lines 0 comments Download
M Source/core/platform/graphics/chromium/DeferredImageDecoder.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/platform/image-decoders/ImageDecoder.h View 5 chunks +50 lines, -4 lines 0 comments Download
M Source/core/platform/image-decoders/ImageDecoder.cpp View 2 chunks +70 lines, -1 line 0 comments Download
A Source/core/platform/image-decoders/ImageDecoderTest.cpp View 1 chunk +216 lines, -0 lines 0 comments Download
M Source/core/platform/image-decoders/gif/GIFImageDecoder.h View 2 chunks +27 lines, -21 lines 0 comments Download
M Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp View 8 chunks +87 lines, -133 lines 0 comments Download
A + Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp View 12 chunks +157 lines, -15 lines 0 comments Download
M Source/core/platform/image-decoders/gif/GIFImageReader.h View 7 chunks +6 lines, -8 lines 0 comments Download
M Source/core/platform/image-decoders/gif/GIFImageReader.cpp View 3 chunks +14 lines, -31 lines 0 comments Download
M Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp View 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/platform/image-decoders/skia/ImageDecoderSkia.cpp View 2 chunks +5 lines, -0 lines 0 comments Download
M Source/core/svg/graphics/SVGImage.h View 2 chunks +11 lines, -11 lines 0 comments Download
M Source/core/svg/graphics/SVGImageForContainer.h View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Xianzhu
Committed patchset #1 manually as r151564 (presubmit successful).
7 years, 6 months ago (2013-05-31 18:08:04 UTC) #1
Peter Kasting
Was there a change since the original landing?
7 years, 6 months ago (2013-05-31 20:31:59 UTC) #2
Xianzhu
On 2013/05/31 20:31:59, Peter Kasting wrote: > Was there a change since the original landing? ...
7 years, 6 months ago (2013-05-31 21:00:09 UTC) #3
Peter Kasting
7 years, 6 months ago (2013-05-31 21:01:55 UTC) #4
Message was sent while issue was closed.
On 2013/05/31 21:00:09, Xianzhu wrote:
> On 2013/05/31 20:31:59, Peter Kasting wrote:
> > Was there a change since the original landing?
> 
> I should have uploaded the original patch first.
> 
> The change is a workaround for Android compiler in GIFImageDecoder.cpp,
> mentioned in the description:
> 
> -    for (Vector<size_t>::const_reverse_iterator iter =
framesToDecode.rbegin();
> iter != framesToDecode.rend(); ++iter) {
> +    Vector<size_t>::const_reverse_iterator rend = framesToDecode.rend();
> +    for (Vector<size_t>::const_reverse_iterator iter =
framesToDecode.rbegin();
> iter != rend; ++iter) {

Ugh, that sucks.  What was the Android compiler's issue?  Can we put a comment
in here about why we wrtoe the code this way, and how someone would know it's
safe to change it back?

Powered by Google App Engine
This is Rietveld 408576698