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 "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkColorTable.h" | 10 #include "SkColorTable.h" |
11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
12 #include "SkMath.h" | 12 #include "SkMath.h" |
13 #include "SkOpts.h" | 13 #include "SkOpts.h" |
14 #include "SkPngCodec.h" | 14 #include "SkPngCodec.h" |
15 #include "SkSize.h" | 15 #include "SkSize.h" |
16 #include "SkStream.h" | 16 #include "SkStream.h" |
17 #include "SkSwizzler.h" | 17 #include "SkSwizzler.h" |
18 #include "SkTemplates.h" | 18 #include "SkTemplates.h" |
| 19 #include "SkUtils.h" |
19 | 20 |
20 /////////////////////////////////////////////////////////////////////////////// | 21 /////////////////////////////////////////////////////////////////////////////// |
21 // Callback functions | 22 // Callback functions |
22 /////////////////////////////////////////////////////////////////////////////// | 23 /////////////////////////////////////////////////////////////////////////////// |
23 | 24 |
24 static void sk_error_fn(png_structp png_ptr, png_const_charp msg) { | 25 static void sk_error_fn(png_structp png_ptr, png_const_charp msg) { |
25 SkCodecPrintf("------ png error %s\n", msg); | 26 SkCodecPrintf("------ png error %s\n", msg); |
26 longjmp(png_jmpbuf(png_ptr), 1); | 27 longjmp(png_jmpbuf(png_ptr), 1); |
27 } | 28 } |
28 | 29 |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } | 740 } |
740 | 741 |
741 if (1 == numberPasses) { | 742 if (1 == numberPasses) { |
742 return new SkPngScanlineDecoder(imageInfo, streamDeleter.detach(), chunk
Reader, | 743 return new SkPngScanlineDecoder(imageInfo, streamDeleter.detach(), chunk
Reader, |
743 png_ptr, info_ptr, bitDepth); | 744 png_ptr, info_ptr, bitDepth); |
744 } | 745 } |
745 | 746 |
746 return new SkPngInterlacedScanlineDecoder(imageInfo, streamDeleter.detach(),
chunkReader, | 747 return new SkPngInterlacedScanlineDecoder(imageInfo, streamDeleter.detach(),
chunkReader, |
747 png_ptr, info_ptr, bitDepth, numbe
rPasses); | 748 png_ptr, info_ptr, bitDepth, numbe
rPasses); |
748 } | 749 } |
OLD | NEW |