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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (!this->codec()->skipScanlines(sampleY - 1)) { | 297 if (!this->codec()->skipScanlines(sampleY - 1)) { |
298 this->codec()->fillIncompleteImage(info, pixels, rowByte
s, | 298 this->codec()->fillIncompleteImage(info, pixels, rowByte
s, |
299 options.fZeroInitialized, dstHeight, y + 1); | 299 options.fZeroInitialized, dstHeight, y + 1); |
300 return SkCodec::kIncompleteInput; | 300 return SkCodec::kIncompleteInput; |
301 } | 301 } |
302 } | 302 } |
303 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); | 303 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); |
304 } | 304 } |
305 return SkCodec::kSuccess; | 305 return SkCodec::kSuccess; |
306 } | 306 } |
307 case SkCodec::kOutOfOrder_SkScanlineOrder: | |
308 case SkCodec::kBottomUp_SkScanlineOrder: { | 307 case SkCodec::kBottomUp_SkScanlineOrder: { |
309 // Note that these modes do not support subsetting. | 308 // Note that these modes do not support subsetting. |
310 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); | 309 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); |
311 int y; | 310 int y; |
312 for (y = 0; y < nativeSize.height(); y++) { | 311 for (y = 0; y < nativeSize.height(); y++) { |
313 int srcY = this->codec()->nextScanline(); | 312 int srcY = this->codec()->nextScanline(); |
314 if (is_coord_necessary(srcY, sampleY, dstHeight)) { | 313 if (is_coord_necessary(srcY, sampleY, dstHeight)) { |
315 void* pixelPtr = SkTAddOffset<void>(pixels, | 314 void* pixelPtr = SkTAddOffset<void>(pixels, |
316 rowBytes * get_dst_coord(srcY, sampleY)); | 315 rowBytes * get_dst_coord(srcY, sampleY)); |
317 if (1 != this->codec()->getScanlines(pixelPtr, 1, rowBytes))
{ | 316 if (1 != this->codec()->getScanlines(pixelPtr, 1, rowBytes))
{ |
(...skipping 23 matching lines...) Expand all Loading... |
341 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo
rd(srcY, sampleY)); | 340 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo
rd(srcY, sampleY)); |
342 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); | 341 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); |
343 } | 342 } |
344 return SkCodec::kIncompleteInput; | 343 return SkCodec::kIncompleteInput; |
345 } | 344 } |
346 default: | 345 default: |
347 SkASSERT(false); | 346 SkASSERT(false); |
348 return SkCodec::kUnimplemented; | 347 return SkCodec::kUnimplemented; |
349 } | 348 } |
350 } | 349 } |
OLD | NEW |