summaryrefslogtreecommitdiff
path: root/libs/hwui/tests/macrobench
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/tests/macrobench')
-rw-r--r--libs/hwui/tests/macrobench/TestSceneRunner.cpp6
-rw-r--r--libs/hwui/tests/macrobench/main.cpp13
2 files changed, 19 insertions, 0 deletions
diff --git a/libs/hwui/tests/macrobench/TestSceneRunner.cpp b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
index 9428f532434a..854a449c73a6 100644
--- a/libs/hwui/tests/macrobench/TestSceneRunner.cpp
+++ b/libs/hwui/tests/macrobench/TestSceneRunner.cpp
@@ -153,6 +153,12 @@ void run(const TestScene::Info& info, const TestScene::Options& opts,
proxy->resetProfileInfo();
proxy->fence();
+ if (opts.renderAhead) {
+ // Need to let the queue drain to see render-ahead in action.
+ usleep(33000);
+ }
+ proxy->setRenderAheadDepth(opts.renderAhead);
+
ModifiedMovingAverage<double> avgMs(opts.reportFrametimeWeight);
nsecs_t start = systemTime(CLOCK_MONOTONIC);
diff --git a/libs/hwui/tests/macrobench/main.cpp b/libs/hwui/tests/macrobench/main.cpp
index 0a9a74eccfc9..4cb5cfdd729b 100644
--- a/libs/hwui/tests/macrobench/main.cpp
+++ b/libs/hwui/tests/macrobench/main.cpp
@@ -68,6 +68,7 @@ OPTIONS:
are offscreen rendered
--benchmark_format Set output format. Possible values are tabular, json, csv
--renderer=TYPE Sets the render pipeline to use. May be opengl, skiagl, or skiavk
+ --render-ahead=NUM Sets how far to render-ahead. Must be 0 (default), 1, or 2.
)");
}
@@ -173,6 +174,7 @@ enum {
Onscreen,
Offscreen,
Renderer,
+ RenderAhead,
};
}
@@ -188,6 +190,7 @@ static const struct option LONG_OPTIONS[] = {
{"onscreen", no_argument, nullptr, LongOpts::Onscreen},
{"offscreen", no_argument, nullptr, LongOpts::Offscreen},
{"renderer", required_argument, nullptr, LongOpts::Renderer},
+ {"render-ahead", required_argument, nullptr, LongOpts::RenderAhead},
{0, 0, 0, 0}};
static const char* SHORT_OPTIONS = "c:r:h";
@@ -286,6 +289,16 @@ void parseOptions(int argc, char* argv[]) {
gOpts.renderOffscreen = true;
break;
+ case LongOpts::RenderAhead:
+ if (!optarg) {
+ error = true;
+ }
+ gOpts.renderAhead = atoi(optarg);
+ if (gOpts.renderAhead < 0 || gOpts.renderAhead > 2) {
+ error = true;
+ }
+ break;
+
case 'h':
printHelp();
exit(EXIT_SUCCESS);