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; | |
robertphillips
2015/07/15 15:25:40
// skip non-matching benchs
?
| |
69 while ((bench = this->innerNext()) && | |
robertphillips
2015/07/15 15:25:40
Maybe put the '}' on its own line ?
| |
70 SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName())) {} | |
71 return bench; | |
72 } | |
73 | |
74 Benchmark* VisualBenchmarkStream::innerNext() { | |
68 while (fBenches) { | 75 while (fBenches) { |
69 Benchmark* bench = fBenches->factory()(NULL); | 76 Benchmark* bench = fBenches->factory()(NULL); |
70 fBenches = fBenches->next(); | 77 fBenches = fBenches->next(); |
71 if (bench->isVisual()) { | 78 if (bench->isVisual()) { |
72 fSourceType = "bench"; | 79 fSourceType = "bench"; |
73 fBenchType = "micro"; | 80 fBenchType = "micro"; |
74 return bench; | 81 return bench; |
75 } | 82 } |
76 } | 83 } |
77 | 84 |
(...skipping 16 matching lines...) Expand all Loading... | |
94 } | 101 } |
95 | 102 |
96 SkString name = SkOSPath::Basename(path.c_str()); | 103 SkString name = SkOSPath::Basename(path.c_str()); |
97 fSourceType = "skp"; | 104 fSourceType = "skp"; |
98 fBenchType = "playback"; | 105 fBenchType = "playback"; |
99 return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get())); | 106 return SkNEW_ARGS(VisualSKPBench, (name.c_str(), pic.get())); |
100 } | 107 } |
101 | 108 |
102 return NULL; | 109 return NULL; |
103 } | 110 } |
OLD | NEW |