skia2/bench
scroggo 46c5747256 Merge SkCodec with SkScanlineDecoder
Benefits:
- This mimics other decoding APIs (including the ones SkCodec relies
on, e.g. a png_struct, which can be used to decode an entire image or
one line at a time).

- It allows a client to ask us to do what we can do efficiently - i.e.
start from encoded data and either decode the whole thing or scanlines.

- It removes the duplicate methods which appeared in both SkCodec and
SkScanlineDecoder (some of which, e.g. in SkJpegScanlineDecoder, just
call fCodec->sameMethod()).

- It simplifies moving more checks into the base class (e.g. the
examples in skbug.com/4284).

BUG=skia:4175
BUG=skia:4284

=====================================================================

SkScanlineDecoder.h/.cpp:
Removed.

SkCodec.h/.cpp:
Add methods, enums, and variables which were previously in
SkScanlineDecoder.
Default fCurrScanline to -1, as a sentinel that start has not been
called.

General changes:
Convert SkScanlineDecoders to SkCodecs.

General changes in SkCodec subclasses:
Merge SkScanlineDecoder implementation into SkCodec. Most (all?) owned
an SkCodec, so they now call this-> instead of fCodec->.

SkBmpCodec.h/.cpp:
Replace the unused rowOrder method with an override for
onGetScanlineOrder.
Make getDstRow const, since it is called by onGetY, which is const.

SkCodec_libpng.h/.cpp:
Make SkPngCodec an abstract class, with two subclasses which handle
scanline decoding separately (they share code for decoding the entire
image). Reimplement onReallyHasAlpha so that it can return the most
recent result (e.g. after a scanline decode which only decoded part
of the image) or a better answer (e.g. if the whole image is known to
be opaque).
Compute fNumberPasses early, so we know which subclass to instantiate.
Make SkPngInterlaceScanlineDecoder use the base class' fCurrScanline
rather than a separate variable.

CodexTest.cpp:
Add tests for the state changes in SkCodec (need to call start before
decoding scanlines; calling getPixels means that start will need to
be called again before decoding more scanlines).
Add a test which decodes in stripes, currently only used for an
interlaced PNG.

TODO: Add tests for onReallyHasAlpha.

Review URL: https://codereview.chromium.org/1365313002
2015-09-30 08:57:14 -07:00
..
subset Merge SkCodec with SkScanlineDecoder 2015-09-30 08:57:14 -07:00
AAClipBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
AlternatingColorPatternBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
BitmapRectBench.cpp flag to use const& instead of const* for src-rect 2015-08-06 10:02:53 -07:00
BitmapRegionDecoderBench.cpp Add nanobench tests for BitmapRegionDecoder 2015-09-22 11:56:16 -07:00
BitmapRegionDecoderBench.h Add nanobench tests for BitmapRegionDecoder 2015-09-22 11:56:16 -07:00
BitmapScaleBench.cpp Fix up -Winconsistent-missing-override 2015-07-13 06:18:39 -07:00
BlurBench.cpp 2D kernel initial wiring for Guassian 2014-08-11 13:55:34 -07:00
BlurImageFilterBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
BlurRectBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Fix up -Winconsistent-missing-override 2015-07-13 06:18:39 -07:00
ChromeBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
CmapBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
CodecBench.cpp Add nanobench tests for BitmapRegionDecoder 2015-09-22 11:56:16 -07:00
CodecBench.h Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
CodecBenchPriv.h Add nanobench tests for BitmapRegionDecoder 2015-09-22 11:56:16 -07:00
ColorCubeBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
ColorFilterBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
ColorPrivBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -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 Forward declare SkStrokeRec in SkPathEffect 2015-09-15 12:53:07 -07:00
DecodingBench.cpp Add nanobench tests for BitmapRegionDecoder 2015-09-22 11:56:16 -07:00
DecodingBench.h Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
DisplacementBench.cpp Convert unit tests, GMs from SkBitmapSource to SkImagesource 2015-09-15 11:26:14 -07:00
DrawBitmapAABench.cpp Use kLow_SkFilterQuality in DrawBitmapAABench 2015-07-06 08:20:15 -07:00
ETCBitmapBench.cpp discardable pixelrefs are gone, update tests accordingly 2015-09-14 08:52:12 -07:00
FontCacheBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
FontScalerBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
FSRectBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
GameBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
gen_bench_expectations.py Added in framework to get more bench data 2014-06-12 11:27:40 -07:00
GeometryBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
GLBench.cpp skia: Initialize value passed to GetShaderiv in GLBench 2015-09-08 15:18:56 -07:00
GLBench.h cleanup GLBenches 2015-07-01 12:39:07 -07:00
GLInstancedArraysBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
GLVec4ScalarBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
GLVertexAttributesBench.cpp Small fix for visualbench 2015-07-16 13:40:51 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
GrMemoryPoolBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
GrResourceCacheBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
gUniqueGlyphIDs.h switch array to uint16_t to fix overflows 2013-06-11 19:53:19 +00:00
HairlinePathBench.cpp IWYU: 'core' target, files starting A-C. 2015-08-05 13:57:49 -07:00
ImageBench.cpp update image bench to test gpu and cpu images against raster surface 2015-08-04 08:42:40 -07:00
ImageCacheBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
ImageFilterCollapse.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Fix up -Winconsistent-missing-override 2015-07-13 06:18:39 -07:00
LightingBench.cpp Remove SkBitmapSource 2015-09-25 09:15:55 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
Matrix44Bench.cpp Fix up -Winconsistent-missing-override 2015-07-13 06:18:39 -07:00
MatrixBench.cpp Fix up -Winconsistent-missing-override 2015-07-13 06:18:39 -07:00
MatrixConvolutionBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -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 Convert unit tests, GMs from SkBitmapSource to SkImagesource 2015-09-15 11:26:14 -07:00
microbench.json Fix the other microbench schema 2014-07-25 08:30:11 -07:00
MipMapBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
MorphologyBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
MutexBench.cpp move mutex construction out of the benchmarks. 2015-09-22 10:38:48 -07:00
nanobench.cpp Merge SkCodec with SkScanlineDecoder 2015-09-30 08:57:14 -07:00
nanobench.h Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
PatchGridBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
PathBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
PathIterBench.cpp IWYU: 'core' target, files starting A-C. 2015-08-05 13:57:49 -07:00
PerlinNoiseBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
PictureNestingBench.cpp Fix up -Winconsistent-missing-override 2015-07-13 06:18:39 -07:00
PictureOverheadBench.cpp Expand bench to cover no-draw SkPictures too. 2015-04-06 07:25:04 -07:00
PicturePlaybackBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
RectBench.cpp use override to make the new xcode happier 2015-09-25 04:49:43 -07:00
RectoriBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
RefCntBench.cpp Move Mutexy things to private. 2015-09-29 11:47:45 -07:00
RegionBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
RegionContainBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -07:00
RepeatTileBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
ResultsWriter.h Style Change: NULL->nullptr 2015-08-27 07:41:16 -07: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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -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
Sk4fBench.cpp Clean up remaining users of SkPMFloat 2015-08-31 15:26:08 -07:00
SkGlyphCacheBench.cpp Delete the typefaces. 2015-09-18 13:52:18 -07:00
SkipZeroesBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SKPAnimationBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SKPAnimationBench.h Make nanobench zoom animation time based 2015-06-29 14:06:10 -07:00
SKPBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SKPBench.h IWYU: 'core' target, files starting A-C. 2015-08-05 13:57:49 -07:00
skpbench.json Fix scale type in JSON format 2014-06-26 15:39:31 -07:00
SortBench.cpp Remove include of stdlib.h from SkTypes.h. 2015-08-26 05:15:46 -07:00
StrokeBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
TableBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
TextBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
TextBlobBench.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -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 Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
WritePixelsBench.cpp Style Change: SkNEW->new; SkDELETE->delete 2015-08-26 13:07:49 -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