diff options
author | 2015-08-04 09:24:45 -0700 | |
---|---|---|
committer | 2015-08-04 09:24:45 -0700 | |
commit | 1c005e4a38e29d648ecebada25d3a718155043a3 (patch) | |
tree | ccc10aa351e4c58f9ffcd53b849d9a5afc46c28b /src/codec/SkCodec_libpng.h | |
parent | ddc726f1de09426557983361a0e7838a83612315 (diff) |
Create a scanline decoder without creating a codec
Prior to this CL, if a client wanted to decode scanlines, they had to
create an SkCodec in order to get an SkScanlineDecoder. This introduces
complications if input data is not easily shared between the two
objects.
Instead, add methods to SkScanlineDecoder for creating a new one from
input data, and remove the creation functions from SkCodec.
Update DM and tests.
Review URL: https://codereview.chromium.org/1267583002
Diffstat (limited to 'src/codec/SkCodec_libpng.h')
-rw-r--r-- | src/codec/SkCodec_libpng.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/codec/SkCodec_libpng.h b/src/codec/SkCodec_libpng.h index 297e8043fe..21bbdadb49 100644 --- a/src/codec/SkCodec_libpng.h +++ b/src/codec/SkCodec_libpng.h @@ -23,18 +23,18 @@ class SkStream; class SkPngCodec : public SkCodec { public: - // Assumes IsPng was called and returned true. - static SkCodec* NewFromStream(SkStream*); static bool IsPng(SkStream*); + // Assume IsPng was called and returned true. + static SkCodec* NewFromStream(SkStream*); + static SkScanlineDecoder* NewSDFromStream(SkStream*); + virtual ~SkPngCodec(); protected: Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMColor*, int*) override; SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedFormat; } - SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Options& options, - SkPMColor ctable[], int* ctableCount) override; bool onReallyHasAlpha() const override { return fReallyHasAlpha; } private: png_structp fPng_ptr; |