diff options
author | bsalomon <bsalomon@google.com> | 2014-07-07 10:46:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-07-07 10:46:59 -0700 |
commit | 69456186f723b260be6cfa2ac2aa245f860841cb (patch) | |
tree | 3adfcd2f3f8ae45327caa879d6725b5f3fcf31af /bench | |
parent | 81d71885f13ba69afb414e600180b36354b923fd (diff) |
gpu and cpu flags for gm and bench.
BUG=skia:2074
R=borenet@google.com, mtklein@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/376643002
Diffstat (limited to 'bench')
-rw-r--r-- | bench/benchmain.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp index 3a9f0c2a46..c1c1e3fb0c 100644 --- a/bench/benchmain.cpp +++ b/bench/benchmain.cpp @@ -237,6 +237,9 @@ DEFINE_string(gpuAPI, "", "Force use of specific gpu API. Using \"gl\" " DEFINE_int32(gpuCacheBytes, -1, "GPU cache size limit in bytes. 0 to disable cache."); DEFINE_int32(gpuCacheCount, -1, "GPU cache size limit in object count. 0 to disable cache."); +DEFINE_bool(gpu, true, "Allows GPU configs to be run. Applied after --configs."); +DEFINE_bool(cpu, true, "Allows non-GPU configs to be run. Applied after --config."); + DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects."); DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" "Multiple matches may be separated by spaces.\n" @@ -353,6 +356,19 @@ int tool_main(int argc, char** argv) { } } } + // Apply the gpu/cpu only flags + for (int i = 0; i < configs.count(); ++i) { + const Config& config = gConfigs[configs[i]]; + if (config.backend == Benchmark::kGPU_Backend) { + if (!FLAGS_gpu) { + configs.remove(i, 1); + --i; + } + } else if (!FLAGS_cpu) { + configs.remove(i, 1); + --i; + } + } #if SK_SUPPORT_GPU GrGLStandard gpuAPI = kNone_GrGLStandard; |