| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkImageDecoder.h" | 8 #include "SkImageDecoder.h" |
| 9 #include "SkImageEncoder.h" | 9 #include "SkImageEncoder.h" |
| 10 #include "SkColor.h" | 10 #include "SkColor.h" |
| 11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
| 12 #include "SkDither.h" | 12 #include "SkDither.h" |
| 13 #include "SkMath.h" | 13 #include "SkMath.h" |
| 14 #include "SkRTConf.h" | 14 #include "SkRTConf.h" |
| 15 #include "SkScaledBitmapSampler.h" | 15 #include "SkScaledBitmapSampler.h" |
| 16 #include "SkStream.h" | 16 #include "SkStream.h" |
| 17 #include "SkTemplates.h" | 17 #include "SkTemplates.h" |
| 18 #include "SkUtils.h" | 18 #include "SkUtils.h" |
| 19 #include "transform_scanline.h" | 19 #include "transform_scanline.h" |
| 20 extern "C" { | 20 |
| 21 #ifdef SKIA_PNG_PREFIXED |
| 22 // this must proceed png.h |
| 23 #include "pngprefix.h" |
| 24 #endif |
| 21 #include "png.h" | 25 #include "png.h" |
| 22 } | |
| 23 | 26 |
| 24 /* These were dropped in libpng >= 1.4 */ | 27 /* These were dropped in libpng >= 1.4 */ |
| 25 #ifndef png_infopp_NULL | 28 #ifndef png_infopp_NULL |
| 26 #define png_infopp_NULL NULL | 29 #define png_infopp_NULL NULL |
| 27 #endif | 30 #endif |
| 28 | 31 |
| 29 #ifndef png_bytepp_NULL | 32 #ifndef png_bytepp_NULL |
| 30 #define png_bytepp_NULL NULL | 33 #define png_bytepp_NULL NULL |
| 31 #endif | 34 #endif |
| 32 | 35 |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 return SkImageDecoder::kUnknown_Format; | 1283 return SkImageDecoder::kUnknown_Format; |
| 1281 } | 1284 } |
| 1282 | 1285 |
| 1283 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) { | 1286 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) { |
| 1284 return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL; | 1287 return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL; |
| 1285 } | 1288 } |
| 1286 | 1289 |
| 1287 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory); | 1290 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory); |
| 1288 static SkImageDecoder_FormatReg gFormatReg(get_format_png); | 1291 static SkImageDecoder_FormatReg gFormatReg(get_format_png); |
| 1289 static SkImageEncoder_EncodeReg gEReg(sk_libpng_efactory); | 1292 static SkImageEncoder_EncodeReg gEReg(sk_libpng_efactory); |
| OLD | NEW |