Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1020)

Unified Diff: tools/VisualBench/VisualBenchmarkStream.cpp

Issue 1392833006: Revert of small tidy of benchmarkstream (Closed) Base URL: https://skia.googlesource.com/skia.git@vb4b
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/VisualBench/VisualBenchmarkStream.h ('k') | tools/VisualBench/VisualStreamTimingModule.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualBenchmarkStream.cpp
diff --git a/tools/VisualBench/VisualBenchmarkStream.cpp b/tools/VisualBench/VisualBenchmarkStream.cpp
index 49bafbfceece254481e2a8a92e1196ba7656baa8..c520eeed05510f6197152a4844f8d2cc1f72d81a 100644
--- a/tools/VisualBench/VisualBenchmarkStream.cpp
+++ b/tools/VisualBench/VisualBenchmarkStream.cpp
@@ -74,9 +74,6 @@
}
}
}
-
- // seed with an initial benchmark
- this->next();
}
bool VisualBenchmarkStream::ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) {
@@ -101,24 +98,23 @@
}
Benchmark* VisualBenchmarkStream::next() {
- Benchmark* bench;
if (!fIsWarmedUp) {
fIsWarmedUp = true;
- bench = new WarmupBench;
- } else {
- // skips non matching benches
- while ((bench = this->innerNext()) &&
- (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName()) ||
- !bench->isSuitableFor(Benchmark::kGPU_Backend))) {
- bench->unref();
- }
- }
- if (bench && FLAGS_cpu) {
- bench = new CpuWrappedBenchmark(bench);
+ return new WarmupBench;
}
- fBenchmark.reset(bench);
- return fBenchmark;
+ Benchmark* bench;
+
+ // skips non matching benches
+ while ((bench = this->innerNext()) &&
+ (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getUniqueName()) ||
+ !bench->isSuitableFor(Benchmark::kGPU_Backend))) {
+ bench->unref();
+ }
+ if (FLAGS_cpu) {
+ return new CpuWrappedBenchmark(bench);
+ }
+ return bench;
}
Benchmark* VisualBenchmarkStream::innerNext() {
« no previous file with comments | « tools/VisualBench/VisualBenchmarkStream.h ('k') | tools/VisualBench/VisualStreamTimingModule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698