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

Unified Diff: gm/gmmain.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 | « bench/benchmain.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 96a3454becfefdee39577d5cb1d9b6db3b1eeb81..d4ec45eb9b262c326f255ef9f9e5ee3c0bec3f02 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -1423,6 +1423,7 @@ static SkString pdfRasterizerUsage() {
// Alphabetized ignoring "no" prefix ("readPath", "noreplay", "resourcePath").
DEFINE_string(config, "", configUsage().c_str());
+DEFINE_bool(cpu, true, "Allows non-GPU configs to be run. Applied after --config.");
DEFINE_string(pdfRasterizers, "default", pdfRasterizerUsage().c_str());
DEFINE_bool(deferred, false, "Exercise the deferred rendering test pass.");
DEFINE_bool(dryRun, false, "Don't actually run the tests, just print what would have been done.");
@@ -1436,6 +1437,7 @@ DEFINE_string(gpuAPI, "", "Force use of specific gpu API. Using \"gl\" "
DEFINE_string(gpuCacheSize, "", "<bytes> <count>: Limit the gpu cache to byte size or "
"object count. " TOSTRING(DEFAULT_CACHE_VALUE) " for either value means "
"use the default. 0 for either disables the cache.");
+DEFINE_bool(gpu, true, "Allows GPU configs to be run. Applied after --config.");
#endif
DEFINE_bool(hierarchy, false, "Whether to use multilevel directory structure "
"when reading/writing files.");
@@ -2000,11 +2002,24 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs,
}
}
-#if SK_SUPPORT_GPU
- SkASSERT(grFactory != NULL);
for (int i = 0; i < outConfigs->count(); ++i) {
size_t index = (*outConfigs)[i];
if (kGPU_Backend == gRec[index].fBackend) {
+#if SK_SUPPORT_GPU
+ if (!FLAGS_gpu) {
+ outConfigs->remove(i);
+ --i;
+ continue;
+ }
+#endif
+ } else if (!FLAGS_cpu) {
+ outConfigs->remove(i);
+ --i;
+ continue;
+ }
+#if SK_SUPPORT_GPU
+ SkASSERT(grFactory != NULL);
+ if (kGPU_Backend == gRec[index].fBackend) {
GrContext* ctx = grFactory->get(gRec[index].fGLContextType, gpuAPI);
if (NULL == ctx) {
SkDebugf("GrContext could not be created for config %s. Config will be skipped.\n",
@@ -2021,8 +2036,8 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs,
--i;
}
}
- }
#endif
+ }
if (outConfigs->isEmpty()) {
SkDebugf("No configs to run.");
« no previous file with comments | « bench/benchmain.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698