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

Unified Diff: tools/PictureBenchmark.cpp

Issue 113873005: Make bench_pictures' timing more GPU friendly (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Make new output format match old Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureBenchmark.cpp
===================================================================
--- tools/PictureBenchmark.cpp (revision 12693)
+++ tools/PictureBenchmark.cpp (working copy)
@@ -170,30 +170,49 @@
this->logProgress(longRunningResult.c_str());
}
} else {
- SkAutoTDelete<BenchTimer> timer(this->setupTimer());
- TimerData timerData(fRepeats);
+ SkAutoTDelete<BenchTimer> longRunningTimer(this->setupTimer());
+ TimerData longRunningTimerData(1);
+ SkAutoTDelete<BenchTimer> perRunTimer(this->setupTimer(false));
+ TimerData perRunTimerData(fRepeats);
+
+ longRunningTimer->start();
for (int i = 0; i < fRepeats; ++i) {
fRenderer->setup();
- timer->start();
+ perRunTimer->start();
fRenderer->render(NULL);
- timer->truncatedEnd();
+ perRunTimer->truncatedEnd();
+ fRenderer->resetState(false);
+ perRunTimer->end();
- // Finishes gl context
- fRenderer->resetState(true);
- timer->end();
-
- SkAssertResult(timerData.appendTimes(timer.get()));
+ SkAssertResult(perRunTimerData.appendTimes(perRunTimer.get()));
}
+ longRunningTimer->truncatedEnd();
+ fRenderer->resetState(true);
+ longRunningTimer->end();
+ SkAssertResult(longRunningTimerData.appendTimes(longRunningTimer.get()));
SkString configName = fRenderer->getConfigName();
- SkString result = timerData.getResult(timeFormat.c_str(),
- fTimerResult,
- configName.c_str(),
- timerTypes);
+ // Beware - since the per-run-timer doesn't ever include a glFinish it can
+ // report a lower time then the long-running-timer
+#if 0
+ SkString result = perRunTimerData.getResult(timeFormat.c_str(),
+ fTimerResult,
+ configName.c_str(),
+ timerTypes);
result.append("\n");
+
this->logProgress(result.c_str());
+#else
+ SkString result = longRunningTimerData.getResult(timeFormat.c_str(),
+ fTimerResult,
+ configName.c_str(),
+ timerTypes,
+ fRepeats);
+ result.append("\n");
+ this->logProgress(result.c_str());
+#endif
}
fRenderer->end();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698