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 <VisualBench/WrappedBenchmark.h> | 10 #include <VisualBench/WrappedBenchmark.h> |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 while ((bench = this->innerNext()) && | 124 while ((bench = this->innerNext()) && |
125 (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName
()) || | 125 (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName
()) || |
126 !bench->isSuitableFor(Benchmark::kGPU_Backend))) { | 126 !bench->isSuitableFor(Benchmark::kGPU_Backend))) { |
127 bench->unref(); | 127 bench->unref(); |
128 } | 128 } |
129 } | 129 } |
130 | 130 |
131 // TODO move this all to --config | 131 // TODO move this all to --config |
132 if (bench && FLAGS_cpu) { | 132 if (bench && FLAGS_cpu) { |
133 bench = new CpuWrappedBenchmark(fSurfaceProps, bench); | 133 bench = new CpuWrappedBenchmark(fSurfaceProps, bench); |
134 } else if (bench && FLAGS_nvpr) { | 134 } else if (bench && 0 != FLAGS_nvpr) { |
135 bench = new NvprWrappedBenchmark(fSurfaceProps, bench, 4); | 135 bench = new NvprWrappedBenchmark(fSurfaceProps, bench, FLAGS_nvpr); |
136 } | 136 } |
137 | 137 |
138 fBenchmark.reset(bench); | 138 fBenchmark.reset(bench); |
139 return fBenchmark; | 139 return fBenchmark; |
140 } | 140 } |
141 | 141 |
142 Benchmark* VisualBenchmarkStream::innerNext() { | 142 Benchmark* VisualBenchmarkStream::innerNext() { |
143 while (fBenches) { | 143 while (fBenches) { |
144 Benchmark* bench = fBenches->factory()(nullptr); | 144 Benchmark* bench = fBenches->factory()(nullptr); |
145 fBenches = fBenches->next(); | 145 fBenches = fBenches->next(); |
(...skipping 24 matching lines...) Expand all Loading... |
170 } | 170 } |
171 | 171 |
172 SkString name = SkOSPath::Basename(path.c_str()); | 172 SkString name = SkOSPath::Basename(path.c_str()); |
173 fSourceType = "skp"; | 173 fSourceType = "skp"; |
174 fBenchType = "playback"; | 174 fBenchType = "playback"; |
175 return new VisualSKPBench(name.c_str(), pic.get()); | 175 return new VisualSKPBench(name.c_str(), pic.get()); |
176 } | 176 } |
177 | 177 |
178 return nullptr; | 178 return nullptr; |
179 } | 179 } |
OLD | NEW |