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

Issue 1403393004: JPEGImageDecoder RGB565 and downsample support and related Skia imagegenerator changes

Created:
5 years, 2 months ago by aleksandar.stojiljkovic
Modified:
5 years, 1 month ago
CC:
chromium-reviews, pdr+graphicswatchlist_chromium.org, drott+blinkwatch_chromium.org, Rik, blink-reviews-platform-graphics_chromium.org, dshwang, jbroman, Justin Novosad, danakj, krit, f(malita), blink-reviews, Stephen Chennney, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

JPEGImageDecoder RGB565&downsample support and related Skia imagegenerator changes This is part of effort related to better handling large res images: decoding bitmaps to displayed resolution (not to fullsize as now), using other than RGBA8888 where acceptable... See also: Multiple large (~2800x2000) jpegs on page evict each other from discardable cache and deteriorate performance (re-decoding) - Issues 438323, 472630 Related Skia changes: Handling large jpegs in CPU raster - downsample to display res and 565 https://codereview.chromium.org/1412423008/ Proposal for SkImageGenerator::canDecodeAndScale API https://codereview.chromium.org/1404923004/ This code path is going to be activated from Skia,... it is compromise between quality (image affinity loss) vs. SkResourceCache behavior. Tweaking and measurement before activation. BUG=438323, 472630

Patch Set 1 #

Total comments: 37

Patch Set 2 : processing review comments #

Patch Set 3 : Continued decoding fix and downscale combined #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+398 lines, -55 lines) Patch
M third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp View 1 2 2 chunks +21 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp View 1 2 10 chunks +63 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageFrame.h View 1 2 5 chunks +37 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp View 1 2 2 chunks +10 lines, -5 lines 2 comments Download
M third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp View 1 2 13 chunks +135 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp View 1 2 2 chunks +96 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
aleksandar.stojiljkovic
5 years, 2 months ago (2015-10-19 07:45:43 UTC) #2
reed1
Is this spec'd to dither down to 565?
5 years, 2 months ago (2015-10-19 17:18:55 UTC) #3
aleksandar.stojiljkovic
reed1, about dither: https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h File third_party/WebKit/Source/platform/image-decoders/ImageFrame.h (right): https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h#newcode197 third_party/WebKit/Source/platform/image-decoders/ImageFrame.h:197: *dest = SkDitherPack888ToRGB16(r, g, b); Dither: ...
5 years, 2 months ago (2015-10-19 18:17:10 UTC) #4
scroggo_chromium
https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp File third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp (right): https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp#newcode128 third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp:128: bool DecodingImageGenerator::onCanDecodeAndScale(const SkColorType targetType, const SkScalar scale, SkISize *availableSize, ...
5 years, 2 months ago (2015-10-19 20:41:36 UTC) #6
aleksandar.stojiljkovic
https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp File third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp (right): https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp#newcode128 third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp:128: bool DecodingImageGenerator::onCanDecodeAndScale(const SkColorType targetType, const SkScalar scale, SkISize *availableSize, ...
5 years, 2 months ago (2015-10-20 09:51:13 UTC) #7
scroggo_chromium
https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp File third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp#newcode304 third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp:304: if (!m_isMultiFrame && allDataReceived) { On 2015/10/20 09:51:12, aleksandar.stojiljkovic ...
5 years, 2 months ago (2015-10-20 15:06:41 UTC) #8
aleksandar.stojiljkovic
https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp File third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp#newcode304 third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp:304: if (!m_isMultiFrame && allDataReceived) { On 2015/10/20 15:06:41, scroggo_chromium ...
5 years, 2 months ago (2015-10-20 18:28:41 UTC) #9
aleksandar.stojiljkovic
https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp File third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp (right): https://codereview.chromium.org/1403393004/diff/1/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp#newcode304 third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp:304: if (!m_isMultiFrame && allDataReceived) { On 2015/10/20 18:28:41, aleksandar.stojiljkovic ...
5 years, 2 months ago (2015-10-20 18:57:56 UTC) #10
aleksandar.stojiljkovic
5 years, 2 months ago (2015-10-23 09:14:42 UTC) #12
aleksandar.stojiljkovic
Combining 565 with downsampling, in the same review, since it didn't significantly increase the code ...
5 years, 2 months ago (2015-10-23 09:19:10 UTC) #13
scroggo_chromium
https://codereview.chromium.org/1403393004/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/1403393004/diff/40001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode111 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111: zeroFillPixelData(); This will erase the background to black, in ...
5 years, 1 month ago (2015-10-28 19:08:48 UTC) #15
aleksandar.stojiljkovic
5 years, 1 month ago (2015-10-29 13:06:43 UTC) #16
https://codereview.chromium.org/1403393004/diff/40001/third_party/WebKit/Sour...
File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right):

https://codereview.chromium.org/1403393004/diff/40001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111:
zeroFillPixelData();
On 2015/10/28 19:08:47, scroggo_chromium wrote:
> This will erase the background to black, in the case of 565. If the entire
image
> is available, we'll write over it, but if the image is only partially
available,
> we'll end up with black at the bottom instead of transparent. (I know we skip
> 565 in this CL if allDataReceived is not true, but I assume it's possible that
> all the data was received but the image itself was incomplete. If that
happens,
The initial idea was to let image generators decode partial to 8888 until it is
successful. By that time, we would know:
- if image is complete
- for png, if it really has alpha so that it can be decoded to 565 (next time
there is a request to decode it).
Not handling here the case that there once was complete data and for some reason
it is not complete anymore. Can it happen?

> we'll report that the image decoder has failed, which prevents it from doing
any
> more work, but does not appear to prevent any callers from drawing that
bitmap.)
> I don't know whether such a change is good, bad, or indifferent, but we should
> be aware of it.
> 
> In addition, this will set m_hasAlpha to true, which I think you do not want
to
> do (maybe it gets set back to false later, so it does not matter).

Will clean this part about alpha. Thanks.

Powered by Google App Engine
This is Rietveld 408576698