DescriptionAdd the ability to decode a subset to SkCodec
This allows codecs that support subsets natively (i.e. WEBP) to do so.
Add a field on SkCodec::Options representing the subset.
Add a method on SkCodec to find a valid subset which approximately
matches a desired subset.
Implement subset decodes in SkWebpCodec.
Add a test in DM for decoding subsets.
Notice that we only start on even boundaries. This is due to the
way libwebp's API works. SkWEBPImageDecoder does not take this into
account, which results in visual artifacts.
FIXME: Subsets with scaling are not pixel identical, but close. (This
may be fine, though - they are not perceptually different. We'll just
need to mark another set of images in gold as valid, once
https://skbug.com/4038 is fixed, so we can tests scaled webp without
generating new images on each run.)
Committed: https://skia.googlesource.com/skia/+/b636b45971bc5e64e3b103169577cbc874bc064d
Patch Set 1 #Patch Set 2 : Fix line endings #
Total comments: 14
Patch Set 3 : Respond to comments in patch set 2 #Patch Set 4 : Add getValidSubset plus tests #Patch Set 5 : Update comment #
Total comments: 9
Patch Set 6 : Change fSubset to a pointer. #Patch Set 7 : Only allow subsets contained fully inside image. #Patch Set 8 : Fix test. #
Total comments: 2
Patch Set 9 : Remove unnecessary assert. #Patch Set 10 : Do not treat kInvalidConversion as a failure. #Patch Set 11 : Fix some conversion warning/errors. #
Messages
Total messages: 33 (10 generated)
|