skia2/include/codec
Leon Scroggins III 1f6af6baad Consolidate decoding frames into SkCodec
Add a new private method to SkCodec that handles Options.fFrameIndex:
- Check to ensure the index is valid
- Call onGetFrameCount to force parsing the stream
- Recursively call getPixels (it should be complete, so no need for
  incremental decoding) to decode the prior frame if necessary
- Zero fill a RestoreBGColor frame

Call the method in getPixels and startIncrementalDecode, and remove
duplicate code from GIF and WEBP.

Remove support for scaling frames beyond the first, which is currently
unused.

Preserve the feature of SkGifCodec that it will only parse to the end
of the first frame if the first frame is asked for. (Also note that
when we continue a partial frame, we won't force parsing the full
stream.) If the client only wants the first frame, parsing the rest
would be unnecessary. But if the client wants the second, we assume
they will want any remaining frames, so we parse the remainder of the
stream. This simplifies the code (so SkCodec does not have to ask its
subclass to parse up to a particular frame).

Update tests that relied on the old behavior:
- Codec_partialAnim now hardcodes the bytes needed. Previously it
  relied on the old behavior that GIF only parsed up to the frame being
  decoded.
- Codec_skipFullParse now only tests the first frame, since that is the
  case where it is important to skip a full parse.

TBR=reed@google.com
No changes to the public API.

Change-Id: Ic2f075452dfeedb4e3e60e6cf4df33ee7bd38495
Reviewed-on: https://skia-review.googlesource.com/19276
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-12 20:55:59 +00:00
..
SkAndroidCodec.h Allow BF and BRD clients to request an output color space 2017-04-11 14:27:28 +00:00
SkCodec.h Consolidate decoding frames into SkCodec 2017-06-12 20:55:59 +00:00
SkCodecAnimation.h Make SkCodec more flexible about its required frame 2017-06-07 20:15:17 +00:00
SkEncodedInfo.h Remove unnecessary getColorSpace() API from SkCodec 2016-07-21 11:57:49 -07:00