Add --match to bench tools, extra decimal to bench_pictures.

BUG=skia:2378
R=fmalita@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/243273002

git-svn-id: http://skia.googlecode.com/svn/trunk@14276 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-04-21 14:59:59 +00:00
parent 1bc6ecc470
commit 5da5b59764
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -31,6 +31,7 @@ DEFINE_int32(nullSize, 1000, "Pretend dimension of null source picture.");
DEFINE_int32(tileGridSize, 512, "Set the tile grid size. Has no effect if bbh is not set to tilegrid.");
DEFINE_string(bbh, "", "Turn on the bbh and select the type, one of rtree, tilegrid, quadtree");
DEFINE_bool(skr, false, "Record SKR instead of SKP.");
DEFINE_string(match, "", "The usual filters on file names of SKPs to bench.");
static SkBBHFactory* parse_FLAGS_bbh() {
if (FLAGS_bbh.isEmpty()) {
@ -104,6 +105,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()));