Match works correctly on visualbench
authorjoshualitt <joshualitt@chromium.org>
Wed, 15 Jul 2015 15:38:02 +0000 (08:38 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 15 Jul 2015 15:38:02 +0000 (08:38 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1234123004

tools/VisualBench/VisualBenchmarkStream.cpp
tools/VisualBench/VisualBenchmarkStream.h

index 841fb5d..1f16664 100644 (file)
@@ -65,6 +65,15 @@ bool VisualBenchmarkStream::ReadPicture(const char* path, SkAutoTUnref<SkPicture
 }
 
 Benchmark* VisualBenchmarkStream::next() {
+    Benchmark* bench;
+    // skips non matching benches
+    while ((bench = this->innerNext()) &&
+           SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName())) {
+    }
+    return bench;
+}
+
+Benchmark* VisualBenchmarkStream::innerNext() {
     while (fBenches) {
         Benchmark* bench = fBenches->factory()(NULL);
         fBenches = fBenches->next();
index 4c6a1eb..e8d2cbe 100644 (file)
@@ -25,6 +25,8 @@ public:
     Benchmark* next();
 
 private:
+    Benchmark* innerNext();
+
     const BenchRegistry* fBenches;
     const skiagm::GMRegistry* fGMs;
     SkTArray<SkString> fSKPs;