skia2/include
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
..
android Let region decoders query the type and color space 2017-04-14 13:59:35 +00:00
c C API: document sk_matrix_t 2017-03-21 18:04:34 +00:00
codec Consolidate decoding frames into SkCodec 2017-06-12 20:55:59 +00:00
config Revert "Revert "SkUserConfig.h: remove out-of-date comment on SK_SFNTLY_SUBSETTER"" 2017-01-27 14:40:01 +00:00
core Reland DeferredTextureImageData low-bit-depth/dithering support 2017-06-12 18:27:48 +00:00
effects slant colorfilter away from filterSpan4f 2017-05-31 19:54:05 +00:00
encode Add comments support for PNG encoder 2017-06-09 17:24:03 +00:00
gpu Revert "Revert "Expand partial render target write pixels workaround."" 2017-06-12 19:31:53 +00:00
pathops use reversePathTo in place of addPathReverse 2016-11-07 05:09:28 -08:00
ports remove unneeded include 2017-06-09 12:44:54 +00:00
private Re-enable deferred proxies in Chrome 2017-06-12 15:59:47 +00:00
svg no need for SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT anymore 2016-12-07 22:28:04 +00:00
utils Add tonal color support for shadows. 2017-06-09 17:18:58 +00:00
views Touch input support for Windows 2017-06-07 14:27:09 +00:00