From f28d472bc5f0fff813423ab670072a83f16dab93 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Fri, 11 Aug 2017 17:33:22 -0400 Subject: 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 Commit-Queue: Ben Wagner --- dm/DM.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'dm/DM.cpp') diff --git a/dm/DM.cpp b/dm/DM.cpp index 6d35391de7..0644cc0d7d 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -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(); -- cgit v1.2.3