skia2/bench/subset
scroggo 9b2cdbf481 Allow creating multiple scanline decoders.
Make getScanlineDecoder return a new object each time, which is
owned by the caller, and independent from any existing scanline
decoders and the SkCodec itself.

Since the SkCodec already contains the entire state machine, and it
is used by the scanline decoders, simply create a new SkCodec which
is now owned by the scanline decoder.

Move code that cleans up after using a scanline decoder into its
destructor

One side effect is that creating the first scanline decoder requires
a duplication of the stream and re-reading the header. (With some
more complexity/changes, we could pass the state machine to the
scanline decoder and make the SkCodec recreate its own state machine
instead.) The typical client of the scanline decoder (region decoder)
uses an SkMemoryStream, so the duplication is cheap, although we
should consider the extra time to reread the header/recreate the state
machine. (If/when we use the scanline decoder for other purposes,
where the stream may not be cheaply duplicated, we should consider
passing the state machine.)

One (intended) result of this change is that a client can create a
new scanline decoder in a new thread, and decode different pieces of
the image simultaneously.

In SkPngCodec::decodePalette, use fBitDepth rather than a parameter.

Review URL: https://codereview.chromium.org/1230033004
2015-07-10 12:07:02 -07:00
..
SubsetBenchPriv.h Fix CodecSubset benches seg faults for kIndex8 2015-06-30 13:29:37 -07:00
SubsetSingleBench.cpp Allow creating multiple scanline decoders. 2015-07-10 12:07:02 -07:00
SubsetSingleBench.h Subset decoding benchmarks 2015-06-09 13:56:10 -07:00
SubsetTranslateBench.cpp Allow creating multiple scanline decoders. 2015-07-10 12:07:02 -07:00
SubsetTranslateBench.h Subset decoding benchmarks 2015-06-09 13:56:10 -07:00
SubsetZoomBench.cpp Allow creating multiple scanline decoders. 2015-07-10 12:07:02 -07:00
SubsetZoomBench.h Subset decoding benchmarks 2015-06-09 13:56:10 -07:00