Chromium Code Reviews| Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
| diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
| index e7eac4b4a3f696ab1f6871dafc99fab7d4d1b4e3..f0b4ed856c6d5f048a0c8449db94856ba2325ba8 100644 |
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
| @@ -182,13 +182,19 @@ ImageFrame* ImageDecoder::FrameBufferAtIndex(size_t index) { |
| } |
| bool ImageDecoder::FrameHasAlphaAtIndex(size_t index) const { |
| - return !FrameIsCompleteAtIndex(index) || |
| + return index < frame_buffer_cache_.size() && |
|
urvang
2017/05/15 17:33:07
Shouldn't you call "FrameIsDecodedAtIndex()" now i
Khushal
2017/05/15 17:55:17
FrameIsDecodedAtIndex is true only if the decoded
urvang
2017/05/15 18:02:10
Yes, if keeping the current call still works, you
Khushal
2017/05/15 20:44:48
Done.
|
| frame_buffer_cache_[index].HasAlpha(); |
| } |
| bool ImageDecoder::FrameIsCompleteAtIndex(size_t index) const { |
| - return (index < frame_buffer_cache_.size()) && |
| - (frame_buffer_cache_[index].GetStatus() == ImageFrame::kFrameComplete); |
| + // Animated images override this method to return the status based on the data |
| + // received for the queried frame. |
| + return IsAllDataReceived(); |
|
urvang
2017/05/15 17:33:07
I'm curious if you get a warning about "index" bei
Khushal
2017/05/15 17:55:17
The bots don't seem to be complaining.
urvang
2017/05/15 18:02:10
Acknowledged.
|
| +} |
| + |
| +bool ImageDecoder::FrameIsDecodedAtIndex(size_t index) const { |
| + return index < frame_buffer_cache_.size() && |
| + frame_buffer_cache_[index].GetStatus() == ImageFrame::kFrameComplete; |
| } |
| size_t ImageDecoder::FrameBytesAtIndex(size_t index) const { |