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 decoder 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 CreateJPEGImageEncoder(); | 17 CreateJPEGImageEncoder(); |
18 CreateWEBPImageEncoder(); | 18 CreateWEBPImageEncoder(); |
19 | 19 |
20 // Only link hardware texture codecs on platforms that build them. See i
mages.gyp | 20 // Only link hardware texture codecs on platforms that build them. See i
mages.gyp |
21 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK | 21 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
22 CreateKTXImageEncoder(); | 22 CreateKTXImageEncoder(); |
23 #endif | 23 #endif |
24 | 24 |
25 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_IOS) | 25 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_IOS) |
26 CreatePNGImageEncoder(); | 26 CreatePNGImageEncoder(); |
27 #endif | 27 #endif |
28 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | 28 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |
29 CreatePNGImageEncoder_CG(); | 29 CreatePNGImageEncoder_CG(); |
30 #endif | 30 #endif |
31 #if defined(SK_BUILD_FOR_WIN) | 31 #if defined(SK_BUILD_FOR_WIN) |
32 CreateImageEncoder_WIC(); | 32 CreateImageEncoder_WIC(); |
33 #endif | 33 #endif |
34 return -1; | 34 return -1; |
35 } | 35 } |
36 return 0; | 36 return 0; |
37 } | 37 } |
OLD | NEW |