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

Unified Diff: tools/bench_pictures_main.cpp

Issue 286903025: PictureBenchmark JSON logging (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More style fixes 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/PictureResultsWriter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_pictures_main.cpp
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index 5ff519c8c5e67e9aa6aef4ce47e3637f7197518f..b79dfedff230f1eb0f799c3db1e51fce6d3ac3d8 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -12,6 +12,7 @@
#include "PictureRenderingFlags.h"
#include "SkBenchLogger.h"
#include "SkCommandLineFlags.h"
+#include "SkData.h"
#include "SkDiscardableMemoryPool.h"
#include "SkGraphics.h"
#include "SkImageDecoder.h"
@@ -20,8 +21,11 @@
#include "SkPicture.h"
#include "SkStream.h"
#include "picture_utils.h"
+#include "PictureResultsWriter.h"
SkBenchLogger gLogger;
+PictureResultsLoggerWriter gLogWriter(&gLogger);
+PictureResultsMultiWriter gWriter;
// Flags used by this file, in alphabetical order.
DEFINE_bool(countRAM, false, "Count the RAM used for bitmap pixels in each skp file");
@@ -35,6 +39,9 @@ DEFINE_string(filter, "",
"Specific flags are listed above.");
DEFINE_string(logFile, "", "Destination for writing log output, in addition to stdout.");
DEFINE_bool(logPerIter, false, "Log each repeat timer instead of mean.");
+#ifdef SK_BUILD_JSON_WRITER
+DEFINE_string(jsonLog, "", "Destination for writing JSON data.");
+#endif
DEFINE_bool(min, false, "Print the minimum times (instead of average).");
DECLARE_int32(multi);
DECLARE_string(readPath);
@@ -187,10 +194,7 @@ static bool run_single_benchmark(const SkString& inputPath,
SkString filename;
sk_tools::get_basename(&filename, inputPath);
- SkString result;
- result.printf("running bench [%i %i] %s ", picture->width(), picture->height(),
- filename.c_str());
- gLogger.logProgress(result);
+ gWriter.bench(filename.c_str(), picture->width(), picture->height());
benchmark.run(picture);
@@ -360,7 +364,7 @@ static void setup_benchmark(sk_tools::PictureBenchmark* benchmark) {
}
benchmark->setRenderer(renderer);
benchmark->setRepeats(FLAGS_repeat);
- benchmark->setLogger(&gLogger);
+ benchmark->setWriter(&gWriter);
}
static int process_input(const char* input,
@@ -417,6 +421,16 @@ int tool_main(int argc, char** argv) {
}
}
+#ifdef SK_BUILD_JSON_WRITER
+ SkAutoTDelete<PictureJSONResultsWriter> jsonWriter;
+ if (FLAGS_jsonLog.count() == 1) {
+ jsonWriter.reset(SkNEW(PictureJSONResultsWriter(FLAGS_jsonLog[0])));
+ gWriter.add(jsonWriter.get());
+ }
+
+#endif
+ gWriter.add(&gLogWriter);
+
#if SK_ENABLE_INST_COUNT
gPrintInstCount = true;
@@ -444,6 +458,7 @@ int tool_main(int argc, char** argv) {
(double) gTotalCacheHits / (gTotalCacheHits + gTotalCacheMisses));
}
#endif
+ gWriter.end();
return 0;
}
« no previous file with comments | « tools/PictureResultsWriter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698