michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #include "SkForceLinking.h" michael@0: #include "SkImageDecoder.h" michael@0: michael@0: // This method is required to fool the linker into not discarding the pre-main michael@0: // initialization and registration of the decoder classes. Passing true will michael@0: // cause memory leaks. michael@0: int SkForceLinking(bool doNotPassTrue) { michael@0: if (doNotPassTrue) { michael@0: SkASSERT(false); michael@0: CreateJPEGImageDecoder(); michael@0: CreateWEBPImageDecoder(); michael@0: CreateBMPImageDecoder(); michael@0: CreateICOImageDecoder(); michael@0: CreateWBMPImageDecoder(); michael@0: // Only link GIF and PNG on platforms that build them. See images.gyp michael@0: #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_NACL) \ michael@0: && !defined(SK_BUILD_FOR_IOS) michael@0: CreateGIFImageDecoder(); michael@0: #endif michael@0: #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_IOS) michael@0: CreatePNGImageDecoder(); michael@0: #endif michael@0: return -1; michael@0: } michael@0: return 0; michael@0: }