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 | 20 extern "C" { |
21 #ifdef SKIA_PNG_PREFIXED | |
22 // this must proceed png.h | |
23 #include "pngprefix.h" | |
24 #endif | |
25 #include "png.h" | 21 #include "png.h" |
| 22 } |
26 | 23 |
27 /* These were dropped in libpng >= 1.4 */ | 24 /* These were dropped in libpng >= 1.4 */ |
28 #ifndef png_infopp_NULL | 25 #ifndef png_infopp_NULL |
29 #define png_infopp_NULL NULL | 26 #define png_infopp_NULL NULL |
30 #endif | 27 #endif |
31 | 28 |
32 #ifndef png_bytepp_NULL | 29 #ifndef png_bytepp_NULL |
33 #define png_bytepp_NULL NULL | 30 #define png_bytepp_NULL NULL |
34 #endif | 31 #endif |
35 | 32 |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 return SkImageDecoder::kUnknown_Format; | 1280 return SkImageDecoder::kUnknown_Format; |
1284 } | 1281 } |
1285 | 1282 |
1286 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) { | 1283 SkImageEncoder* sk_libpng_efactory(SkImageEncoder::Type t) { |
1287 return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL; | 1284 return (SkImageEncoder::kPNG_Type == t) ? SkNEW(SkPNGImageEncoder) : NULL; |
1288 } | 1285 } |
1289 | 1286 |
1290 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory); | 1287 static SkImageDecoder_DecodeReg gDReg(sk_libpng_dfactory); |
1291 static SkImageDecoder_FormatReg gFormatReg(get_format_png); | 1288 static SkImageDecoder_FormatReg gFormatReg(get_format_png); |
1292 static SkImageEncoder_EncodeReg gEReg(sk_libpng_efactory); | 1289 static SkImageEncoder_EncodeReg gEReg(sk_libpng_efactory); |
OLD | NEW |