aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/bench_pictures_main.cpp
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-17 19:25:54 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-17 19:25:54 +0000
commit82ec0b00f380906c1cdeb4b4cc4a355264ab3882 (patch)
treecbd7a20ff8eff4f640f99ee472a75c11530b2e00 /tools/bench_pictures_main.cpp
parent6d87557278052c131957e5d6e093d3a675162d22 (diff)
Allow setting a scaleFactor in bench_pictures (and render_pictures).
In TiledPictureRenderer and CopyTilesRenderer, do a postTranslate so the translate is not affected by the scale factor. Likewise, use clipRegion for tiled renderer so it will be unaffected by the scale factor. Respect the viewport for record, playbackCreation, and pipe renderers. Review URL: https://codereview.appspot.com/6947072 git-svn-id: http://skia.googlecode.com/svn/trunk@6853 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/bench_pictures_main.cpp')
-rw-r--r--tools/bench_pictures_main.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index 0bfbb2841c..3e3bc33ad5 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -126,7 +126,7 @@ static void usage(const char* argv0) {
" [--pipe]\n"
" [--bbh bbhType]\n"
" [--multi numThreads]\n"
-" [--viewport width height]\n"
+" [--viewport width height][--scale sf]\n"
" [--device bitmap"
#if SK_SUPPORT_GPU
" | gpu"
@@ -184,6 +184,7 @@ static void usage(const char* argv0) {
" --multi numThreads : Set the number of threads for multi threaded drawing. Must be greater\n"
" than 1. Only works with tiled rendering.\n"
" --viewport width height : Set the viewport.\n"
+" --scale sf : Scale drawing by sf.\n"
" --pipe: Benchmark SkGPipe rendering. Currently incompatible with \"mode\".\n");
SkDebugf(
" --bbh bbhType [width height]: Set the bounding box hierarchy type to\n"
@@ -296,6 +297,7 @@ static void parse_commandline(int argc, char* const argv[], SkTArray<SkString>*
sk_bzero(drawFilters, sizeof(drawFilters));
SkISize viewport;
viewport.setEmpty();
+ SkScalar scaleFactor = SK_Scalar1;
for (++argv; argv < stop; ++argv) {
if (0 == strcmp(*argv, "--repeat")) {
++argv;
@@ -443,6 +445,13 @@ static void parse_commandline(int argc, char* const argv[], SkTArray<SkString>*
PRINT_USAGE_AND_EXIT;
}
viewport.fHeight = atoi(*argv);
+ } else if (0 == strcmp(*argv, "--scale")) {
+ ++argv;
+ if (argv >= stop) {
+ gLogger.logError("Missing scaleFactor for --scale\n");
+ PRINT_USAGE_AND_EXIT;
+ }
+ scaleFactor = atof(*argv);
} else if (0 == strcmp(*argv, "--tiles")) {
++argv;
if (argv >= stop) {
@@ -730,6 +739,7 @@ static void parse_commandline(int argc, char* const argv[], SkTArray<SkString>*
renderer->setDrawFilters(drawFilters, filtersName(drawFilters));
renderer->setGridSize(gridWidth, gridHeight);
renderer->setViewport(viewport);
+ renderer->setScaleFactor(scaleFactor);
benchmark->setRenderer(renderer);
benchmark->setRepeats(repeats);
benchmark->setDeviceType(deviceType);