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 304613002: Reland https://codereview.chromium.org/286903025 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Diagnostic patch: removed header from gyp entry Created 6 years, 7 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
« no previous file with comments | « tools/PictureBenchmark.h ('k') | tools/PictureResultsWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « tools/PictureBenchmark.h ('k') | tools/PictureResultsWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698