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(); |
} |