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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 342 |
343 namespace { | 343 /** |
344 /** | 344 * This function leaks, but that is okay because it is not intended |
345 * This function leaks, but that is okay because it is not intended | 345 * to be called. It is only here so that the linker will include the |
346 * to be called. It is only here so that the linker will include the | 346 * decoders. |
347 * decoders. | 347 * Make sure to keep it in sync with images.gyp, so only the encoders |
348 * Make sure to keep it in sync with images.gyp, so only the encoders | 348 * which are created on a platform are linked. |
349 * which are created on a platform are linked. | 349 */ |
350 */ | 350 void force_linking(); |
351 void force_linking(); | 351 void force_linking() { |
352 void force_linking() { | 352 SkASSERT(false); |
353 SkASSERT(false); | 353 CreateJPEGImageDecoder(); |
354 CreateJPEGImageDecoder(); | 354 CreateWEBPImageDecoder(); |
355 CreateWEBPImageDecoder(); | 355 CreateBMPImageDecoder(); |
356 CreateBMPImageDecoder(); | 356 CreateICOImageDecoder(); |
357 CreateICOImageDecoder(); | 357 CreateWBMPImageDecoder(); |
358 CreateWBMPImageDecoder(); | 358 // Only link GIF and PNG on platforms that build them. See images.gyp |
359 // Only link GIF and PNG on platforms that build them. See images.gyp | |
360 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_NACL) | 359 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL
D_FOR_NACL) |
361 CreateGIFImageDecoder(); | 360 CreateGIFImageDecoder(); |
362 #endif | 361 #endif |
363 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) | 362 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) |
364 CreatePNGImageDecoder(); | 363 CreatePNGImageDecoder(); |
365 #endif | 364 #endif |
366 } | |
367 } | 365 } |
OLD | NEW |