diff options
author | 2013-03-20 15:35:08 +0000 | |
---|---|---|
committer | 2013-03-20 15:35:08 +0000 | |
commit | 0f567c6cb6944d0fc1ce18214c3459ba6b23fdf0 (patch) | |
tree | a6be2230be0fe968de852160d7c6ab193ee94cc7 /gm/gmmain.cpp | |
parent | acef3c408216f7ef41bad1532f7946dc067f2bae (diff) |
Write the config options in place in the help string.
Fixes for gm.
Builds on https://codereview.chromium.org/12955002/
Review URL: https://codereview.chromium.org/12663021
git-svn-id: http://skia.googlecode.com/svn/trunk@8256 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/gmmain.cpp')
-rw-r--r-- | gm/gmmain.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 818c7c01ba..9effb25a61 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -990,7 +990,7 @@ static const ConfigData gRec[] = { { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GLContextType, 16, kRW_ConfigFlag, "msaa16", true }, { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GLContextType, 4, kRW_ConfigFlag, "msaa4", false}, /* The debug context does not generate images */ - { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kDebug_GLContextType, 0, kNone_ConfigFlag, "debug", true }, + { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kDebug_GLContextType, 0, kNone_ConfigFlag, "gpudebug", GR_DEBUG}, #if SK_ANGLE { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLContextType, 0, kRW_ConfigFlag, "angle", true }, { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLContextType, 16, kRW_ConfigFlag, "anglemsaa16", true }, @@ -1009,21 +1009,31 @@ static const ConfigData gRec[] = { }; static SkString configUsage() { - SkString result("Possible options for --config: ["); + SkString result; + result.appendf("Space delimited list of which configs to run. Possible options: ["); for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { if (i > 0) { - result.appendf("|"); + result.append("|"); } result.appendf("%s", gRec[i].fName); } - result.appendf("]"); + result.append("]\n"); + result.appendf("The default value is: \""); + for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { + if (gRec[i].fRunByDefault) { + if (i > 0) { + result.append(" "); + } + result.appendf("%s", gRec[i].fName); + } + } + result.appendf("\""); + return result; } // Alphabetized ignoring "no" prefix ("readPath", "noreplay", "resourcePath"). -DEFINE_string(config, "", "Space delimited list of which configs to run. " - "Possible configs listed above. If none are specified, " - "all will be run."); +DEFINE_string(config, "", configUsage().c_str()); DEFINE_bool(deferred, true, "Exercise the deferred rendering test pass."); DEFINE_bool(enableMissingWarning, true, "Print message to stderr (but don't fail) if " "unable to read a reference image for any tests."); @@ -1151,7 +1161,7 @@ int tool_main(int argc, char** argv) { bool userConfig = false; SkString usage; - usage.printf("Run the golden master tests.\n\t%s", configUsage().c_str()); + usage.printf("Run the golden master tests.\n"); SkFlags::SetUsage(usage.c_str()); SkFlags::ParseCommandLine(argc, argv); |