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

Unified Diff: bench/nanobench.cpp

Issue 1666743002: Add --benchType and --sourceType to nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index c2bcb4950ac6b6ac6f5896412deb3cb8ccf44fee..7b3756267cbfc066804471e75813fa358c98a90b 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -112,6 +112,11 @@ DEFINE_bool(gpuStats, false, "Print GPU stats after each gpu benchmark?");
DEFINE_bool(gpuStatsDump, false, "Dump GPU states after each benchmark to json");
DEFINE_bool(keepAlive, false, "Print a message every so often so that we don't time out");
+DEFINE_string(sourceType, "",
+ "Apply usual --match rules to source type: bench, gm, skp, image, etc.");
+DEFINE_string(benchType, "",
+ "Apply usual --match rules to bench type: micro, recording, playback, skcodec, etc.");
+
static double now_ms() { return SkTime::GetNSecs() * 1e-6; }
static SkString humanize(double ms) {
@@ -628,6 +633,18 @@ public:
}
Benchmark* next() {
+ SkAutoTDelete<Benchmark> bench;
+ do {
+ bench.reset(this->rawNext());
+ if (!bench) {
+ return nullptr;
+ }
+ } while(SkCommandLineFlags::ShouldSkip(FLAGS_sourceType, fSourceType) ||
+ SkCommandLineFlags::ShouldSkip(FLAGS_benchType, fBenchType));
+ return bench.detach();
+ }
+
+ Benchmark* rawNext() {
if (fBenches) {
Benchmark* bench = fBenches->factory()(nullptr);
fBenches = fBenches->next();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698