Chromium Code Reviews| Index: src/images/SkImageDecoder.cpp |
| diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp |
| index 16cba641db4bade629f2ce5be63a779b41930c64..8fe1975855cefaae5326d7f9f4f6dc1a06f6812c 100644 |
| --- a/src/images/SkImageDecoder.cpp |
| +++ b/src/images/SkImageDecoder.cpp |
| @@ -339,3 +339,28 @@ bool SkImageDecoder::DecodeStream(SkStream* stream, SkBitmap* bm, |
| } |
| return success; |
| } |
| + |
| +namespace { |
| + /** |
| + * This function leaks, but that is okay because it is not intended |
| + * to be called. It is only here so that the linker will include the |
| + * decoders. |
| + * Make sure to keep it in sync with images.gyp, so only the encoders |
| + * which are created on a platform are linked. |
| + */ |
| + void force_linking() { |
| + SkASSERT(false); |
| + CreateJPEGImageDecoder(); |
| + CreateWEBPImageDecoder(); |
| + CreateBMPImageDecoder(); |
| + CreateICOImageDecoder(); |
| + CreateWBMPImageDecoder(); |
| + // Only link GIF and PNG on platforms that build them. See images.gyp |
| +#if !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_NACL) |
|
djsollen
2013/05/01 20:09:26
SK_BUILD_FOR_WIN is duped here and on 362
scroggo
2013/05/01 20:13:04
Done.
|
| + CreateGIFImageDecoder(); |
| +#endif |
| +#if !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_WIN) |
| + CreatePNGImageDecoder(); |
| +#endif |
| + } |
| +} |