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 |
57 SkSampler* getSampler(bool createIfNecessary) override; | 62 SkSampler* getSampler(bool createIfNecessary) override; |
58 | 63 |
59 /* | 64 /* |
60 * Searches fEmbeddedCodecs for a codec that matches requestedSize. | 65 * Searches fEmbeddedCodecs for a codec that matches requestedSize. |
61 * The search starts at startIndex and ends when an appropriate codec | 66 * The search starts at startIndex and ends when an appropriate codec |
62 * is found, or we have reached the end of the array. | 67 * is found, or we have reached the end of the array. |
63 * | 68 * |
64 * @return the index of the matching codec or -1 if there is no | 69 * @return the index of the matching codec or -1 if there is no |
65 * matching codec between startIndex and the end of | 70 * matching codec between startIndex and the end of |
66 * the array. | 71 * the array. |
(...skipping 10 matching lines...) Expand all Loading... |
77 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // ow
ned | 82 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // ow
ned |
78 | 83 |
79 // Only used by the scanline decoder. onStartScanlineDecode() will set | 84 // Only used by the scanline decoder. onStartScanlineDecode() will set |
80 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a | 85 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a |
81 // codec of the appropriate size. We will use fCurrScanlineCodec for | 86 // codec of the appropriate size. We will use fCurrScanlineCodec for |
82 // subsequent calls to onGetScanlines() or onSkipScanlines(). | 87 // subsequent calls to onGetScanlines() or onSkipScanlines(). |
83 // fCurrScanlineCodec is owned by this class, but should not be an | 88 // fCurrScanlineCodec is owned by this class, but should not be an |
84 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. | 89 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. |
85 SkCodec* fCurrScanlineCodec; | 90 SkCodec* fCurrScanlineCodec; |
86 | 91 |
| 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 |
87 typedef SkCodec INHERITED; | 100 typedef SkCodec INHERITED; |
88 }; | 101 }; |
OLD | NEW |