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

Unified Diff: tools/bench_playback.cpp

Issue 243273002: Add --match to bench tools, extra decimal to bench_pictures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « no previous file | tools/bench_record.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_playback.cpp
diff --git a/tools/bench_playback.cpp b/tools/bench_playback.cpp
index 052ded8b15891b75d2d785dd47697af91840e09d..3d0d4ef54b29826d6f0834a965e1a840d9d0ed4f 100644
--- a/tools/bench_playback.cpp
+++ b/tools/bench_playback.cpp
@@ -22,6 +22,7 @@ DEFINE_string2(skps, r, "skps", "Directory containing SKPs to read and re-record
DEFINE_int32(loops, 10, "Number of times to play back each SKP.");
DEFINE_bool(skr, false, "Play via SkRecord instead of SkPicture.");
DEFINE_int32(tile, 1000000000, "Simulated tile size.");
+DEFINE_string(match, "", "The usual filters on file names of SKPs to bench.");
static void bench(SkPMColor* scratch, SkPicture& src, const char* name) {
// We don't use the public SkRecording interface here because we need kWriteOnly_Mode.
@@ -47,7 +48,7 @@ static void bench(SkPMColor* scratch, SkPicture& src, const char* name) {
const SkMSec elapsed = SkTime::GetMSecs() - start;
const double msPerLoop = elapsed / (double)FLAGS_loops;
- printf("%5.1f\t%s\n", msPerLoop, name);
+ printf("%6.2f\t%s\n", msPerLoop, name);
}
int tool_main(int argc, char** argv);
@@ -63,6 +64,10 @@ int tool_main(int argc, char** argv) {
SkString filename;
bool failed = false;
while (it.next(&filename)) {
+ if (SkCommandLineFlags::ShouldSkip(FLAGS_match, filename.c_str())) {
+ continue;
+ }
+
const SkString path = SkOSPath::SkPathJoin(FLAGS_skps[0], filename.c_str());
SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path.c_str()));
« no previous file with comments | « no previous file | tools/bench_record.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698