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

Unified Diff: bench/benchmain.cpp

Issue 376643002: gpu and cpu flags for gm and bench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix indentation Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gm/gmmain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/benchmain.cpp
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index 3a9f0c2a465c1b230ce45148a1451d0d45502a64..c1c1e3fb0cbfda59471407f573dddfe7b6e7391e 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;
« no previous file with comments | « no previous file | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698