OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkImageEncoder.h" | 8 #include "SkImageEncoder.h" |
9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
10 | 10 |
11 // This method is required to fool the linker into not discarding the pre-main | 11 // This method is required to fool the linker into not discarding the pre-main |
12 // initialization and registration of the encoder classes. Passing true will | 12 // initialization and registration of the encoder classes. Passing true will |
13 // cause memory leaks. | 13 // cause memory leaks. |
14 int SkForceLinking(bool doNotPassTrue) { | 14 int SkForceLinking(bool doNotPassTrue) { |
15 if (doNotPassTrue) { | 15 if (doNotPassTrue) { |
16 SkASSERT(false); | 16 SkASSERT(false); |
17 #if defined(SK_HAS_JPEG_LIBRARY) && !defined(SK_USE_CG_ENCODER) && !defined(SK_U
SE_WIC_ENCODER) | 17 #if defined(SK_HAS_JPEG_LIBRARY) && !defined(SK_USE_CG_ENCODER) && !defined(SK_U
SE_WIC_ENCODER) |
18 CreateJPEGImageEncoder(); | 18 CreateJPEGImageEncoder(); |
19 #endif | 19 #endif |
20 #if defined(SK_HAS_WEBP_LIBRARY) && !defined(SK_USE_CG_ENCODER) && !defined(SK_U
SE_WIC_ENCODER) | 20 #if defined(SK_HAS_WEBP_LIBRARY) && !defined(SK_USE_CG_ENCODER) && !defined(SK_U
SE_WIC_ENCODER) |
21 CreateWEBPImageEncoder(); | 21 CreateWEBPImageEncoder(); |
22 #endif | 22 #endif |
23 #if defined(SK_HAS_PNG_LIBRARY) && !defined(SK_USE_CG_ENCODER) && !defined(SK_US
E_WIC_ENCODER) | 23 #if defined(SK_HAS_PNG_LIBRARY) && !defined(SK_USE_CG_ENCODER) && !defined(SK_US
E_WIC_ENCODER) |
24 CreatePNGImageEncoder(); | 24 CreatePNGImageEncoder(); |
25 #endif | 25 #endif |
26 | 26 |
27 // Only link hardware texture codecs on platforms that build them. See i
mages.gyp | |
28 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK | 27 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 28 CreateEXRImageEncoder(); |
29 CreateKTXImageEncoder(); | 29 CreateKTXImageEncoder(); |
30 #endif | 30 #endif |
31 | 31 |
32 #if defined (SK_USE_CG_ENCODER) | 32 #if defined (SK_USE_CG_ENCODER) |
33 CreateImageEncoder_CG(SkImageEncoder::kPNG_Type); | 33 CreateImageEncoder_CG(SkImageEncoder::kPNG_Type); |
34 #endif | 34 #endif |
35 #if defined (SK_USE_WIC_ENCODER) | 35 #if defined (SK_USE_WIC_ENCODER) |
36 CreateImageEncoder_WIC(SkImageEncoder::kPNG_Type); | 36 CreateImageEncoder_WIC(SkImageEncoder::kPNG_Type); |
37 #endif | 37 #endif |
38 return -1; | 38 return -1; |
39 } | 39 } |
40 return 0; | 40 return 0; |
41 } | 41 } |
OLD | NEW |