| 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 "SkForceLinking.h" | 8 #include "SkForceLinking.h" |
| 9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.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 decoder 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 CreateJPEGImageDecoder(); | 17 CreateJPEGImageDecoder(); |
| 18 CreateWEBPImageDecoder(); | 18 CreateWEBPImageDecoder(); |
| 19 CreateBMPImageDecoder(); | 19 CreateBMPImageDecoder(); |
| 20 CreateICOImageDecoder(); | 20 CreateICOImageDecoder(); |
| 21 CreateWBMPImageDecoder(); | 21 CreateWBMPImageDecoder(); |
| 22 // Only link hardware texture codecs on platforms that build them. See i
mages.gyp | 22 // Only link hardware texture codecs on platforms that build them. See i
mages.gyp |
| 23 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK | 23 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 24 CreatePKMImageDecoder(); | 24 CreatePKMImageDecoder(); |
| 25 CreateKTXImageDecoder(); | 25 CreateKTXImageDecoder(); |
| 26 CreateASTCImageDecoder(); | 26 CreateASTCImageDecoder(); |
| 27 #endif | 27 #endif |
| 28 // Only link GIF and PNG on platforms that build them. See images.gyp | 28 // Only link GIF and PNG on platforms that build them. See images.gyp |
| 29 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_NACL) \ | 29 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_IOS) |
| 30 && !defined(SK_BUILD_FOR_IOS) | |
| 31 CreateGIFImageDecoder(); | 30 CreateGIFImageDecoder(); |
| 32 #endif | 31 #endif |
| 33 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_IOS) | 32 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_IOS) |
| 34 CreatePNGImageDecoder(); | 33 CreatePNGImageDecoder(); |
| 35 #endif | 34 #endif |
| 36 #if defined(SK_BUILD_FOR_IOS) | 35 #if defined(SK_BUILD_FOR_IOS) |
| 37 CreatePNGImageEncoder_IOS(); | 36 CreatePNGImageEncoder_IOS(); |
| 38 #endif | 37 #endif |
| 39 return -1; | 38 return -1; |
| 40 } | 39 } |
| 41 return 0; | 40 return 0; |
| 42 } | 41 } |
| OLD | NEW |