DM: move --match check earlier to fix the "N GMs x M configs" log line.
BUG=
R=bsalomon@google.com
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/44443002
git-svn-id: http://skia.googlecode.com/svn/trunk@11963 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/dm/DM.cpp b/dm/DM.cpp
index aca4986..8c30fe6 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -84,9 +84,6 @@
#endif
for (int i = 0; i < gms.count(); i++) {
- SkAutoTDelete<GM> gmForName(gms[i](NULL));
- if (SkCommandLineFlags::ShouldSkip(FLAGS_match, gmForName->shortName())) continue;
-
#define START(name, type, ...) \
if (lowercase(configs[j]).equals(name)) { \
tasks->add(SkNEW_ARGS(DM::type, \
@@ -142,7 +139,10 @@
SkTDArray<GMRegistry::Factory> gms;
for (const GMRegistry* reg = GMRegistry::Head(); reg != NULL; reg = reg->next()) {
- *gms.append() = reg->factory();
+ SkAutoTDelete<GM> gmForName(reg->factory()(NULL));
+ if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, gmForName->shortName())) {
+ *gms.append() = reg->factory();
+ }
}
SkDebugf("%d GMs x %d configs\n", gms.count(), configs.count());