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 #ifndef SkCodec_wbmp_DEFINED | 8 #ifndef SkCodec_wbmp_DEFINED |
9 #define SkCodec_wbmp_DEFINED | 9 #define SkCodec_wbmp_DEFINED |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 /* | 26 /* |
27 * Assumes IsWbmp was called and returned true | 27 * Assumes IsWbmp was called and returned true |
28 * Creates a wbmp scanline decoder | 28 * Creates a wbmp scanline decoder |
29 * Takes ownership of the stream | 29 * Takes ownership of the stream |
30 */ | 30 */ |
31 static SkScanlineDecoder* NewSDFromStream(SkStream*); | 31 static SkScanlineDecoder* NewSDFromStream(SkStream*); |
32 protected: | 32 protected: |
33 SkEncodedFormat onGetEncodedFormat() const override; | 33 SkEncodedFormat onGetEncodedFormat() const override; |
34 Result onGetPixels(const SkImageInfo&, void*, size_t, | 34 Result onGetPixels(const SkImageInfo&, void*, size_t, |
35 const Options&, SkPMColor[], int*) override; | 35 const Options&, SkPMColor[], int*) override; |
| 36 bool onRewind() override; |
36 private: | 37 private: |
37 | |
38 /* | |
39 * Calls rewindIfNeeded and returns true if the decoder can continue | |
40 */ | |
41 bool handleRewind(); | |
42 | |
43 /* | 38 /* |
44 * Returns a swizzler on success, NULL on failure | 39 * Returns a swizzler on success, NULL on failure |
45 */ | 40 */ |
46 SkSwizzler* initializeSwizzler(const SkImageInfo& info, const SkPMColor* cta
ble, | 41 SkSwizzler* initializeSwizzler(const SkImageInfo& info, const SkPMColor* cta
ble, |
47 const Options& opts); | 42 const Options& opts); |
48 | 43 |
49 /* | 44 /* |
50 * Read a src row from the encoded stream | 45 * Read a src row from the encoded stream |
51 */ | 46 */ |
52 Result readRow(uint8_t* row); | 47 Result readRow(uint8_t* row); |
53 | 48 |
54 SkWbmpCodec(const SkImageInfo&, SkStream*); | 49 SkWbmpCodec(const SkImageInfo&, SkStream*); |
55 | 50 |
56 const size_t fSrcRowBytes; | 51 const size_t fSrcRowBytes; |
57 | 52 |
58 friend class SkWbmpScanlineDecoder; | 53 friend class SkWbmpScanlineDecoder; |
59 typedef SkCodec INHERITED; | 54 typedef SkCodec INHERITED; |
60 }; | 55 }; |
61 | 56 |
62 #endif // SkCodec_wbmp_DEFINED | 57 #endif // SkCodec_wbmp_DEFINED |
OLD | NEW |