Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: src/codec/SkCodec_libpng.cpp

Issue 1242423002: Remove png_read_end from SkPngScanlineDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove finish() function from SkPngCodec Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codec/SkCodec_libpng.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libpng.cpp
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index 699ab398d3a36df70cfbbb1c24c96886047d7f3c..7f9aeaa0913a4028f0a1139f832b5537e194730d 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
« no previous file with comments | « src/codec/SkCodec_libpng.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698