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

Unified Diff: tools/PictureBenchmark.cpp

Issue 233663002: Update bench to be able to preprocess skps (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add missing file Created 6 years, 8 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/PictureBenchmark.cpp
===================================================================
--- tools/PictureBenchmark.cpp (revision 14136)
+++ tools/PictureBenchmark.cpp (working copy)
@@ -23,6 +23,7 @@
, fTimerTypes(0)
, fTimeIndividualTiles(false)
, fPurgeDecodedTex(false)
+, fPreprocess(false)
{}
PictureBenchmark::~PictureBenchmark() {
@@ -77,9 +78,22 @@
// We throw this away to remove first time effects (such as paging in this program)
fRenderer->setup();
+
+ if (fPreprocess) {
+ if (NULL != fRenderer->getCanvas()) {
+ fRenderer->getCanvas()->EXPERIMENTAL_optimize(pict);
+ }
+ }
+
fRenderer->render(NULL);
fRenderer->resetState(true); // flush, swapBuffers and Finish
+ if (fPreprocess) {
+ if (NULL != fRenderer->getCanvas()) {
+ fRenderer->getCanvas()->EXPERIMENTAL_purge(pict);
+ }
+ }
+
if (fPurgeDecodedTex) {
fRenderer->purgeTextures();
}
@@ -216,6 +230,12 @@
SkAssertResult(perRunTimerData.appendTimes(perRunTimer.get()));
+ if (fPreprocess) {
+ if (NULL != fRenderer->getCanvas()) {
+ fRenderer->getCanvas()->EXPERIMENTAL_purge(pict);
+ }
+ }
+
if (fPurgeDecodedTex) {
fRenderer->purgeTextures();
}

Powered by Google App Engine
This is Rietveld 408576698