Chromium Code Reviews| Index: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| index fae908a78e567ec303b4b967a767735cffe0861c..f8c047cc089b42d01dbc62190ef456402a89b5c0 100644 |
| --- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| +++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp |
| @@ -166,14 +166,11 @@ int WEBPImageDecoder::repetitionCount() const |
| return failed() ? cAnimationLoopOnce : m_repetitionCount; |
| } |
| -bool WEBPImageDecoder::frameIsCompleteAtIndex(size_t index) const |
| +bool WEBPImageDecoder::frameIsFullyReceivedAtIndex(size_t index) const |
| { |
| if (!m_demux || m_demuxState <= WEBP_DEMUX_PARSING_HEADER) |
| - return false; |
| - if (!(m_formatFlags & ANIMATION_FLAG)) |
| - return ImageDecoder::frameIsCompleteAtIndex(index); |
| - bool frameIsLoadedAtIndex = index < m_frameBufferCache.size(); |
| - return frameIsLoadedAtIndex; |
| + return ImageDecoder::frameIsFullyReceivedAtIndex(index); |
| + return ((m_formatFlags & ANIMATION_FLAG) && index < m_frameBufferCache.size()) || ImageDecoder::frameIsFullyReceivedAtIndex(index); |
|
scroggo_chromium
2016/05/16 20:32:08
I brought this up previously, but I don't think yo
aleksandar.stojiljkovic
2016/05/22 15:41:53
I refactored it a bit, but it is still based on in
scroggo_chromium
2016/05/23 16:40:42
That's not obvious to me. An entry is created base
aleksandar.stojiljkovic
2016/05/24 11:08:24
This confused me too. Notice in WEBPImageDecoder::
scroggo_chromium
2016/05/24 13:55:14
Very confusing. Can you add a comment?
aleksandar.stojiljkovic
2016/05/24 19:24:34
Done.
|
| } |
| float WEBPImageDecoder::frameDurationAtIndex(size_t index) const |
| @@ -500,7 +497,7 @@ bool WEBPImageDecoder::decodeSingleFrame(const uint8_t* dataBytes, size_t dataSi |
| clearDecoder(); |
| return true; |
| case VP8_STATUS_SUSPENDED: |
| - if (!isAllDataReceived() && !frameIsCompleteAtIndex(frameIndex)) { |
| + if (!isAllDataReceived() && !frameIsFullyReceivedAtIndex(frameIndex)) { |
| applyPostProcessing(frameIndex); |
| return false; |
| } |