| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 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 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 285 |
| 286 bool failed = print_strings("Invalid files", gInvalidStreams); | 286 bool failed = print_strings("Invalid files", gInvalidStreams); |
| 287 failed |= print_strings("Missing codec", gMissingCodecs); | 287 failed |= print_strings("Missing codec", gMissingCodecs); |
| 288 failed |= print_strings("Failed to decode", gDecodeFailures); | 288 failed |= print_strings("Failed to decode", gDecodeFailures); |
| 289 failed |= print_strings("Failed to encode", gEncodeFailures); | 289 failed |= print_strings("Failed to encode", gEncodeFailures); |
| 290 print_strings("Decoded", gSuccessfulDecodes); | 290 print_strings("Decoded", gSuccessfulDecodes); |
| 291 | 291 |
| 292 return failed ? -1 : 0; | 292 return failed ? -1 : 0; |
| 293 } | 293 } |
| 294 | 294 |
| 295 void forceLinking(); | |
| 296 | |
| 297 void forceLinking() { | |
| 298 // This function leaks, but that is okay because it is not intended | |
| 299 // to be called. It is only here so that the linker will include the | |
| 300 // decoders. | |
| 301 SkDEBUGCODE(SkImageDecoder *creator = ) CreateJPEGImageDecoder(); | |
| 302 SkASSERT(creator); | |
| 303 SkDEBUGCODE(creator = ) CreateWEBPImageDecoder(); | |
| 304 SkASSERT(creator); | |
| 305 #ifdef SK_BUILD_FOR_UNIX | |
| 306 SkDEBUGCODE(creator = ) CreateGIFImageDecoder(); | |
| 307 SkASSERT(creator); | |
| 308 #endif | |
| 309 } | |
| 310 | |
| 311 #if !defined SK_BUILD_FOR_IOS | 295 #if !defined SK_BUILD_FOR_IOS |
| 312 int main(int argc, char * const argv[]) { | 296 int main(int argc, char * const argv[]) { |
| 313 return tool_main(argc, (char**) argv); | 297 return tool_main(argc, (char**) argv); |
| 314 } | 298 } |
| 315 #endif | 299 #endif |
| OLD | NEW |