| 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 int y; | 233 int y; |
| 233 for (y = 0; y < nativeSize.height(); y++) { | 234 for (y = 0; y < nativeSize.height(); y++) { |
| 234 int srcY = fCodec->nextScanline(); | 235 int srcY = fCodec->nextScanline(); |
| 235 if (is_coord_necessary(srcY, sampleY, dstHeight)) { | 236 if (is_coord_necessary(srcY, sampleY, dstHeight)) { |
| 236 void* pixelPtr = SkTAddOffset<void>(pixels, | 237 void* pixelPtr = SkTAddOffset<void>(pixels, |
| 237 rowBytes * get_dst_coord(srcY, sampleY)); | 238 rowBytes * get_dst_coord(srcY, sampleY)); |
| 238 if (1 != fCodec->getScanlines(pixelPtr, 1, rowBytes)) { | 239 if (1 != fCodec->getScanlines(pixelPtr, 1, rowBytes)) { |
| 239 break; | 240 break; |
| 240 } | 241 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // fCodec has already handled filling uninitialized memory. | 287 // fCodec has already handled filling uninitialized memory. |
| 287 return SkCodec::kIncompleteInput; | 288 return SkCodec::kIncompleteInput; |
| 288 } | 289 } |
| 289 return SkCodec::kSuccess; | 290 return SkCodec::kSuccess; |
| 290 } | 291 } |
| 291 default: | 292 default: |
| 292 SkASSERT(false); | 293 SkASSERT(false); |
| 293 return SkCodec::kUnimplemented; | 294 return SkCodec::kUnimplemented; |
| 294 } | 295 } |
| 295 } | 296 } |
| OLD | NEW |