skia2/resources
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_fonts Font variations. 2015-05-20 09:21:04 -07:00
empty_images Ensure that we create a NULL codec for images with zero dimensions 2015-04-23 08:53:39 -07:00
fonts Add HangingS.ttf to test large flourish caps. 2015-08-26 10:44:48 -07:00
invalid_images Fix bmp RLE "bug" 2015-08-12 08:08:56 -07:00
1x1.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
1x3.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
1x16.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
2x2.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
3x1.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
3x3.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
16x1.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
arrow.png Bench baseline for mostly 0 image. 2013-09-25 21:42:12 +00:00
baby_tux.png Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
baby_tux.webp Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
box.gif add box image to resources; landing separately to avoid issues with 2014-05-27 21:15:35 +00:00
brickwork_normal-map.jpg Add normal map sample 2015-07-09 09:04:16 -07:00
brickwork-texture.jpg Add normal map sample 2015-07-09 09:04:16 -07:00
CMYK.jpg Move resource dir from gm to trunk 2013-04-15 17:36:08 +00:00
color_wheel.gif Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
color_wheel.ico SkCodec: add wbmp class 2015-03-27 12:16:53 -07:00
color_wheel.jpg Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
color_wheel.png Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
color_wheel.webp Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
google_chrome.ico Ico test with embedded png 2015-04-01 12:09:22 -07:00
grayscale.jpg Remove PDF JPEG shortcut, since it fails on grayscale JPEGs. 2014-12-02 06:37:21 -08:00
half-transparent-white-pixel.png Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
half-transparent-white-pixel.webp Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
index8.png Scanline decoding for wbmp 2015-08-05 12:58:26 -07:00
mandrill_16.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_32.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_64.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_128.ktx Adding resource files 2014-06-02 15:18:27 -04:00
mandrill_128.pkm Adding resource files 2014-06-02 15:18:27 -04:00
mandrill_128.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_128.r11.ktx Add mandill_128.r11.ktx to resources 2014-08-08 11:40:08 -04:00
mandrill_128x128_4x4.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_128x128_8x8.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_128x130_8x5.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_128x132_8x6.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_130x128_5x4.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_130x128_10x8.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_130x130_5x5.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_130x130_10x5.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_130x130_10x10.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_130x132_10x6.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_132x130_6x5.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_132x130_12x10.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_132x132_6x6.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_132x132_12x12.astc Add ASTC resource files 2014-08-06 10:50:53 -04:00
mandrill_256.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_512_q075.jpg Add resources/mandrill_512_q075.jpg 2014-08-27 13:44:34 -04:00
mandrill_512.pkm Add pkm missing from r14852 (Simple PKM image decoder - https://codereview.chromium.org/292663011/) commit 2014-05-22 21:29:20 +00:00
mandrill_512.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill.wbmp SkCodec: add wbmp class 2015-03-27 12:16:53 -07:00
plane_interlaced.png Merge SkCodec with SkScanlineDecoder 2015-09-30 08:57:14 -07:00
plane.png Move resource dir from gm to trunk 2013-04-15 17:36:08 +00:00
randPixels.bmp Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.gif Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.jpg Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.png Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.webp Flatten resources directory 2014-05-09 18:08:24 +00:00
slides_content2.lua Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
slides_content.lua add code-style for slides 2014-11-02 19:19:34 -08:00
slides_transitions.lua update slides 2014-11-04 13:24:47 -08:00
slides_utils.lua update slides 2014-11-04 13:24:47 -08:00
slides.lua update slides 2014-11-04 13:24:47 -08:00
test640x479.gif Add a test for decoding a gif with sampleSize 4. 2015-05-14 14:44:14 -07:00
test.lua allow for lua click handlers 2014-10-11 11:28:07 -07:00
yellow_rose.png Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
yellow_rose.webp Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00