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

Unified Diff: tools/VisualBench/VisualBenchmarkStream.cpp

Issue 1413713006: Wire up configurations properly in VisualBench (Closed) Base URL: https://skia.googlesource.com/skia.git@detachattach
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/VisualFlags.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 906aab27886d44d9fbbaaf6bb6954595b3c33e6d..9940480e0a831d669a1b9fecccee34daf855ab71 100644
--- a/tools/VisualBench/VisualBenchmarkStream.cpp
+++ b/tools/VisualBench/VisualBenchmarkStream.cpp
@@ -14,10 +14,8 @@
#include "SkPictureRecorder.h"
#include "SkStream.h"
#include "sk_tool_utils.h"
-#include "VisualFlags.h"
#include "VisualSKPBench.h"
-DEFINE_bool(cpu, false, "Run in CPU mode?");
DEFINE_string2(match, m, nullptr,
"[~][^]substring[$] [...] of bench name to run.\n"
"Multiple matches may be separated by spaces.\n"
@@ -75,11 +73,6 @@ VisualBenchmarkStream::VisualBenchmarkStream()
}
}
}
-
- // seed with an initial benchmark
- // NOTE the initial benchmark will not have preTimingHooks called, but that is okay because
- // it is the warmupbench
- this->next();
}
bool VisualBenchmarkStream::ReadPicture(const char* path, SkAutoTUnref<SkPicture>* pic) {
@@ -103,7 +96,7 @@ bool VisualBenchmarkStream::ReadPicture(const char* path, SkAutoTUnref<SkPicture
return true;
}
-Benchmark* VisualBenchmarkStream::next() {
+Benchmark* VisualBenchmarkStream::next(Configs::Config config) {
Benchmark* bench;
if (!fIsWarmedUp) {
fIsWarmedUp = true;
@@ -117,11 +110,18 @@ Benchmark* VisualBenchmarkStream::next() {
}
}
- // TODO move this all to --config
- if (bench && FLAGS_cpu) {
- bench = new CpuWrappedBenchmark(bench);
- } else if (bench && FLAGS_nvpr) {
- bench = new NvprWrappedBenchmark(bench, 4);
+ if (bench) {
+ switch (config.fType) {
+ case Configs::Config::kCpu_Type:
+ bench = new CpuWrappedBenchmark(bench);
+ break;
+ case Configs::Config::kNvpr_Type:
+ bench = new NvprWrappedBenchmark(bench, config.fNumSamples);
+ break;
+ default:
+ // These are the only two configs we need to wrap right now
+ break;
+ }
}
fBenchmark.reset(bench);
« no previous file with comments | « tools/VisualBench/VisualBenchmarkStream.h ('k') | tools/VisualBench/VisualFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698