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

Unified Diff: src/codec/SkPngCodec.h

Issue 2026383002: Revert of Make SkPngCodec decode progressively. (Closed) Base URL: https://skia.googlesource.com/skia.git@foil
Patch Set: Created 4 years, 7 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/SkIcoCodec.cpp ('k') | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkPngCodec.h
diff --git a/src/codec/SkPngCodec.h b/src/codec/SkPngCodec.h
index 51d89781997161ffa22ba8b6393a2afc9b90a6d5..0a8878395a967c7d7b4a8733b03447bcc1827107 100644
--- a/src/codec/SkPngCodec.h
+++ b/src/codec/SkPngCodec.h
@@ -27,9 +27,6 @@
virtual ~SkPngCodec();
protected:
- SkPngCodec(int width, int height, const SkEncodedInfo&, SkStream*, SkPngChunkReader*,
- png_structp, png_infop, int bitDepth, sk_sp<SkColorSpace>);
-
Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*, int*)
override;
SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedFormat; }
@@ -37,46 +34,34 @@
uint32_t onGetFillValue(SkColorType) const override;
// Helper to set up swizzler and color table. Also calls png_read_update_info.
- bool initializeSwizzler(const SkImageInfo& requestedInfo, const Options&,
- SkPMColor*, int* ctableCount);
+ Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&,
+ SkPMColor*, int* ctableCount);
SkSampler* getSampler(bool createIfNecessary) override {
SkASSERT(fSwizzler);
return fSwizzler;
}
+ SkPngCodec(int width, int height, const SkEncodedInfo&, SkStream*, SkPngChunkReader*,
+ png_structp, png_infop, int, int, sk_sp<SkColorSpace>);
+
png_structp png_ptr() { return fPng_ptr; }
- png_infop info_ptr() { return fInfo_ptr; }
SkSwizzler* swizzler() { return fSwizzler; }
-
- /**
- * Pass available input to libpng to process it.
- *
- * libpng will call any relevant callbacks installed. This will continue decoding
- * until it reaches the end of the file, or until a callback tells libpng to stop.
- */
- void processData();
-
- Result onStartIncrementalDecode(const SkImageInfo& dstInfo, void* pixels, size_t rowBytes,
- const SkCodec::Options&,
- SkPMColor* ctable, int* ctableCount) override;
- Result onIncrementalDecode(int*) override;
+ int numberPasses() const { return fNumberPasses; }
private:
SkAutoTUnref<SkPngChunkReader> fPngChunkReader;
png_structp fPng_ptr;
png_infop fInfo_ptr;
+ // These are stored here so they can be used both by normal decoding and scanline decoding.
SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul.
SkAutoTDelete<SkSwizzler> fSwizzler;
- const int fBitDepth;
+ const int fNumberPasses;
+ int fBitDepth;
bool createColorTable(SkColorType dstColorType, bool premultiply, int* ctableCount);
void destroyReadStruct();
- virtual Result decodeAllRows(void* dst, size_t rowBytes, int* rowsDecoded) = 0;
- virtual void setRange(int firstRow, int lastRow, void* dst, size_t rowBytes) = 0;
- virtual Result decode(int* rowsDecoded) = 0;
-
typedef SkCodec INHERITED;
};
« no previous file with comments | « src/codec/SkIcoCodec.cpp ('k') | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698