Added second "truncated" cpu/wall timer to bench
http://codereview.appspot.com/6476064/
This CL will increase the bench baselines across the board
git-svn-id: http://skia.googlecode.com/svn/trunk@5305 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/BenchTimer.cpp b/bench/BenchTimer.cpp
index 8ac08a7..4e04844 100644
--- a/bench/BenchTimer.cpp
+++ b/bench/BenchTimer.cpp
@@ -23,9 +23,12 @@
BenchTimer::BenchTimer(SkGLContext* gl)
: fCpu(-1.0)
, fWall(-1.0)
+ , fTruncatedCpu(-1.0)
+ , fTruncatedWall(-1.0)
, fGpu(-1.0)
{
fSysTimer = new BenchSysTimer();
+ fTruncatedSysTimer = new BenchSysTimer();
#if SK_SUPPORT_GPU
if (gl) {
fGpuTimer = new BenchGpuTimer(gl);
@@ -37,6 +40,7 @@
BenchTimer::~BenchTimer() {
delete fSysTimer;
+ delete fTruncatedSysTimer;
#if SK_SUPPORT_GPU
delete fGpuTimer;
#endif
@@ -44,12 +48,14 @@
void BenchTimer::start() {
fSysTimer->startWall();
+ fTruncatedSysTimer->startWall();
#if SK_SUPPORT_GPU
if (fGpuTimer) {
fGpuTimer->startGpu();
}
#endif
fSysTimer->startCpu();
+ fTruncatedSysTimer->startCpu();
}
void BenchTimer::end() {
@@ -63,3 +69,8 @@
#endif
fWall = fSysTimer->endWall();
}
+
+void BenchTimer::truncatedEnd() {
+ fTruncatedCpu = fTruncatedSysTimer->endCpu();
+ fTruncatedWall = fTruncatedSysTimer->endWall();
+}