diff options
author | 2013-10-16 18:36:49 +0000 | |
---|---|---|
committer | 2013-10-16 18:36:49 +0000 | |
commit | cbbf1ca304d35e3acd944609cf7a1c5127d0ca56 (patch) | |
tree | 65ae91615007755eb46e2c067cda524b48976e69 /tools/skpdiff/skpdiff_main.cpp | |
parent | 9cf0cb169bda63ad50f4c394739deb6c67003647 (diff) |
add initial support ofr multi-threaded execution
Review URL: https://codereview.chromium.org/27541003
git-svn-id: http://skia.googlecode.com/svn/trunk@11823 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/skpdiff/skpdiff_main.cpp')
-rw-r--r-- | tools/skpdiff/skpdiff_main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/skpdiff/skpdiff_main.cpp b/tools/skpdiff/skpdiff_main.cpp index f89cc372c5..55640f7f0a 100644 --- a/tools/skpdiff/skpdiff_main.cpp +++ b/tools/skpdiff/skpdiff_main.cpp @@ -40,6 +40,7 @@ DEFINE_string2(patterns, p, "", "Use two patterns to compare images: <baseline> DEFINE_string2(output, o, "", "Writes the output of these diffs to output: <output>"); DEFINE_bool(jsonp, true, "Output JSON with padding"); DEFINE_string(csv, "", "Writes the output of these diffs to a csv file"); +DEFINE_int32(threads, -1, "run N threads in parallel [default is derived from CPUs available]"); #if SK_SUPPORT_OPENCL /// A callback for any OpenCL errors @@ -188,6 +189,10 @@ int tool_main(int argc, char * argv[]) { SkDiffContext ctx; ctx.setDiffers(chosenDiffers); + if (FLAGS_threads >= 0) { + ctx.setThreadCount(FLAGS_threads); + } + // Perform a folder diff if one is requested if (!FLAGS_folders.isEmpty()) { ctx.diffDirectories(FLAGS_folders[0], FLAGS_folders[1]); |