| 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);
|
|
|