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_libpng.h" | 8 #include "SkCodec_libpng.h" |
9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 default: | 333 default: |
334 //all the color types have been covered above | 334 //all the color types have been covered above |
335 SkASSERT(false); | 335 SkASSERT(false); |
336 } | 336 } |
337 | 337 |
338 int numberPasses = png_set_interlace_handling(png_ptr); | 338 int numberPasses = png_set_interlace_handling(png_ptr); |
339 if (numberPassesPtr) { | 339 if (numberPassesPtr) { |
340 *numberPassesPtr = numberPasses; | 340 *numberPassesPtr = numberPasses; |
341 } | 341 } |
342 | 342 |
343 // FIXME: Also need to check for sRGB (skbug.com/3471). | 343 // FIXME: Also need to check for sRGB ( https://bug.skia.org/3471 ). |
344 | 344 |
345 if (imageInfo) { | 345 if (imageInfo) { |
346 *imageInfo = SkImageInfo::Make(origWidth, origHeight, skColorType, skAlp
haType); | 346 *imageInfo = SkImageInfo::Make(origWidth, origHeight, skColorType, skAlp
haType); |
347 } | 347 } |
348 autoClean.detach(); | 348 autoClean.detach(); |
349 if (png_ptrp) { | 349 if (png_ptrp) { |
350 *png_ptrp = png_ptr; | 350 *png_ptrp = png_ptr; |
351 } | 351 } |
352 if (info_ptrp) { | 352 if (info_ptrp) { |
353 *info_ptrp = info_ptr; | 353 *info_ptrp = info_ptr; |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 } | 835 } |
836 | 836 |
837 if (1 == numberPasses) { | 837 if (1 == numberPasses) { |
838 return new SkPngScanlineDecoder(imageInfo, streamDeleter.detach(), png_p
tr, info_ptr, | 838 return new SkPngScanlineDecoder(imageInfo, streamDeleter.detach(), png_p
tr, info_ptr, |
839 bitDepth); | 839 bitDepth); |
840 } | 840 } |
841 | 841 |
842 return new SkPngInterlacedScanlineDecoder(imageInfo, streamDeleter.detach(),
png_ptr, | 842 return new SkPngInterlacedScanlineDecoder(imageInfo, streamDeleter.detach(),
png_ptr, |
843 info_ptr, bitDepth, numberPasses); | 843 info_ptr, bitDepth, numberPasses); |
844 } | 844 } |
OLD | NEW |