diff options
author | Ben Wagner <benjaminwagner@google.com> | 2017-08-11 17:33:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-14 14:27:25 +0000 |
commit | f28d472bc5f0fff813423ab670072a83f16dab93 (patch) | |
tree | 3d1407e27320b14b4b26004c15ec7618391a6b31 /dm/DM.cpp | |
parent | 228f761111ea4c914dc11fc5523bdabc5eca7ffc (diff) |
Fix dm when --config not specified.
Broken by https://skia-review.googlesource.com/c/32862.
Change-Id: I711057da08793902b50e98b67af9107ac9ead8d2
Reviewed-on: https://skia-review.googlesource.com/33663
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Diffstat (limited to 'dm/DM.cpp')
-rw-r--r-- | dm/DM.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -949,7 +949,7 @@ static Sink* create_via(const SkString& tag, Sink* wrapped) { return nullptr; } -static bool gather_sinks(const GrContextOptions& grCtxOptions) { +static bool gather_sinks(const GrContextOptions& grCtxOptions, bool defaultConfigs) { SkCommandLineConfigArray configs; ParseConfigs(FLAGS_config, &configs); for (int i = 0; i < configs.count(); i++) { @@ -980,7 +980,9 @@ static bool gather_sinks(const GrContextOptions& grCtxOptions) { } // If no configs were requested (just running tests, perhaps?), then we're okay. - if (configs.count() == 0 || FLAGS_config.count() == 0 || + if (configs.count() == 0 || + // If we're using the default configs, we're okay. + defaultConfigs || // If we've been told to ignore undefined flags, we're okay. FLAGS_undefok || // Otherwise, make sure that all specified configs have become sinks. @@ -1337,7 +1339,16 @@ int main(int argc, char** argv) { if (!gather_srcs()) { return 1; } - if (!gather_sinks(grCtxOptions)) { + // TODO(dogben): This is a bit ugly. Find a cleaner way to do this. + bool defaultConfigs = true; + for (int i = 0; i < argc; i++) { + static const char* kConfigArg = "--config"; + if (strcmp(argv[i], kConfigArg) == 0) { + defaultConfigs = false; + break; + } + } + if (!gather_sinks(grCtxOptions, defaultConfigs)) { return 1; } gather_tests(); |