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

Unified Diff: tools/bench_playback.cpp

Issue 344213003: Move BenchTimer to tools as Timer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixes 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
Index: tools/bench_playback.cpp
diff --git a/tools/bench_playback.cpp b/tools/bench_playback.cpp
index 26fa1c7ee8dfa595680808f7dcb5858c7cf911b5..6ebe19d36f78e72da44b6510e96ab7bc7a08e103 100644
--- a/tools/bench_playback.cpp
+++ b/tools/bench_playback.cpp
@@ -16,10 +16,8 @@
#include "../include/record/SkRecording.h"
-#include "BenchTimer.h"
#include "Stats.h"
-
-typedef WallTimer Timer;
+#include "Timer.h"
__SK_FORCE_IMAGE_DECODER_LINKING;
@@ -78,15 +76,16 @@ static void bench(SkPMColor* scratch, SkPicture& src, const char* name) {
// Draw once to warm any caches. The first sample otherwise can be very noisy.
draw(*record, *picture, canvas.get());
- Timer timer;
+ WallTimer timer;
+ const double scale = timescale();
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(timescale());
+ timer.start();
draw(*record, *picture, canvas.get());
timer.end();
- samples[i] = timer.fWall;
+ samples[i] = timer.fWall * scale;
}
Stats stats(samples.get(), FLAGS_samples);
« no previous file with comments | « tools/bench_pictures_main.cpp ('k') | tools/bench_record.cpp » ('j') | tools/timer/GpuTimer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698