aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2015-09-30 08:57:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-30 08:57:14 -0700
commit46c574725676b26ada63ac15e42cda309dcd5090 (patch)
treed9ee41e9f1c607ff139eca622bb03809eb9a83d3 /resources
parente2bcec38486f2e1a897973c953e5610eaef4221e (diff)
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
Diffstat (limited to 'resources')
-rw-r--r--resources/plane_interlaced.pngbin0 -> 6451 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/resources/plane_interlaced.png b/resources/plane_interlaced.png
new file mode 100644
index 0000000000..3b217f205d
--- /dev/null
+++ b/resources/plane_interlaced.png
Binary files differ