Chromium Code Reviews
DescriptionAdd 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 #
Messages
Total messages: 17 (7 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||