Index: tools/PictureBenchmark.cpp |
diff --git a/tools/PictureBenchmark.cpp b/tools/PictureBenchmark.cpp |
index 6c0325e2ee115c76c3c021c50101b30ed61053d3..f1d00035cc6ae138c992ebae87d5cbb87bb86ac3 100644 |
--- a/tools/PictureBenchmark.cpp |
+++ b/tools/PictureBenchmark.cpp |
@@ -5,7 +5,6 @@ |
* found in the LICENSE file. |
*/ |
-#include "SkBenchLogger.h" |
#include "BenchTimer.h" |
#include "PictureBenchmark.h" |
#include "SkCanvas.h" |
@@ -17,13 +16,13 @@ namespace sk_tools { |
PictureBenchmark::PictureBenchmark() |
: fRepeats(1) |
-, fLogger(NULL) |
, fRenderer(NULL) |
, fTimerResult(TimerData::kAvg_Result) |
, fTimerTypes(0) |
, fTimeIndividualTiles(false) |
, fPurgeDecodedTex(false) |
, fPreprocess(false) |
+, fWriter(NULL) |
{} |
PictureBenchmark::~PictureBenchmark() { |
@@ -52,12 +51,6 @@ BenchTimer* PictureBenchmark::setupTimer(bool useGLTimer) { |
return SkNEW_ARGS(BenchTimer, (NULL)); |
} |
-void PictureBenchmark::logProgress(const char msg[]) { |
- if (fLogger != NULL) { |
- fLogger->logProgress(msg); |
- } |
-} |
- |
PictureRenderer* PictureBenchmark::setRenderer(sk_tools::PictureRenderer* renderer) { |
SkRefCnt_SafeAssign(fRenderer, renderer); |
return renderer; |
@@ -137,10 +130,6 @@ void PictureBenchmark::run(SkPicture* pict) { |
return; |
} |
- // Insert a newline so that each tile is reported on its own line (separate from the line |
- // that describes the skp being run). |
- this->logProgress("\n"); |
- |
int x, y; |
while (tiledRenderer->nextTile(x, y)) { |
// There are two timers, which will behave slightly differently: |
@@ -184,8 +173,8 @@ void PictureBenchmark::run(SkPicture* pict) { |
SkAssertResult(longRunningTimerData.appendTimes(longRunningTimer.get())); |
} |
- SkString configName = tiledRenderer->getConfigName(); |
- configName.appendf(": tile [%i,%i] out of [%i,%i]", x, y, xTiles, yTiles); |
+ fWriter->tileConfig(tiledRenderer->getConfigName()); |
+ fWriter->tileMeta(x, y, xTiles, yTiles); |
// TODO(borenet): Turn off per-iteration tile time reporting for now. |
// Avoiding logging the time for every iteration for each tile cuts |
@@ -193,22 +182,23 @@ void PictureBenchmark::run(SkPicture* pict) { |
// we're loading the bench data directly into a data store and are no |
// longer generating SVG graphs. |
#if 0 |
- SkString result = perTileTimerData.getResult(timeFormat.c_str(), fTimerResult, |
- configName.c_str(), timerTypes); |
- result.append("\n"); |
- this->logProgress(result.c_str()); |
+ fWriter->tileData( |
+ &perTileTimerData, |
+ timeFormat.c_str(), |
+ fTimerResult, |
+ timerTypes); |
#endif |
if (fPurgeDecodedTex) { |
- configName.append(" <withPurging>"); |
+ fWriter->addTileFlag(PictureResultsWriter::kPurging); |
} |
- configName.append(" <averaged>"); |
- SkString longRunningResult = longRunningTimerData.getResult( |
+ fWriter->addTileFlag(PictureResultsWriter::kAvg); |
+ fWriter->tileData( |
+ &longRunningTimerData, |
tiledRenderer->getNormalTimeFormat().c_str(), |
TimerData::kAvg_Result, |
- configName.c_str(), timerTypes, numInnerLoops); |
- longRunningResult.append("\n"); |
- this->logProgress(longRunningResult.c_str()); |
+ timerTypes, |
+ numInnerLoops); |
} |
} else { |
SkAutoTDelete<BenchTimer> longRunningTimer(this->setupTimer()); |
@@ -246,29 +236,26 @@ void PictureBenchmark::run(SkPicture* pict) { |
SkAssertResult(longRunningTimerData.appendTimes(longRunningTimer.get())); |
} |
- SkString configName = fRenderer->getConfigName(); |
+ fWriter->tileConfig(fRenderer->getConfigName()); |
if (fPurgeDecodedTex) { |
- configName.append(" <withPurging>"); |
+ fWriter->addTileFlag(PictureResultsWriter::kPurging); |
} |
// 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()); |
+ fWriter->tileData( |
+ &perRunTimerData, |
+ timeFormat.c_str(), |
+ fTimerResult, |
+ timerTypes); |
#else |
- SkString result = longRunningTimerData.getResult(timeFormat.c_str(), |
- fTimerResult, |
- configName.c_str(), |
- timerTypes, |
- numInnerLoops); |
- result.append("\n"); |
- this->logProgress(result.c_str()); |
+ fWriter->tileData( |
+ &longRunningTimerData, |
+ timeFormat.c_str(), |
+ fTimerResult, |
+ timerTypes, |
+ numInnerLoops); |
#endif |
} |