| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 * | 6 * |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include <VisualBench/VisualBenchmarkStream.h> | 9 #include <VisualBench/VisualBenchmarkStream.h> |
| 10 #include "GMBench.h" | 10 #include "GMBench.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 pic->reset(SkPicture::CreateFromStream(stream.get())); | 59 pic->reset(SkPicture::CreateFromStream(stream.get())); |
| 60 if (pic->get() == NULL) { | 60 if (pic->get() == NULL) { |
| 61 SkDebugf("Could not read %s as an SkPicture.\n", path); | 61 SkDebugf("Could not read %s as an SkPicture.\n", path); |
| 62 return false; | 62 return false; |
| 63 } | 63 } |
| 64 return true; | 64 return true; |
| 65 } | 65 } |
| 66 | 66 |
| 67 Benchmark* VisualBenchmarkStream::next() { | 67 Benchmark* VisualBenchmarkStream::next() { |
| 68 Benchmark* bench; |
| 69 // skips non matching benches |
| 70 while ((bench = this->innerNext()) && |
| 71 SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName()))
{ |
| 72 } |
| 73 return bench; |
| 74 } |
| 75 |
| 76 Benchmark* VisualBenchmarkStream::innerNext() { |
| 68 while (fBenches) { | 77 while (fBenches) { |
| 69 Benchmark* bench = fBenches->factory()(NULL); | 78 Benchmark* bench = fBenches->factory()(NULL); |
| 70 fBenches = fBenches->next(); | 79 fBenches = fBenches->next(); |
| 71 if (bench->isVisual()) { | 80 if (bench->isVisual()) { |
| 72 fSourceType = "bench"; | 81 fSourceType = "bench"; |
| 73 fBenchType = "micro"; | 82 fBenchType = "micro"; |
| 74 return bench; | 83 return bench; |
| 75 } | 84 } |
| 76 } | 85 } |
| 77 | 86 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 94 } | 103 } |
| 95 | 104 |
| 96 SkString name = SkOSPath::Basename(path.c_str()); | 105 SkString name = SkOSPath::Basename(path.c_str()); |
| 97 fSourceType = "skp"; | 106 fSourceType = "skp"; |
| 98 fBenchType = "playback"; | 107 fBenchType = "playback"; |
| 99 return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get())); | 108 return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get())); |
| 100 } | 109 } |
| 101 | 110 |
| 102 return NULL; | 111 return NULL; |
| 103 } | 112 } |
| OLD | NEW |