diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-31 16:30:04 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-31 16:30:04 +0000 |
commit | b2a5162f1da657839c542de9a5592a95fe05536d (patch) | |
tree | 8d023d3ad2e131794b037a0bc1d11fe2cf40d5ff /gm | |
parent | 9154eb08ec1f0d51688a6eb55c54111cf6ec5fbb (diff) |
all for multiple --match foo args, which will be logically OR'd together
git-svn-id: http://skia.googlecode.com/svn/trunk@2567 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/gmmain.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 4051feebcd..5269b3405e 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -540,6 +540,20 @@ static const ConfigData gRec[] = { #endif }; +static bool skip_name(const SkTDArray<const char*> array, const char name[]) { + if (0 == array.count()) { + // no names, so don't skip anything + return false; + } + for (int i = 0; i < array.count(); ++i) { + if (strstr(name, array[i])) { + // found the name, so don't skip + return false; + } + } + return true; +} + namespace skiagm { static GrContext* gGrContext; GrContext* GetGr() { @@ -553,8 +567,9 @@ int main(int argc, char * const argv[]) { const char* writePath = NULL; // if non-null, where we write the originals const char* readPath = NULL; // if non-null, were we read from to compare const char* diffPath = NULL; // if non-null, where we write our diffs (from compare) - const char* matchStr = NULL; + SkTDArray<const char*> fMatches; + bool doPDF = true; bool doReplay = true; bool doSerialize = false; @@ -587,7 +602,8 @@ int main(int argc, char * const argv[]) { } else if (strcmp(*argv, "--match") == 0) { ++argv; if (argv < stop && **argv) { - matchStr = *argv; + // just record the ptr, no need for a deep copy + *fMatches.append() = *argv; } #if SK_MESA } else if (strcmp(*argv, "--mesagl") == 0) { @@ -659,7 +675,7 @@ int main(int argc, char * const argv[]) { bool overallSuccess = true; while ((gm = iter.next()) != NULL) { const char* shortName = gm->shortName(); - if (matchStr && !strstr(shortName, matchStr)) { + if (skip_name(fMatches, shortName)) { SkDELETE(gm); continue; } |