skia2/gyp
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
..
android_deps.gyp WIP: Added support for giflib, updated jpeg and png 2015-03-30 07:52:52 -07:00
android_framework_lib.gyp fix typo in android_framework_lib.gyp 2015-08-17 13:39:03 -04:00
android_output.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
android_system.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
angle.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
animator.gyp Revert[8] "move some public headers into private" 2015-08-17 18:29:48 -07:00
apptype_console.gypi Remove all code related to NaCl 2015-04-02 12:16:36 -07:00
bench.gyp Experiment with find as a road to Gyp sanity. 2015-05-16 15:47:10 -07:00
bench.gypi Add nanobench tests for BitmapRegionDecoder 2015-09-22 11:56:16 -07:00
canvas_state_lib.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
codec.gyp Merge SkCodec with SkScanlineDecoder 2015-09-30 08:57:14 -07:00
common_conditions.gypi skia: roll ANGLE and remove compile flags 2015-09-29 10:30:31 -07:00
common_variables.gypi skia: Add support for ANGLE on linux 2015-09-23 11:35:55 -07:00
common.gypi skia: Add support for ANGLE on linux 2015-09-23 11:35:55 -07:00
core.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
core.gypi Unify ThreadID. 2015-09-29 14:38:01 -07:00
debugger.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
dm.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
dm.gypi Provides various implementations of Android's SkBitmapRegionDecoder. 2015-09-08 15:35:32 -07:00
effects.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
effects.gypi Remove SkBitmapSource 2015-09-25 09:15:55 -07:00
etc1.gyp Revert of Depend on ETC1 via DEPS instead of a direct third_party checkin. (patchset #1 id:1 of https://codereview.chromium.org/1296253003/ ) 2015-08-17 11:15:00 -07:00
everything.gyp Remove experimental/PdfViewer 2015-08-04 14:08:44 -07:00
example.gyp Revert "Move headers used by headers in include/ to include/private." 2015-07-01 16:35:59 -04:00
experimental.gyp experimental: remove old PDF benchmarking tools 2015-07-15 08:06:29 -07:00
FileReaderApp.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
find.py Sort build files for consistent link order. 2015-05-20 09:26:47 -07:00
flags.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
freetype.gyp Remove SK_ANDROID_FREETYPE_HAS_MM from build. 2015-06-04 07:38:52 -07:00
freetype.gypi Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
giflib.gyp Update giflib to 5.1.1 (AOSP hash) 2015-08-24 12:00:15 -07:00
gmslides.gypi A bit of misc cleanup. 2015-08-14 10:03:45 -07:00
gpu.gyp skia: add ability to load command_buffer_gles2 2015-08-27 10:38:39 -07:00
gpu.gypi Make skpaint->grpaint flow work for composing draws (verts and atlas) 2015-09-28 06:26:29 -07:00
gputest.gyp Add include paths in gputest.gyp for use by additional gpu tests. 2015-08-14 08:37:50 -07:00
icu.gyp Update giflib to 5.1.1 (AOSP hash) 2015-08-24 12:00:15 -07:00
images.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
iOSShell.gyp Remove old iOS porting files. 2015-06-29 14:12:41 -07:00
jsoncpp.gyp Roll jsoncpp, drop dependency on Chromium overrides. 2014-08-19 07:21:00 -07:00
ktx.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
libjpeg-turbo.gyp Switching Skia to chromium's libjpeg-turbo 2015-08-11 13:32:54 -07:00
libjpeg.gyp Hopefully fix ios bots 2015-08-11 14:44:02 -07:00
libpng.gyp Have DM manually encode its .png outputs. 2015-08-24 13:27:01 -07:00
libwebp_skia.gypi Fix color swap for webp 565 2015-08-06 11:44:56 -07:00
libwebp.gyp Revert of Update libwebp and resume testing scaled webp (patchset #2 id:20001 of https://codereview.chromium.org/1280073002/ ) 2015-08-07 12:53:25 -07:00
lua.gyp Build Skia for a bare-bones embedded Linux system. 2014-02-24 20:22:34 +00:00
most.gyp Remove experimental/PdfViewer 2015-08-04 14:08:44 -07:00
nanomsg.gyp Experiment with find as a road to Gyp sanity. 2015-05-16 15:47:10 -07:00
opts.gyp Add build targets for advanced Intel instruction sets (1.5 of 3) 2015-08-25 06:30:07 -07:00
opts.gypi Add empty files to empty targets to appease XCode. 2015-08-31 14:21:08 -07:00
pathops_skpclip.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
pathops_unittest.gyp cumulative pathops patch 2015-03-26 07:52:43 -07:00
pathops_unittest.gypi add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
pdf.gyp SkPDF: Move SkFlate into src/pdf (part 1/3) [reland] 2015-08-12 11:24:40 -07:00
pdf.gypi SkPDF: Move SkFlate into src/pdf (part 1/3) [reland] 2015-08-12 11:24:40 -07:00
ports.gyp Make mutex semaphore based. 2015-09-24 07:34:49 -07:00
SampleApp.gyp remove obsolete samples 2015-09-12 09:55:30 -07:00
sfnt.gyp Move SkTemplates.h to private. 2015-08-19 11:56:48 -07:00
sfntly.gyp SkPDF: Add Sfntly to DEPS, gyp 2015-05-18 13:15:56 -07:00
SimpleCocoaApp.gyp Allows windowed apps to be built on the Mac just by writing a SkOSWindow subclass without needing nib/plist files. 2015-06-18 11:49:42 -07:00
SimpleiOSApp.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
skia_for_android_framework_defines.gypi Revert[2] of "switch to isABitmap, deprecate SK_SUPPORT_LEGACY_SHADERBITMAPTYPE" 2015-09-08 11:02:04 -07:00
skia_for_chromium_defines.gypi Remove SK_LEGACY_SKPOINT3_CTORS flag 2015-08-06 07:08:31 -07:00
skia_launcher.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
skia_lib.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
svg.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
tests.gypi SkPDF/Deflate: clean up old SkFlate code 2015-08-18 13:30:25 -07:00
tools.gyp Move Mutexy things to private. 2015-09-29 11:47:45 -07:00
utils.gyp Revert of Provides multiple implementations of Android's SkBitmapRegionDecoder (patchset #16 id:360001 of https://codereview.chromium.org/1288963002/ ) 2015-09-08 06:59:48 -07:00
utils.gypi Remove SkBitmapSource 2015-09-25 09:15:55 -07:00
v8.gyp Allows windowed apps to be built on the Mac just by writing a SkOSWindow subclass without needing nib/plist files. 2015-06-18 11:49:42 -07:00
views_animated.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
views.gyp Have /src files use header directly. 2015-09-29 09:37:59 -07:00
visualbench.gyp Add nanobench tests for BitmapRegionDecoder 2015-09-22 11:56:16 -07:00
xml.gyp Add copyright headers to remaining gyp files. 2015-03-25 10:22:41 -07:00
xps.gyp add -Iinclude/private anywhere we have -Isrc/core 2015-07-28 08:55:14 -07:00
yasm.gyp Update yasm .gyp for tweaked ASAN bots. 2015-08-05 08:58:45 -07:00
zlib.gyp Fix warnings on VS2015 x86_64 build 2015-08-06 17:33:16 -07:00