aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DM.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <benjaminwagner@google.com>2017-08-10 21:25:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-11 13:12:26 +0000
commit32fa5104148722dbd6aac1ce8d38dcf47737f669 (patch)
tree4d73d23cacb1fed26a1d6bd4653b4e92dc7df3d8 /dm/DM.cpp
parent6d3af6faa23a931be1404cd3fcba02a3c271151c (diff)
Abort dm/nanobench on bad configs.
Adjust the configs specified by recipes to avoid the new error. Change-Id: I23e31355e2faaab919d92abdb37a6f70cd2da1ff Reviewed-on: https://skia-review.googlesource.com/32862 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.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 11527bfdaf..6d35391de7 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -60,6 +60,7 @@ extern void SkPDFImageDumpStats();
extern bool gSkForceRasterPipelineBlitter;
+DECLARE_bool(undefok);
DEFINE_string(src, "tests gm skp image", "Source types to test.");
DEFINE_bool(nameByHash, false,
"If true, write to FLAGS_writePath[0]/<hash>.png instead of "
@@ -979,9 +980,15 @@ static bool gather_sinks(const GrContextOptions& grCtxOptions) {
}
// If no configs were requested (just running tests, perhaps?), then we're okay.
- // Otherwise, make sure that at least one sink was constructed correctly. This catches
- // the case of bots without a GPU being assigned GPU configs.
- return (configs.count() == 0) || (gSinks.count() > 0);
+ if (configs.count() == 0 || FLAGS_config.count() == 0 ||
+ // If we've been told to ignore undefined flags, we're okay.
+ FLAGS_undefok ||
+ // Otherwise, make sure that all specified configs have become sinks.
+ configs.count() == gSinks.count()) {
+ return true;
+ }
+ info("Invalid --config. Use --undefok to bypass this warning.\n");
+ return false;
}
static bool dump_png(SkBitmap bitmap, const char* path, const char* md5) {