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 "SkImageInfo.h" | 9 #include "SkImageInfo.h" |
10 #include "SkStream.h" | 10 #include "SkStream.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 private: | 48 private: |
49 | 49 |
50 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti
ons& options, | 50 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti
ons& options, |
51 SkPMColor inputColorPtr[], int* inputColorCount) override; | 51 SkPMColor inputColorPtr[], int* inputColorCount) override; |
52 | 52 |
53 int onGetScanlines(void* dst, int count, size_t rowBytes) override; | 53 int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
54 | 54 |
55 bool onSkipScanlines(int count) override; | 55 bool onSkipScanlines(int count) override; |
56 | 56 |
57 Result onStartIncrementalDecode(const SkImageInfo& dstInfo, void* pixels, si
ze_t rowBytes, | |
58 const SkCodec::Options&, SkPMColor*, int*) override; | |
59 | |
60 Result onIncrementalDecode(int* rowsDecoded) override; | |
61 | |
62 SkSampler* getSampler(bool createIfNecessary) override; | 57 SkSampler* getSampler(bool createIfNecessary) override; |
63 | 58 |
64 /* | 59 /* |
65 * Searches fEmbeddedCodecs for a codec that matches requestedSize. | 60 * Searches fEmbeddedCodecs for a codec that matches requestedSize. |
66 * The search starts at startIndex and ends when an appropriate codec | 61 * The search starts at startIndex and ends when an appropriate codec |
67 * is found, or we have reached the end of the array. | 62 * is found, or we have reached the end of the array. |
68 * | 63 * |
69 * @return the index of the matching codec or -1 if there is no | 64 * @return the index of the matching codec or -1 if there is no |
70 * matching codec between startIndex and the end of | 65 * matching codec between startIndex and the end of |
71 * the array. | 66 * the array. |
(...skipping 10 matching lines...) Expand all Loading... |
82 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // ow
ned | 77 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // ow
ned |
83 | 78 |
84 // Only used by the scanline decoder. onStartScanlineDecode() will set | 79 // Only used by the scanline decoder. onStartScanlineDecode() will set |
85 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a | 80 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a |
86 // codec of the appropriate size. We will use fCurrScanlineCodec for | 81 // codec of the appropriate size. We will use fCurrScanlineCodec for |
87 // subsequent calls to onGetScanlines() or onSkipScanlines(). | 82 // subsequent calls to onGetScanlines() or onSkipScanlines(). |
88 // fCurrScanlineCodec is owned by this class, but should not be an | 83 // fCurrScanlineCodec is owned by this class, but should not be an |
89 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. | 84 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. |
90 SkCodec* fCurrScanlineCodec; | 85 SkCodec* fCurrScanlineCodec; |
91 | 86 |
92 // Only used by incremental decoder. onStartIncrementalDecode() will set | |
93 // fCurrIncrementalCodec to one of the fEmbeddedCodecs, if it can find a | |
94 // codec of the appropriate size. We will use fCurrIncrementalCodec for | |
95 // subsequent calls to incrementalDecode(). | |
96 // fCurrIncrementalCodec is owned by this class, but should not be an | |
97 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. | |
98 SkCodec* fCurrIncrementalCodec; | |
99 | |
100 typedef SkCodec INHERITED; | 87 typedef SkCodec INHERITED; |
101 }; | 88 }; |
OLD | NEW |