From f9d0c95d8ddc2bca7952828201ac369c202bb36b Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Thu, 7 Feb 2013 16:21:22 +0000 Subject: Temporary patch to BenchPictures gpu timing problem https://codereview.appspot.com/7311059/ git-svn-id: http://skia.googlecode.com/svn/trunk@7641 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tools/PictureBenchmark.cpp | 8 ++++---- tools/PictureBenchmark.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/PictureBenchmark.cpp b/tools/PictureBenchmark.cpp index f1be2aafeb..8c1a6ccbab 100644 --- a/tools/PictureBenchmark.cpp +++ b/tools/PictureBenchmark.cpp @@ -34,9 +34,9 @@ PictureBenchmark::~PictureBenchmark() { SkSafeUnref(fRenderer); } -BenchTimer* PictureBenchmark::setupTimer() { +BenchTimer* PictureBenchmark::setupTimer(bool useGLTimer) { #if SK_SUPPORT_GPU - if (fRenderer != NULL && fRenderer->isUsingGpuDevice()) { + if (useGLTimer && fRenderer != NULL && fRenderer->isUsingGpuDevice()) { return SkNEW_ARGS(BenchTimer, (fRenderer->getGLContext())); } #endif @@ -104,10 +104,10 @@ void PictureBenchmark::run(SkPicture* pict) { // // 2) perTileTimer, along with perTileTimerData, will record each run separately, and // then take the average. As such, it supports logPerIter and printMin options. - SkAutoTDelete longRunningTimer(this->setupTimer()); + SkAutoTDelete longRunningTimer(this->setupTimer(false)); TimerData longRunningTimerData(tiledRenderer->getPerIterTimeFormat(), tiledRenderer->getNormalTimeFormat()); - SkAutoTDelete perTileTimer(this->setupTimer()); + SkAutoTDelete perTileTimer(this->setupTimer(false)); TimerData perTileTimerData(tiledRenderer->getPerIterTimeFormat(), tiledRenderer->getNormalTimeFormat()); longRunningTimer->start(); diff --git a/tools/PictureBenchmark.h b/tools/PictureBenchmark.h index af81f69717..01b4e1d886 100644 --- a/tools/PictureBenchmark.h +++ b/tools/PictureBenchmark.h @@ -80,7 +80,7 @@ private: void logProgress(const char msg[]); - BenchTimer* setupTimer(); + BenchTimer* setupTimer(bool useGLTimer = true); }; } -- cgit v1.2.3