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

Unified Diff: tools/bench_playback.cpp

Issue 346753003: Revert of Move BenchTimer to tools as Timer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « tools/bench_pictures_main.cpp ('k') | tools/bench_record.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_playback.cpp
diff --git a/tools/bench_playback.cpp b/tools/bench_playback.cpp
index 6ebe19d36f78e72da44b6510e96ab7bc7a08e103..26fa1c7ee8dfa595680808f7dcb5858c7cf911b5 100644
--- a/tools/bench_playback.cpp
+++ b/tools/bench_playback.cpp
@@ -16,8 +16,10 @@
#include "../include/record/SkRecording.h"
+#include "BenchTimer.h"
#include "Stats.h"
-#include "Timer.h"
+
+typedef WallTimer Timer;
__SK_FORCE_IMAGE_DECODER_LINKING;
@@ -76,16 +78,15 @@
// Draw once to warm any caches. The first sample otherwise can be very noisy.
draw(*record, *picture, canvas.get());
- WallTimer timer;
- const double scale = timescale();
+ Timer timer;
SkAutoTMalloc<double> samples(FLAGS_samples);
for (int i = 0; i < FLAGS_samples; i++) {
// We assume timer overhead (typically, ~30ns) is insignificant
// compared to draw runtime (at least ~100us, usually several ms).
- timer.start();
+ timer.start(timescale());
draw(*record, *picture, canvas.get());
timer.end();
- samples[i] = timer.fWall * scale;
+ samples[i] = timer.fWall;
}
Stats stats(samples.get(), FLAGS_samples);
« no previous file with comments | « tools/bench_pictures_main.cpp ('k') | tools/bench_record.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698