Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: tools/skimage_main.cpp

Issue 14678003: Force linking with image decoders for images project. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: respond to comment Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698