OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 if (kUnknown_Format == *format) { | 332 if (kUnknown_Format == *format) { |
333 if (stream->rewind()) { | 333 if (stream->rewind()) { |
334 *format = GetStreamFormat(stream); | 334 *format = GetStreamFormat(stream); |
335 } | 335 } |
336 } | 336 } |
337 } | 337 } |
338 delete codec; | 338 delete codec; |
339 } | 339 } |
340 return success; | 340 return success; |
341 } | 341 } |
| 342 |
| 343 namespace { |
| 344 /** |
| 345 * This function leaks, but that is okay because it is not intended |
| 346 * to be called. It is only here so that the linker will include the |
| 347 * decoders. |
| 348 * Make sure to keep it in sync with images.gyp, so only the encoders |
| 349 * which are created on a platform are linked. |
| 350 */ |
| 351 void force_linking() { |
| 352 SkASSERT(false); |
| 353 CreateJPEGImageDecoder(); |
| 354 CreateWEBPImageDecoder(); |
| 355 CreateBMPImageDecoder(); |
| 356 CreateICOImageDecoder(); |
| 357 CreateWBMPImageDecoder(); |
| 358 // Only link GIF and PNG on platforms that build them. See images.gyp |
| 359 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_NACL) |
| 360 CreateGIFImageDecoder(); |
| 361 #endif |
| 362 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) |
| 363 CreatePNGImageDecoder(); |
| 364 #endif |
| 365 } |
| 366 } |
OLD | NEW |