| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| 11 #include "SkColorSpace_Base.h" | 11 #include "SkColorSpace_Base.h" |
| 12 #include "SkColorTable.h" | 12 #include "SkColorTable.h" |
| 13 #include "SkMath.h" | 13 #include "SkMath.h" |
| 14 #include "SkOpts.h" | 14 #include "SkOpts.h" |
| 15 #include "SkPngCodec.h" | 15 #include "SkPngCodec.h" |
| 16 #include "SkPoint3.h" | 16 #include "SkPoint3.h" |
| 17 #include "SkSize.h" | 17 #include "SkSize.h" |
| 18 #include "SkStream.h" | 18 #include "SkStream.h" |
| 19 #include "SkSwizzler.h" | 19 #include "SkSwizzler.h" |
| 20 #include "SkTemplates.h" | 20 #include "SkTemplates.h" |
| 21 #include "SkUtils.h" | 21 #include "SkUtils.h" |
| 22 | 22 |
| 23 // This warning triggers false postives way too often in here. | |
| 24 #if defined(__GNUC__) && !defined(__clang__) | |
| 25 #pragma GCC diagnostic ignored "-Wclobbered" | |
| 26 #endif | |
| 27 | |
| 28 /////////////////////////////////////////////////////////////////////////////// | 23 /////////////////////////////////////////////////////////////////////////////// |
| 29 // Callback functions | 24 // Callback functions |
| 30 /////////////////////////////////////////////////////////////////////////////// | 25 /////////////////////////////////////////////////////////////////////////////// |
| 31 | 26 |
| 32 static void sk_error_fn(png_structp png_ptr, png_const_charp msg) { | 27 static void sk_error_fn(png_structp png_ptr, png_const_charp msg) { |
| 33 SkCodecPrintf("------ png error %s\n", msg); | 28 SkCodecPrintf("------ png error %s\n", msg); |
| 34 longjmp(png_jmpbuf(png_ptr), 1); | 29 longjmp(png_jmpbuf(png_ptr), 1); |
| 35 } | 30 } |
| 36 | 31 |
| 37 void sk_warning_fn(png_structp, png_const_charp msg) { | 32 void sk_warning_fn(png_structp, png_const_charp msg) { |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 SkCodec* outCodec; | 870 SkCodec* outCodec; |
| 876 if (read_header(stream, chunkReader, &outCodec, nullptr, nullptr)) { | 871 if (read_header(stream, chunkReader, &outCodec, nullptr, nullptr)) { |
| 877 // Codec has taken ownership of the stream. | 872 // Codec has taken ownership of the stream. |
| 878 SkASSERT(outCodec); | 873 SkASSERT(outCodec); |
| 879 streamDeleter.release(); | 874 streamDeleter.release(); |
| 880 return outCodec; | 875 return outCodec; |
| 881 } | 876 } |
| 882 | 877 |
| 883 return nullptr; | 878 return nullptr; |
| 884 } | 879 } |
| OLD | NEW |