Chromium Code Reviews| Index: src/codec/SkPngCodec.h |
| diff --git a/src/codec/SkPngCodec.h b/src/codec/SkPngCodec.h |
| index 0a8878395a967c7d7b4a8733b03447bcc1827107..4ad84acf5a5a32e05c9a28465005e08a5cbf2513 100644 |
| --- a/src/codec/SkPngCodec.h |
| +++ b/src/codec/SkPngCodec.h |
| @@ -27,6 +27,9 @@ public: |
| 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; } |
| @@ -34,34 +37,38 @@ protected: |
| uint32_t onGetFillValue(SkColorType) const override; |
| // Helper to set up swizzler and color table. Also calls png_read_update_info. |
| - Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&, |
| - SkPMColor*, int* ctableCount); |
| + bool 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; } |
| - int numberPasses() const { return fNumberPasses; } |
| + void processData(); |
|
msarett
2016/05/20 15:04:41
nit: Comments to explain what this does?
scroggo_chromium
2016/05/20 16:51:59
Done.
|
| + |
| + Result onStartIncrementalDecode(const SkImageInfo& dstInfo, const SkCodec::Options&, |
| + SkPMColor* ctable, int* ctableCount) override; |
| + Result onIncrementalDecode(std::function<void*(int)> callback, int*) override; |
| 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 fNumberPasses; |
| - int fBitDepth; |
| + const 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) = 0; |
| + virtual Result decode(std::function<void*(int)> callback, int* rowsDecoded) = 0; |
| + |
| typedef SkCodec INHERITED; |
| }; |