aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkCodec_libpng.h
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2015-04-01 11:25:20 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-01 11:25:20 -0700
commit58421544808562973ad66b2e3b8f9da1c5b8a36f (patch)
tree31d6673ccc7fb00c2f4ec363c2ae2351268778f3 /src/codec/SkCodec_libpng.h
parentfb8307c6b78bfbaa5e969a9df0c007c232d6251d (diff)
SkCodec::onGetScanlineDecoder must call rewind.
This mirrors the behavior in onGetPixels, and allows the implementation to share code for handling calls to rewindIfNeeded. This also fixes a bug where getScanlineDecoder was calling rewindIfNeeded and treating the result as a bool. In SkPngCodec, factor out the code to call rewindIfNeeded, and call it in both onGetPixels and onGetScanlineDecoder. Update the test to include testing the scanline decoder. Rename "gen" to "codec" now that it must be an SkCodec. BUG=skia:3257 Depends on https://codereview.chromium.org/1048423003/ (DIFFERENT ISSUE). Review URL: https://codereview.chromium.org/1050893002
Diffstat (limited to 'src/codec/SkCodec_libpng.h')
-rw-r--r--src/codec/SkCodec_libpng.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codec/SkCodec_libpng.h b/src/codec/SkCodec_libpng.h
index 8e43818204..d21a131100 100644
--- a/src/codec/SkCodec_libpng.h
+++ b/src/codec/SkCodec_libpng.h
@@ -48,6 +48,8 @@ private:
// Helper to set up swizzler and color table. Also calls png_read_update_info.
Result initializeSwizzler(const SkImageInfo& requestedInfo, void* dst,
size_t rowBytes, const Options&);
+ // Calls rewindIfNeeded, and returns true if the decoder can continue.
+ bool handleRewind();
bool decodePalette(bool premultiply);
void finish();
void destroyReadStruct();