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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 if (kUnknown_Format == *format) { | 443 if (kUnknown_Format == *format) { |
444 if (stream->rewind()) { | 444 if (stream->rewind()) { |
445 *format = GetStreamFormat(stream); | 445 *format = GetStreamFormat(stream); |
446 } | 446 } |
447 } | 447 } |
448 } | 448 } |
449 delete codec; | 449 delete codec; |
450 } | 450 } |
451 return success; | 451 return success; |
452 } | 452 } |
453 | |
454 /** | |
455 * This function leaks, but that is okay because it is not intended | |
456 * to be called. It is only here so that the linker will include the | |
457 * decoders. | |
458 * Make sure to keep it in sync with images.gyp, so only the encoders | |
459 * which are created on a platform are linked. | |
460 */ | |
461 void force_linking(); | |
462 void force_linking() { | |
463 SkASSERT(false); | |
464 CreateJPEGImageDecoder(); | |
465 CreateWEBPImageDecoder(); | |
466 CreateBMPImageDecoder(); | |
467 CreateICOImageDecoder(); | |
468 CreateWBMPImageDecoder(); | |
469 // Only link GIF and PNG on platforms that build them. See images.gyp | |
470 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_NACL) | |
471 CreateGIFImageDecoder(); | |
472 #endif | |
473 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) | |
474 CreatePNGImageDecoder(); | |
475 #endif | |
476 } | |
OLD | NEW |