skia2/bench
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
..
subset Allow creating multiple scanline decoders. 2015-07-10 12:07:02 -07:00
AAClipBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
AlternatingColorPatternBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
bench_compare.py Make bench_compare executable. 2013-11-12 15:25:31 +00:00
bench_util.py Restore bench_util.py 2014-08-08 17:28:53 -04:00
BenchLogger.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
BenchLogger.h Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
Benchmark.cpp SkPaint::FilterLevel -> SkFilterQuality 2015-03-16 10:08:34 -07:00
Benchmark.h Add benchmarkstream to visualbench 2015-06-30 07:43:14 -07:00
BezierBench.cpp Draw more accurate thick-stroked Beziers (disabled) 2014-10-09 05:36:04 -07:00
BigPathBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BigPathBench.inc add bench for very big paths 2015-02-06 13:04:16 -08:00
BitmapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BitmapRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BitmapScaleBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BlurBench.cpp 2D kernel initial wiring for Guassian 2014-08-11 13:55:34 -07:00
BlurImageFilterBench.cpp Update blur image filter bench to have crop variation 2015-06-30 07:42:42 -07:00
BlurRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BlurRectsBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BlurRoundRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ChartBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
check_bench_regressions.py Adds dashboard link for one-line plot on each alert item. 2014-05-13 17:38:17 +00:00
ChecksumBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ChromeBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
CmapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
CodecBench.cpp SkCodec no longer inherits from SkImageGenerator. 2015-07-09 08:16:03 -07:00
CodecBench.h Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
ColorCubeBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ColorFilterBench.cpp remove useless benches 2015-04-02 20:31:17 -07:00
ColorPrivBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ControlBench.cpp Add a control benchmark. 2015-05-06 12:42:04 -07:00
CoverageBench.cpp Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi 2015-06-09 12:16:53 -07:00
DashBench.cpp Add matrix constructing helpers to SkMatrix 2015-03-26 19:57:08 -07:00
DecodingBench.cpp Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
DecodingBench.h Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
DeferredSurfaceCopyBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
DisplacementBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
DrawBitmapAABench.cpp Use kLow_SkFilterQuality in DrawBitmapAABench 2015-07-06 08:20:15 -07:00
ETCBitmapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
FontCacheBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
FontScalerBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
FSRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GameBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
gen_bench_expectations.py Added in framework to get more bench data 2014-06-12 11:27:40 -07:00
GeometryBench.cpp remove slower scalar code in favor of vectors 2015-03-26 07:26:08 -07:00
GLBench.cpp cleanup GLBenches 2015-07-01 12:39:07 -07:00
GLBench.h cleanup GLBenches 2015-07-01 12:39:07 -07:00
GLInstancedArraysBench.cpp cleanup GLBenches 2015-07-01 12:39:07 -07:00
GLVertexAttributesBench.cpp cleanup GLBenches 2015-07-01 12:39:07 -07:00
GMBench.cpp remove unused GM flags 2015-01-23 11:07:08 -08:00
GMBench.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GradientBench.cpp Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/) 2015-05-12 10:37:34 -07:00
GrMemoryPoolBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GrOrderedSetBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GrResourceCacheBench.cpp remove SkInstCnt 2015-06-26 11:45:03 -07:00
gUniqueGlyphIDs.h switch array to uint16_t to fix overflows 2013-06-11 19:53:19 +00:00
HairlinePathBench.cpp crank up innerloop to make hairlinebench more usable/reliable 2015-04-13 11:12:06 -07:00
ImageCacheBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ImageFilterCollapse.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ImageFilterDAGBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
InterpBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
LightingBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
LineBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MagnifierBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MathBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
Matrix44Bench.cpp A bunch of little SkMScalar-as-float build fixes. 2015-06-09 11:47:01 -07:00
MatrixBench.cpp use Sk4f for matrix math 2015-03-29 11:58:48 -07:00
MatrixConvolutionBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MemcpyBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MemoryBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MemsetBench.cpp Rewrite memset benches, then use results to add a small-N optimization. 2015-04-09 14:05:17 -07:00
MergeBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
microbench.json Fix the other microbench schema 2014-07-25 08:30:11 -07:00
MipMapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MorphologyBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MutexBench.cpp Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate. 2015-07-07 12:21:22 -07:00
nanobench.cpp Allow creating multiple scanline decoders. 2015-07-10 12:07:02 -07:00
nanobench.h Implement SkGLContext swapBuffers with fence syncs 2015-06-23 13:23:44 -07:00
nanobenchAndroid.cpp Implement SkGLContext swapBuffers with fence syncs 2015-06-23 13:23:44 -07:00
nanobenchAndroid.h Implement SkGLContext swapBuffers with fence syncs 2015-06-23 13:23:44 -07:00
PatchBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PatchGridBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PathBench.cpp Add matrix constructing helpers to SkMatrix 2015-03-26 19:57:08 -07:00
PathIterBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PerlinNoiseBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PictureNestingBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PictureOverheadBench.cpp Expand bench to cover no-draw SkPictures too. 2015-04-06 07:25:04 -07:00
PicturePlaybackBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PMFloatBench.cpp Convert SkPMFloat to [0,1] range and prune its API. 2015-06-25 08:56:28 -07:00
PremulAndUnpremulAlphaOpsBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ReadPixBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RecordingBench.cpp Thread through a flag to force SkPicture::playback() when recording subpictures. 2015-07-01 07:04:37 -07:00
RecordingBench.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RectanizerBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RectoriBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RefCntBench.cpp Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate. 2015-07-07 12:21:22 -07:00
RegionBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RegionContainBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RepeatTileBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ResultsWriter.h Upload picture byte size and op count metrics for SKP recording. 2014-12-04 08:46:51 -08:00
RotatedRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RTreeBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ScalarBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ShaderMaskBench.cpp Cleanup: Remove a bunch of SkFontHost.h includes (unused). 2014-12-18 05:48:53 -08:00
SkipZeroesBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
SKPAnimationBench.cpp Make nanobench zoom animation time based 2015-06-29 14:06:10 -07:00
SKPAnimationBench.h Make nanobench zoom animation time based 2015-06-29 14:06:10 -07:00
SKPBench.cpp Add loopSKP flag to nanobench 2015-06-25 10:51:56 -07:00
SKPBench.h Add loopSKP flag to nanobench 2015-06-25 10:51:56 -07:00
skpbench.json Fix scale type in JSON format 2014-06-26 15:39:31 -07:00
SortBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
StrokeBench.cpp add res to stroke bench 2015-06-01 06:30:06 -07:00
TableBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
TextBench.cpp Move font loading in gm tests and benches out of constructors 2015-05-21 06:15:28 -07:00
TextBlobBench.cpp Move font loading in gm tests and benches out of constructors 2015-05-21 06:15:28 -07:00
tile_analyze.py Script to plot tile vs. viewport comparison for given platform and revision. 2013-02-13 23:22:29 +00:00
TileBench.cpp SkPaint::FilterLevel -> SkFilterQuality 2015-03-16 10:08:34 -07:00
VertBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
WritePixelsBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
WriterBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
XfermodeBench.cpp Add _aa variants of Xfermode benches. 2015-05-13 11:54:00 -07:00