aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/nanobench.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-10-21 10:43:36 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-21 15:02:45 +0000
commit9cdd2abc30520d6f425afbc2d7bd7b15f8b11ba1 (patch)
tree28058f1be6281ef93e6ecbe7f30bb7334ba4eef6 /bench/nanobench.cpp
parenta9f64dec63b6f4169ba16f8b6c63fff5a6494029 (diff)
add pipe to nanobench
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3801 Change-Id: Ia0b90b1e2947a7b9ae7cb340ef5cd5b3251bbd23 Reviewed-on: https://skia-review.googlesource.com/3801 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'bench/nanobench.cpp')
-rw-r--r--bench/nanobench.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index e929a8069f..6a0fb0445b 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -126,7 +126,7 @@ DEFINE_string(useThermalManager, "0,1,10,1000", "enabled,threshold,sleepTimeMs,T
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.");
+ "Apply usual --match rules to bench type: micro, recording, piping, playback, skcodec, etc.");
static double now_ms() { return SkTime::GetNSecs() * 1e-6; }
@@ -583,6 +583,7 @@ public:
BenchmarkStream() : fBenches(BenchRegistry::Head())
, fGMs(skiagm::GMRegistry::Head())
, fCurrentRecording(0)
+ , fCurrentPiping(0)
, fCurrentScale(0)
, fCurrentSKP(0)
, fCurrentSVG(0)
@@ -727,6 +728,21 @@ public:
return new RecordingBench(name.c_str(), pic.get(), FLAGS_bbh, FLAGS_lite);
}
+ // Add all .skps as PipeBenches.
+ while (fCurrentPiping < fSKPs.count()) {
+ const SkString& path = fSKPs[fCurrentPiping++];
+ sk_sp<SkPicture> pic = ReadPicture(path.c_str());
+ if (!pic) {
+ continue;
+ }
+ SkString name = SkOSPath::Basename(path.c_str());
+ fSourceType = "skp";
+ fBenchType = "piping";
+ fSKPBytes = static_cast<double>(SkPictureUtils::ApproximateBytesUsed(pic.get()));
+ fSKPOps = pic->approximateOpCount();
+ return new PipingBench(name.c_str(), pic.get());
+ }
+
// Then once each for each scale as SKPBenches (playback).
while (fCurrentScale < fScales.count()) {
while (fCurrentSKP < fSKPs.count()) {
@@ -1057,6 +1073,7 @@ private:
const char* fSourceType; // What we're benching: bench, GM, SKP, ...
const char* fBenchType; // How we bench it: micro, recording, playback, ...
int fCurrentRecording;
+ int fCurrentPiping;
int fCurrentScale;
int fCurrentSKP;
int fCurrentSVG;