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>
This commit is contained in:
Ben Wagner 2017-08-11 17:33:22 -04:00 committed by Skia Commit-Bot
parent 228f761111
commit f28d472bc5

View File

@ -949,7 +949,7 @@ static Sink* create_via(const SkString& tag, Sink* wrapped) {
return nullptr; return nullptr;
} }
static bool gather_sinks(const GrContextOptions& grCtxOptions) { static bool gather_sinks(const GrContextOptions& grCtxOptions, bool defaultConfigs) {
SkCommandLineConfigArray configs; SkCommandLineConfigArray configs;
ParseConfigs(FLAGS_config, &configs); ParseConfigs(FLAGS_config, &configs);
for (int i = 0; i < configs.count(); i++) { 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 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. // If we've been told to ignore undefined flags, we're okay.
FLAGS_undefok || FLAGS_undefok ||
// Otherwise, make sure that all specified configs have become sinks. // Otherwise, make sure that all specified configs have become sinks.
@ -1337,7 +1339,16 @@ int main(int argc, char** argv) {
if (!gather_srcs()) { if (!gather_srcs()) {
return 1; 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; return 1;
} }
gather_tests(); gather_tests();