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 "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkMath.h" | 10 #include "SkMath.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 if (!fCodec->skipScanlines(sampleY - 1)) { | 219 if (!fCodec->skipScanlines(sampleY - 1)) { |
220 fCodec->fillIncompleteImage(info, pixels, rowBytes, | 220 fCodec->fillIncompleteImage(info, pixels, rowBytes, |
221 options.fZeroInitialized, dstHeight, y + 1); | 221 options.fZeroInitialized, dstHeight, y + 1); |
222 return SkCodec::kIncompleteInput; | 222 return SkCodec::kIncompleteInput; |
223 } | 223 } |
224 } | 224 } |
225 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); | 225 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); |
226 } | 226 } |
227 return SkCodec::kSuccess; | 227 return SkCodec::kSuccess; |
228 } | 228 } |
| 229 case SkCodec::kOutOfOrder_SkScanlineOrder: |
229 case SkCodec::kBottomUp_SkScanlineOrder: { | 230 case SkCodec::kBottomUp_SkScanlineOrder: { |
230 // Note that this mode does not support subsetting. | 231 // Note that these modes do not support subsetting. |
231 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); | 232 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); |
232 SkCodec::Result result = SkCodec::kSuccess; | 233 SkCodec::Result result = SkCodec::kSuccess; |
233 int y; | 234 int y; |
234 for (y = 0; y < nativeSize.height(); y++) { | 235 for (y = 0; y < nativeSize.height(); y++) { |
235 int srcY = fCodec->nextScanline(); | 236 int srcY = fCodec->nextScanline(); |
236 if (is_coord_necessary(srcY, sampleY, dstHeight)) { | 237 if (is_coord_necessary(srcY, sampleY, dstHeight)) { |
237 void* pixelPtr = SkTAddOffset<void>(pixels, | 238 void* pixelPtr = SkTAddOffset<void>(pixels, |
238 rowBytes * get_dst_coord(srcY, sampleY)); | 239 rowBytes * get_dst_coord(srcY, sampleY)); |
239 if (1 != fCodec->getScanlines(pixelPtr, 1, rowBytes)) { | 240 if (1 != fCodec->getScanlines(pixelPtr, 1, rowBytes)) { |
240 result = SkCodec::kIncompleteInput; | 241 result = SkCodec::kIncompleteInput; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // fCodec has already handled filling uninitialized memory. | 288 // fCodec has already handled filling uninitialized memory. |
288 return SkCodec::kIncompleteInput; | 289 return SkCodec::kIncompleteInput; |
289 } | 290 } |
290 return SkCodec::kSuccess; | 291 return SkCodec::kSuccess; |
291 } | 292 } |
292 default: | 293 default: |
293 SkASSERT(false); | 294 SkASSERT(false); |
294 return SkCodec::kUnimplemented; | 295 return SkCodec::kUnimplemented; |
295 } | 296 } |
296 } | 297 } |
OLD | NEW |