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

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

Issue 1956573002: Compile SkForceLinking on CMake (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Refactoring Created 4 years, 7 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 | « src/codec/SkCodec.cpp ('k') | 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 "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)
17 CreateJPEGImageEncoder(); 18 CreateJPEGImageEncoder();
19 #endif
20 #if defined(SK_HAS_WEBP_LIBRARY)
18 CreateWEBPImageEncoder(); 21 CreateWEBPImageEncoder();
22 #endif
19 23
20 // Only link hardware texture codecs on platforms that build them. See i mages.gyp 24 // Only link hardware texture codecs on platforms that build them. See i mages.gyp
21 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK 25 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
22 CreateKTXImageEncoder(); 26 CreateKTXImageEncoder();
23 #endif 27 #endif
24 28
25 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL D_FOR_IOS) 29 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL D_FOR_IOS) && \
30 defined(SK_HAS_PNG_LIBRARY)
26 CreatePNGImageEncoder(); 31 CreatePNGImageEncoder();
27 #endif 32 #endif
28 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) 33 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
29 CreatePNGImageEncoder_CG(); 34 CreatePNGImageEncoder_CG();
30 #endif 35 #endif
31 #if defined(SK_BUILD_FOR_WIN) 36 #if defined(SK_BUILD_FOR_WIN)
32 CreateImageEncoder_WIC(); 37 CreateImageEncoder_WIC();
33 #endif 38 #endif
34 return -1; 39 return -1;
35 } 40 }
36 return 0; 41 return 0;
37 } 42 }
OLDNEW
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698