2 * Copyright 2013 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "SkForceLinking.h"
9 #include "SkImageDecoder.h"
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
13 // cause memory leaks.
14 int SkForceLinking(bool doNotPassTrue) {
17 CreateJPEGImageDecoder();
18 CreateWEBPImageDecoder();
19 CreateBMPImageDecoder();
20 CreateICOImageDecoder();
21 CreatePKMImageDecoder();
22 CreateKTXImageDecoder();
23 CreateASTCImageDecoder();
24 CreateWBMPImageDecoder();
25 // Only link GIF and PNG on platforms that build them. See images.gyp
26 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_NACL) \
27 && !defined(SK_BUILD_FOR_IOS)
28 CreateGIFImageDecoder();
30 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_IOS)
31 CreatePNGImageDecoder();
33 #if defined(SK_BUILD_FOR_IOS)
34 CreatePNGImageEncoder_IOS();