OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCodec.h" | 8 #include "SkCodec.h" |
9 #include "SkColorTable.h" | 9 #include "SkColorTable.h" |
10 #include "SkEncodedFormat.h" | 10 #include "SkEncodedFormat.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 virtual ~SkPngCodec(); | 30 virtual ~SkPngCodec(); |
31 | 31 |
32 protected: | 32 protected: |
33 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMCo
lor*, int*) | 33 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMCo
lor*, int*) |
34 override; | 34 override; |
35 SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedF
ormat; } | 35 SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedF
ormat; } |
36 SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Op
tions& options, | 36 SkScanlineDecoder* onGetScanlineDecoder(const SkImageInfo& dstInfo, const Op
tions& options, |
37 SkPMColor ctable[], int* ctableCount
) override; | 37 SkPMColor ctable[], int* ctableCount
) override; |
38 bool onReallyHasAlpha() const override { return fReallyHasAlpha; } | 38 bool onReallyHasAlpha() const override { return fReallyHasAlpha; } |
| 39 bool onIsInterlaced() override; |
| 40 |
39 private: | 41 private: |
40 png_structp fPng_ptr; | 42 png_structp fPng_ptr; |
41 png_infop fInfo_ptr; | 43 png_infop fInfo_ptr; |
42 | 44 |
43 // These are stored here so they can be used both by normal decoding and sca
nline decoding. | 45 // These are stored here so they can be used both by normal decoding and sca
nline decoding. |
44 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul. | 46 SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul. |
45 SkAutoTDelete<SkSwizzler> fSwizzler; | 47 SkAutoTDelete<SkSwizzler> fSwizzler; |
46 | 48 |
47 SkSwizzler::SrcConfig fSrcConfig; | 49 SkSwizzler::SrcConfig fSrcConfig; |
48 int fNumberPasses; | 50 int fNumberPasses; |
(...skipping 10 matching lines...) Expand all Loading... |
59 // Calls rewindIfNeeded and returns true if the decoder can continue. | 61 // Calls rewindIfNeeded and returns true if the decoder can continue. |
60 bool handleRewind(); | 62 bool handleRewind(); |
61 bool decodePalette(bool premultiply, int* ctableCount); | 63 bool decodePalette(bool premultiply, int* ctableCount); |
62 void destroyReadStruct(); | 64 void destroyReadStruct(); |
63 | 65 |
64 friend class SkPngScanlineDecoder; | 66 friend class SkPngScanlineDecoder; |
65 friend class SkPngInterlacedScanlineDecoder; | 67 friend class SkPngInterlacedScanlineDecoder; |
66 | 68 |
67 typedef SkCodec INHERITED; | 69 typedef SkCodec INHERITED; |
68 }; | 70 }; |
OLD | NEW |