}
}
+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;
+}
+
int main (int argc, char * const argv[]) {
SkAutoGraphics ag;
bool doScale = false;
bool doRotate = false;
bool doClip = false;
- const char* matchStr = NULL;
bool hasStrokeWidth = false;
float strokeWidth;
bool useNullGL = false;
+ SkTDArray<const char*> fMatches;
SkString outDir;
SkBitmap::Config outConfig = SkBitmap::kNo_Config;
} else if (strcmp(*argv, "-match") == 0) {
argv++;
if (argv < stop) {
- matchStr = *argv;
+ *fMatches.append() = *argv;
} else {
log_error("missing arg for -match\n");
return -1;
}
// only run benchmarks if their name contains matchStr
- if (matchStr && strstr(bench->getName(), matchStr) == NULL) {
+ if (skip_name(fMatches, bench->getName())) {
continue;
}