| Index: bench/nanobench.cpp
|
| diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
|
| index b7603bf3bcd1925ad30bf7ba05cbdfc229372d67..7088312146c1f9c25b8f309fd0043584c78529f2 100644
|
| --- a/bench/nanobench.cpp
|
| +++ b/bench/nanobench.cpp
|
| @@ -24,6 +24,7 @@
|
| #include "SkGraphics.h"
|
| #include "SkOSFile.h"
|
| #include "SkPictureRecorder.h"
|
| +#include "SkPictureUtils.h"
|
| #include "SkString.h"
|
| #include "SkSurface.h"
|
| #include "SkTaskGroup.h"
|
| @@ -524,6 +525,8 @@ public:
|
| SkString name = SkOSPath::Basename(path.c_str());
|
| fSourceType = "skp";
|
| fBenchType = "recording";
|
| + fSKPBytes = SkPictureUtils::ApproximateBytesUsed(pic);
|
| + fSKPOps = pic->approximateOpCount();
|
| return SkNEW_ARGS(RecordingBench, (name.c_str(), pic.get(), FLAGS_bbh));
|
| }
|
|
|
| @@ -578,6 +581,10 @@ public:
|
| log->configOption("multi_picture_draw", fUseMPDs[fCurrentUseMPD-1] ? "true" : "false");
|
| }
|
| }
|
| + if (0 == strcmp(fBenchType, "recording")) {
|
| + log->metric("bytes", fSKPBytes);
|
| + log->metric("ops", fSKPOps);
|
| + }
|
| }
|
|
|
| private:
|
| @@ -588,6 +595,8 @@ private:
|
| SkTArray<SkString> fSKPs;
|
| SkTArray<bool> fUseMPDs;
|
|
|
| + double fSKPBytes, fSKPOps;
|
| +
|
| const char* fSourceType; // What we're benching: bench, GM, SKP, ...
|
| const char* fBenchType; // How we bench it: micro, recording, playback, ...
|
| int fCurrentRecording;
|
| @@ -724,11 +733,11 @@ int nanobench_main() {
|
| fill_gpu_options(log.get(), targets[j]->gl);
|
| }
|
| #endif
|
| - log->timer("min_ms", stats.min);
|
| - log->timer("median_ms", stats.median);
|
| - log->timer("mean_ms", stats.mean);
|
| - log->timer("max_ms", stats.max);
|
| - log->timer("stddev_ms", sqrt(stats.var));
|
| + log->metric("min_ms", stats.min);
|
| + log->metric("median_ms", stats.median);
|
| + log->metric("mean_ms", stats.mean);
|
| + log->metric("max_ms", stats.max);
|
| + log->metric("stddev_ms", sqrt(stats.var));
|
| if (runs++ % FLAGS_flushEvery == 0) {
|
| log->flush();
|
| }
|
|
|