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

Issue 2879123003: blink: Fix frame completion querying for static images. (Closed)

Created:
3 years, 7 months ago by Khushal
Modified:
3 years, 5 months ago
CC:
chromium-reviews, blink-reviews, kinuko+watch
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

blink: Fix frame completion querying for static images. ImageDecoder::FrameIsCompleteAtIndex is meant to return whether all encoded data for the frame at the queried index has been received. While it returns this value for animated images, for single frame images, it returns true only if a cached decode for the complete image is available. This discrepancy ends up having code in blink incorrectly assuming that the image has only been partially loaded. This change has the decoder return this status for static images based on whether all data for an image has been received. BUG=722168 Review-Url: https://codereview.chromium.org/2879123003 Cr-Commit-Position: refs/heads/master@{#472000} Committed: https://chromium.googlesource.com/chromium/src/+/4d60bb8e8f149732f85716124e05c349b360c333

Patch Set 1 #

Total comments: 7

Patch Set 2 : test #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -13 lines) Patch
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h View 1 chunk +3 lines, -0 lines 2 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 1 1 chunk +8 lines, -2 lines 1 comment Download
M third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp View 1 chunk +1 line, -1 line 2 comments Download
M third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp View 1 1 chunk +8 lines, -10 lines 0 comments Download

Messages

Total messages: 26 (16 generated)
Khushal
PTAL. The only test that is failing is the PNGTest that is asserting the old ...
3 years, 7 months ago (2017-05-15 03:36:28 UTC) #8
urvang
On 2017/05/15 03:36:28, Khushal wrote: > PTAL. The only test that is failing is the ...
3 years, 7 months ago (2017-05-15 17:33:07 UTC) #9
Khushal
Thanks! Just wanted to confirm this was reasonable before updating the test. :) https://codereview.chromium.org/2879123003/diff/1/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File ...
3 years, 7 months ago (2017-05-15 17:55:17 UTC) #10
urvang
https://codereview.chromium.org/2879123003/diff/1/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2879123003/diff/1/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode185 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:185: return index < frame_buffer_cache_.size() && On 2017/05/15 17:55:17, Khushal ...
3 years, 7 months ago (2017-05-15 18:02:10 UTC) #11
Khushal
Updated the test as well. https://codereview.chromium.org/2879123003/diff/1/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2879123003/diff/1/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode185 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:185: return index < frame_buffer_cache_.size() ...
3 years, 7 months ago (2017-05-15 20:44:48 UTC) #13
urvang
lgtm
3 years, 7 months ago (2017-05-15 21:32:37 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2879123003/20001
3 years, 7 months ago (2017-05-16 03:09:11 UTC) #19
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/4d60bb8e8f149732f85716124e05c349b360c333
3 years, 7 months ago (2017-05-16 03:12:47 UTC) #23
scroggo_chromium
LGTM https://codereview.chromium.org/2879123003/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp (right): https://codereview.chromium.org/2879123003/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp#newcode192 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp:192: return IsAllDataReceived(); Yay! I like that this method ...
3 years, 6 months ago (2017-05-30 15:51:34 UTC) #25
scroggo_chromium
3 years, 5 months ago (2017-07-17 19:25:36 UTC) #26
Message was sent while issue was closed.
https://codereview.chromium.org/2879123003/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h (right):

https://codereview.chromium.org/2879123003/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h:196: virtual
bool FrameIsCompleteAtIndex(size_t) const;
On 2017/05/30 15:51:34, scroggo_chromium wrote:
> nit: As a follow-on, I think we should rename this to FrameIsReceivedAtIndex.
> This old name is confusing.

Uploaded crrev.com/2982083002

https://codereview.chromium.org/2879123003/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
(right):

https://codereview.chromium.org/2879123003/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:995:
return decoder->FrameIsDecodedAtIndex(0);
On 2017/05/30 15:51:34, scroggo_chromium wrote:
> This is the only caller of the new API, and this method is in turn only called
> by JPEGImageDecoder, which has access to the internal info needed by this
> method. Maybe we should delete this method and have JPEGImageDecoder check
> directly? To keep the clarity of this inline method, we could make this a
> private method on JPEGImageDecoder:
> 
> JPEGImageDecoder::IsComplete(bool only_size) const {
>   if (HasImagePlanes() && !only_size)
>     return true;
>   return frame_buffer_cache_[0].GetStatus() == ImageFrame::kFrameComplete;
> }

Uploaded crrev.com/2984463002

Powered by Google App Engine
This is Rietveld 408576698