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

Issue 1862133002: Add whitelist parameter to refEncodedData (Closed)

Created:
4 years, 8 months ago by scroggo_chromium
Modified:
4 years, 7 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Add whitelist parameter to refEncodedData Meant to allow the generator to preflight its encoded format, and if it will not be supported, to return null instead of actually returning the data. This is particularly important for a generator that does not have contiguous data, so it would have to copy in order to return an SkData. SkEncodedFormat.h: - Move into core, where it can be referenced by SkImageGenerator. - Remove unused kUnknown_SkEncodedFormat. SkImageGenerator.h: - Add RefEncodedWhitelist, and pass it (optionally) to refEncodedData. SkCodecImageGenerator.cpp: - Check the whitelist before returning fData. SkImageCacherator: - Add a whitelist for the GPU, and pass it to refEncodedData. SkGr.cpp/SkGrPriv.h: - Add a method to check to see if an SkEncodedFormat may be supported by the GPU ImageGeneratorTest.cpp: - Add a test Actual benefit will be seen once we take advantage of it in Chromium, and Chromium stops defining SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX. BUG=chromium:568016 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1862133002

Patch Set 1 : Mostly unchanged from the original, no longer builds #

Patch Set 2 : Updates to make the test compile/run again. Update comment #

Patch Set 3 : Use sk_sp #

Patch Set 4 : Check the format #

Patch Set 5 : Make test pass regardless of CTX build flag #

Total comments: 17

Patch Set 6 : Rebase/build again (macro changed) #

Patch Set 7 : Change to format whitelist #

Patch Set 8 : Make the test build with SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX #

Patch Set 9 : Fix comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -40 lines) Patch
D include/codec/SkEncodedFormat.h View 1 chunk +0 lines, -28 lines 0 comments Download
A + include/core/SkEncodedFormat.h View 1 2 3 4 5 6 2 chunks +1 line, -2 lines 0 comments Download
M include/core/SkImageGenerator.h View 1 2 3 4 5 6 7 8 3 chunks +28 lines, -9 lines 0 comments Download
M src/codec/SkCodecImageGenerator.cpp View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M src/core/SkImageCacherator.h View 1 2 3 4 5 6 2 chunks +11 lines, -0 lines 0 comments Download
M src/core/SkImageCacherator.cpp View 1 2 3 4 5 6 2 chunks +18 lines, -1 line 0 comments Download
M src/gpu/SkGr.cpp View 1 2 3 4 5 6 2 chunks +16 lines, -0 lines 0 comments Download
M src/gpu/SkGrPriv.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M tests/ImageGeneratorTest.cpp View 1 2 3 4 5 6 7 8 1 chunk +105 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (7 generated)
scroggo_chromium
4 years, 8 months ago (2016-04-06 17:42:08 UTC) #3
scroggo_chromium
+ reviewers from Mike's original CL
4 years, 8 months ago (2016-04-06 17:51:13 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1862133002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1862133002/80001
4 years, 8 months ago (2016-04-06 20:52:55 UTC) #8
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
4 years, 8 months ago (2016-04-06 20:52:57 UTC) #9
commit-bot: I haz the power
Dry run: No LGTM from a valid reviewer yet. Please ask for an LGTM from ...
4 years, 8 months ago (2016-04-07 02:52:10 UTC) #11
reed1
I've forgotten, but why don't we just allow the caller to specify a whilte or ...
4 years, 8 months ago (2016-04-07 13:27:31 UTC) #12
scroggo_chromium
It sounds like you want some better documentation. I haven't updated it, but will once ...
4 years, 8 months ago (2016-04-08 18:16:36 UTC) #13
scroggo_chromium
PTAL at patch set 9 https://codereview.chromium.org/1862133002/diff/80001/include/core/SkEncodedFormat.h File include/core/SkEncodedFormat.h (right): https://codereview.chromium.org/1862133002/diff/80001/include/core/SkEncodedFormat.h#newcode15 include/core/SkEncodedFormat.h:15: kUnknown_SkEncodedFormat, On 2016/04/08 18:16:36, ...
4 years, 8 months ago (2016-04-12 14:41:19 UTC) #15
scroggo_chromium
reed@, please take a look. This will help with crbug.com/568016 and potentially crbug.com/604008
4 years, 7 months ago (2016-05-02 17:53:09 UTC) #16
scroggo_chromium
4 years, 7 months ago (2016-05-11 15:30:35 UTC) #17
On 2016/05/02 17:53:09, scroggo_chromium wrote:
> reed@, please take a look. This will help with crbug.com/568016 and
potentially
> crbug.com/604008

Fixed with https://codereview.chromium.org/1970773002/

Powered by Google App Engine
This is Rietveld 408576698