aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar emmaleer <emmaleer@google.com>2015-07-20 13:38:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-20 13:38:45 -0700
commit973ae86a824c6c1ece428d6777d0bce648f3f20c (patch)
tree863f45e3e7fe2c4757aaa362de8aee91631b9865 /src
parent85693c15c8948911afb0036a1a01bda64157a0ab (diff)
removing png_read_end from SkPngScanlineDecoder
Diffstat (limited to 'src')
-rw-r--r--src/codec/SkCodec_libpng.cpp20
-rw-r--r--src/codec/SkCodec_libpng.h1
2 files changed, 4 insertions, 17 deletions
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index 699ab398d3..7f9aeaa091 100644
--- a/src/codec/SkCodec_libpng.cpp
+++ b/src/codec/SkCodec_libpng.cpp
@@ -576,18 +576,14 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
// scanline decoding, but we could do it here. Alternatively, we could do
// it as we go, instead of in post-processing like SkPNGImageDecoder.
- this->finish();
- return kSuccess;
-}
-
-void SkPngCodec::finish() {
if (setjmp(png_jmpbuf(fPng_ptr))) {
// We've already read all the scanlines. This is a success.
- return;
+ return kSuccess;
}
- // FIXME: Is this necessary?
- /* read rest of file, and get additional chunks in info_ptr - REQUIRED */
+
+ // read rest of file, and get additional comment and time chunks in info_ptr
png_read_end(fPng_ptr, fInfo_ptr);
+ return kSuccess;
}
class SkPngScanlineDecoder : public SkScanlineDecoder {
@@ -601,10 +597,6 @@ public:
fSrcRow = static_cast<uint8_t*>(fStorage.get());
}
- ~SkPngScanlineDecoder() {
- fCodec->finish();
- }
-
SkCodec::Result onGetScanlines(void* dst, int count, size_t rowBytes) override {
if (setjmp(png_jmpbuf(fCodec->fPng_ptr))) {
SkCodecPrintf("setjmp long jump!\n");
@@ -662,10 +654,6 @@ public:
fGarbageRowPtr = static_cast<uint8_t*>(fGarbageRow.get());
}
- ~SkPngInterlacedScanlineDecoder() {
- fCodec->finish();
- }
-
SkCodec::Result onGetScanlines(void* dst, int count, size_t dstRowBytes) override {
//rewind stream if have previously called onGetScanlines,
//since we need entire progressive image to get scanlines
diff --git a/src/codec/SkCodec_libpng.h b/src/codec/SkCodec_libpng.h
index cba5c2ad30..f932a0a2ee 100644
--- a/src/codec/SkCodec_libpng.h
+++ b/src/codec/SkCodec_libpng.h
@@ -59,7 +59,6 @@ private:
// Calls rewindIfNeeded and returns true if the decoder can continue.
bool handleRewind();
bool decodePalette(bool premultiply, int* ctableCount);
- void finish();
void destroyReadStruct();
friend class SkPngScanlineDecoder;