aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/nanobench.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-12-06 10:47:03 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-06 16:12:09 +0000
commite45ff46a6587ac0e481a62a85cc42b1a0865d856 (patch)
tree201feec7f0a7e464ce4e88b03711a7a507956baf /bench/nanobench.cpp
parent2a3985e98d50ddfbec4d3a8fe53cc513a3c2d329 (diff)
add benchType deserial to time deserializing pictures
Piece of the larger effort to merge readbuffer and validatingreadbuffer Bug: skia: Change-Id: I79305e27c4712c3b91d213d09d6c2ef24b86e671 Reviewed-on: https://skia-review.googlesource.com/81120 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'bench/nanobench.cpp')
-rw-r--r--bench/nanobench.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 550e0b7744..d475e164e5 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -607,6 +607,7 @@ public:
, fGMs(skiagm::GMRegistry::Head())
, fCurrentRecording(0)
, fCurrentPiping(0)
+ , fCurrentDeserialPicture(0)
, fCurrentScale(0)
, fCurrentSKP(0)
, fCurrentSVG(0)
@@ -765,6 +766,21 @@ public:
return new PipingBench(name.c_str(), pic.get());
}
+ // Add all .skps as DeserializePictureBenchs.
+ while (fCurrentDeserialPicture < fSKPs.count()) {
+ const SkString& path = fSKPs[fCurrentDeserialPicture++];
+ sk_sp<SkData> data = SkData::MakeFromFileName(path.c_str());
+ if (!data) {
+ continue;
+ }
+ SkString name = SkOSPath::Basename(path.c_str());
+ fSourceType = "skp";
+ fBenchType = "deserial";
+ fSKPBytes = static_cast<double>(data->size());
+ fSKPOps = 0;
+ return new DeserializePictureBench(name.c_str(), std::move(data));
+ }
+
// Then once each for each scale as SKPBenches (playback).
while (fCurrentScale < fScales.count()) {
while (fCurrentSKP < fSKPs.count()) {
@@ -1091,6 +1107,7 @@ private:
const char* fBenchType; // How we bench it: micro, recording, playback, ...
int fCurrentRecording;
int fCurrentPiping;
+ int fCurrentDeserialPicture;
int fCurrentScale;
int fCurrentSKP;
int fCurrentSVG;