SkJpegSegmentScanner: Use state-machine based scan
Separate what had previously been SkJpegSegmentScan into two classes.
The first is SkJpegSegmentScanner. This is a state machine that is
fed bytes and tracks the JPEG segment structure of the data that has
been provided to it. This should be significantly more efficient than
the previous scanning structure, because it does not do any stream
The second is SkJpegSeekableScan. This is created from a seekable
SkStream. It uses SkJpegSegmentScanner to determine the JPEG segment
structure of the data, and provides utility functions for retrieving
parameters and sub-streams.
This is towards supporting decoding JpegR gainmaps from unseekable
and unrewindable streams.
Commit-Queue: Christopher Cameron <firstname.lastname@example.org>
Reviewed-by: Brian Osman <email@example.com>
6 files changed