DescriptionReland again "Decode GIF image frames on demand".
Change over https://codereview.chromium.org/16260002 (r151564):
- Fix ImageFrame operator =.
- Set requiredPreviousFrameIndex to notFound and premultiplyAlpha to
m_premultiplyAlpha after the ImageFrame is assigned from PNGImageDecoder
decoding result.
- Remove ASSERT(m_decodedSize == 0 || frameCount > 1) (which caused bug 246118).
We could preserve the ASSERT by not clearing m_frames if frameCount == 1 in
BitmapImage::destroyDecodedData(), but I think we'd better let the decoder
control which frames to clear. If the frame is not actually cleared, recaching
the frame is cheap.
Change over https://codereview.chromium.org/15350006 (r151560):
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, 246118
TEST=ImageDecoderTest.requiredPreviousFrameIndex*, ImageDecoderTest.clearCacheExceptFrame*, GIFImageDecoderTest.updateRequiredPreviousFrameAfterFirstDecode, GIFImageDecoderTest.randomFrameDecode, GIFImageDecoderTest.randomDecodeAfterClearFrameBufferCache, GIFImageDecoderTest.resumePartialDecodeAfterClearFrameBufferCache,ICODecoderTest.Decode(in content_unittests).
R=pkasting@chromium.org
TBR=abarth@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151702
Patch Set 1 : Original code (revert of revert) #Patch Set 2 : Fix the issue #Patch Set 3 : Remove ASSERT in BitmapImage::cacheFrame() #
Total comments: 2
Patch Set 4 : For landing #
Total comments: 2
Messages
Total messages: 8 (0 generated)
|