Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/images/SkForceLinking.cpp

Issue 517663002: Ensure that we don't reference decoders that we don't build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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();
22 // Only link hardware texture codecs on platforms that build them. See i mages.gyp
23 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
21 CreatePKMImageDecoder(); 24 CreatePKMImageDecoder();
22 CreateKTXImageDecoder(); 25 CreateKTXImageDecoder();
23 CreateASTCImageDecoder(); 26 CreateASTCImageDecoder();
24 CreateWBMPImageDecoder(); 27 #endif
25 // 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
26 #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_NACL) \
27 && !defined(SK_BUILD_FOR_IOS) 30 && !defined(SK_BUILD_FOR_IOS)
28 CreateGIFImageDecoder(); 31 CreateGIFImageDecoder();
29 #endif 32 #endif
30 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL D_FOR_IOS) 33 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL D_FOR_IOS)
31 CreatePNGImageDecoder(); 34 CreatePNGImageDecoder();
32 #endif 35 #endif
33 #if defined(SK_BUILD_FOR_IOS) 36 #if defined(SK_BUILD_FOR_IOS)
34 CreatePNGImageEncoder_IOS(); 37 CreatePNGImageEncoder_IOS();
35 #endif 38 #endif
36 return -1; 39 return -1;
37 } 40 }
38 return 0; 41 return 0;
39 } 42 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698