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

Side by Side Diff: tools/test_image_decoder.cpp

Issue 27230002: Runtime configuration setting for suppressing JPEG decoder errors. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 2 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_libjpeg.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 2013 Google Inc. 2 * Copyright 2013 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 "SkForceLinking.h" 9 #include "SkForceLinking.h"
10 #include "SkGraphics.h" 10 #include "SkGraphics.h"
11 #include "SkImageDecoder.h" 11 #include "SkImageDecoder.h"
12 12
13 __SK_FORCE_IMAGE_DECODER_LINKING; 13 __SK_FORCE_IMAGE_DECODER_LINKING;
14 14
15 /** 15 /**
16 Simple program to test Skia's ability to decode images without 16 Simple program to test Skia's ability to decode images without
17 errors or debug messages. */ 17 errors or debug messages. */
18 int tool_main(int argc, char** argv); 18 int tool_main(int argc, char** argv);
19 int tool_main(int argc, char** argv) { 19 int tool_main(int argc, char** argv) {
20 if (argc < 2) { 20 if (argc < 2) {
21 SkDebugf("Usage:\n %s imagefile\n\n", argv[0]); 21 SkDebugf("Usage:\n %s imagefile\n\n", argv[0]);
22 return 3; 22 return 3;
23 } 23 }
24 SkAutoGraphics ag; // Enable use of SkRTConfig
24 SkBitmap bitmap; 25 SkBitmap bitmap;
25 if (!(SkImageDecoder::DecodeFile(argv[1], &bitmap))) { 26 if (!(SkImageDecoder::DecodeFile(argv[1], &bitmap))) {
26 return 2; 27 return 2;
27 } 28 }
28 if (bitmap.empty()) { 29 if (bitmap.empty()) {
29 return 1; 30 return 1;
30 } 31 }
31 return 0; 32 return 0;
32 } 33 }
33 34
34 #if !defined SK_BUILD_FOR_IOS 35 #if !defined SK_BUILD_FOR_IOS
35 int main(int argc, char * const argv[]) { 36 int main(int argc, char * const argv[]) {
36 return tool_main(argc, (char**) argv); 37 return tool_main(argc, (char**) argv);
37 } 38 }
38 #endif 39 #endif
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libjpeg.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698