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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 if (!this->codec()->skipScanlines(sampleY - 1)) { | 304 if (!this->codec()->skipScanlines(sampleY - 1)) { |
305 this->codec()->fillIncompleteImage(info, pixels, rowByte
s, | 305 this->codec()->fillIncompleteImage(info, pixels, rowByte
s, |
306 options.fZeroInitialized, dstHeight, y + 1); | 306 options.fZeroInitialized, dstHeight, y + 1); |
307 return SkCodec::kIncompleteInput; | 307 return SkCodec::kIncompleteInput; |
308 } | 308 } |
309 } | 309 } |
310 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); | 310 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); |
311 } | 311 } |
312 return SkCodec::kSuccess; | 312 return SkCodec::kSuccess; |
313 } | 313 } |
314 case SkCodec::kOutOfOrder_SkScanlineOrder: | |
315 case SkCodec::kBottomUp_SkScanlineOrder: { | 314 case SkCodec::kBottomUp_SkScanlineOrder: { |
316 // Note that these modes do not support subsetting. | 315 // Note that these modes do not support subsetting. |
317 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); | 316 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); |
318 int y; | 317 int y; |
319 for (y = 0; y < nativeSize.height(); y++) { | 318 for (y = 0; y < nativeSize.height(); y++) { |
320 int srcY = this->codec()->nextScanline(); | 319 int srcY = this->codec()->nextScanline(); |
321 if (is_coord_necessary(srcY, sampleY, dstHeight)) { | 320 if (is_coord_necessary(srcY, sampleY, dstHeight)) { |
322 void* pixelPtr = SkTAddOffset<void>(pixels, | 321 void* pixelPtr = SkTAddOffset<void>(pixels, |
323 rowBytes * get_dst_coord(srcY, sampleY)); | 322 rowBytes * get_dst_coord(srcY, sampleY)); |
324 if (1 != this->codec()->getScanlines(pixelPtr, 1, rowBytes))
{ | 323 if (1 != this->codec()->getScanlines(pixelPtr, 1, rowBytes))
{ |
(...skipping 23 matching lines...) Expand all Loading... |
348 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo
rd(srcY, sampleY)); | 347 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo
rd(srcY, sampleY)); |
349 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); | 348 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); |
350 } | 349 } |
351 return SkCodec::kIncompleteInput; | 350 return SkCodec::kIncompleteInput; |
352 } | 351 } |
353 default: | 352 default: |
354 SkASSERT(false); | 353 SkASSERT(false); |
355 return SkCodec::kUnimplemented; | 354 return SkCodec::kUnimplemented; |
356 } | 355 } |
357 } | 356 } |
OLD | NEW |