Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
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) {
15 if (doNotPassTrue) {
16 SkASSERT(false);
17 CreateJPEGImageDecoder();
18 CreateWEBPImageDecoder();
19 CreateBMPImageDecoder();
20 CreateICOImageDecoder();
21 CreateWBMPImageDecoder();
22 // Only link GIF and PNG on platforms that build them. See images.gyp
23 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_NACL) \
24 && !defined(SK_BUILD_FOR_IOS)
25 CreateGIFImageDecoder();
26 #endif
27 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_IOS)
28 CreatePNGImageDecoder();
29 #endif
30 return -1;
31 }
32 return 0;
33 }