diff options
author | borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-19 17:28:29 +0000 |
---|---|---|
committer | borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-19 17:28:29 +0000 |
commit | 57837bff3db1f8cf22c2147e1bed49cf718f8b39 (patch) | |
tree | 18059a2edd83b9eb73b834a8e5e4f13b136f0202 | |
parent | 2a006c112743e07ce258ca223631fc19233f5ddc (diff) |
Skip empty directories and input files not ending in .skp in *_pictures
Addressing https://code.google.com/p/skia/issues/detail?id=886
Review URL: https://codereview.appspot.com/6531047
git-svn-id: http://skia.googlecode.com/svn/trunk@5597 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | tools/bench_pictures_main.cpp | 12 | ||||
-rw-r--r-- | tools/render_pictures_main.cpp | 16 |
2 files changed, 20 insertions, 8 deletions
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp index 62d89ffc0e..626ee52658 100644 --- a/tools/bench_pictures_main.cpp +++ b/tools/bench_pictures_main.cpp @@ -405,12 +405,18 @@ static int process_input(const SkString& input, do { SkString inputPath; sk_tools::make_filepath(&inputPath, input, inputFilename); - if (!run_single_benchmark(inputPath, benchmark)) + if (!run_single_benchmark(inputPath, benchmark)) { ++failures; + } } while(iter.next(&inputFilename)); - } else { - if (!run_single_benchmark(input, benchmark)) + } else if (SkStrEndsWith(input.c_str(), ".skp")) { + if (!run_single_benchmark(input, benchmark)) { ++failures; + } + } else { + SkString warning; + warning.printf("Warning: skipping %s\n", input.c_str()); + gLogger.logError(warning); } return failures; } diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp index 5ad00729dd..178d9ba432 100644 --- a/tools/render_pictures_main.cpp +++ b/tools/render_pictures_main.cpp @@ -137,13 +137,19 @@ static int process_input(const SkString& input, const SkString& outputDir, do { SkString inputPath; sk_tools::make_filepath(&inputPath, input, inputFilename); - if (!render_picture(inputPath, outputDir, renderer)) - ++failures; + if (!render_picture(inputPath, outputDir, renderer)) { + ++failures; + } } while(iter.next(&inputFilename)); - } else { + } else if (SkStrEndsWith(input.c_str(), ".skp")) { SkString inputPath(input); - if (!render_picture(inputPath, outputDir, renderer)) - ++failures; + if (!render_picture(inputPath, outputDir, renderer)) { + ++failures; + } + } else { + SkString warning; + warning.printf("Warning: skipping %s\n", input.c_str()); + SkDebugf(warning.c_str()); } return failures; } |