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 "SkImageInfo.h" | 10 #include "SkImageInfo.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 /* | 143 /* |
144 * @return true if the read is successful and false if the read fails. | 144 * @return true if the read is successful and false if the read fails. |
145 */ | 145 */ |
146 bool readRow(); | 146 bool readRow(); |
147 | 147 |
148 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opts
, | 148 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& opts
, |
149 SkPMColor inputColorPtr[], int* inputColorCount) override; | 149 SkPMColor inputColorPtr[], int* inputColorCount) override; |
150 | 150 |
151 int onGetScanlines(void* dst, int count, size_t rowBytes) override; | 151 int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
152 | 152 |
| 153 bool onSkipScanlines(int count) override; |
| 154 |
| 155 /* |
| 156 * For a scanline decode of "count" lines, this function indicates how |
| 157 * many of the "count" lines should be skipped until we reach the top of |
| 158 * the image frame and how many of the "count" lines are actually inside |
| 159 * the image frame. |
| 160 * |
| 161 * @param count The number of scanlines requested. |
| 162 * @param rowsBeforeFrame Output variable. The number of lines before |
| 163 * we reach the top of the image frame. |
| 164 * @param rowsInFrame Output variable. The number of lines to decode |
| 165 * inside the image frame. |
| 166 */ |
| 167 void handleScanlineFrame(int count, int* rowsBeforeFrame, int* rowsInFrame); |
| 168 |
153 SkScanlineOrder onGetScanlineOrder() const override; | 169 SkScanlineOrder onGetScanlineOrder() const override; |
154 | 170 |
155 /* | 171 /* |
156 * This function cleans up the gif object after the decode completes | 172 * This function cleans up the gif object after the decode completes |
157 * It is used in a SkAutoTCallIProc template | 173 * It is used in a SkAutoTCallIProc template |
158 */ | 174 */ |
159 static void CloseGif(GifFileType* gif); | 175 static void CloseGif(GifFileType* gif); |
160 | 176 |
161 /* | 177 /* |
162 * Frees any extension data used in the decode | 178 * Frees any extension data used in the decode |
(...skipping 19 matching lines...) Expand all Loading... |
182 SkAutoTDeleteArray<uint8_t> fSrcBuffer; | 198 SkAutoTDeleteArray<uint8_t> fSrcBuffer; |
183 const SkIRect fFrameRect; | 199 const SkIRect fFrameRect; |
184 const uint32_t fTransIndex; | 200 const uint32_t fTransIndex; |
185 uint32_t fFillIndex; | 201 uint32_t fFillIndex; |
186 const bool fFrameIsSubset; | 202 const bool fFrameIsSubset; |
187 SkAutoTDelete<SkSwizzler> fSwizzler; | 203 SkAutoTDelete<SkSwizzler> fSwizzler; |
188 SkAutoTUnref<SkColorTable> fColorTable; | 204 SkAutoTUnref<SkColorTable> fColorTable; |
189 | 205 |
190 typedef SkCodec INHERITED; | 206 typedef SkCodec INHERITED; |
191 }; | 207 }; |
OLD | NEW |