Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2c472d7

Browse files
authored
[Impeller] restore accidentally deleted Cap/Join benchmarks (#53385)
These benchmark invocations were accidentally deleted when the invocations of the "UV" versions were eliminated. No unit tests because only benchmark code is changed.
1 parent 1a21db1 commit 2c472d7

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

impeller/geometry/geometry_benchmarks.cc

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -116,31 +116,32 @@ static void BM_Convex(benchmark::State& state, Args&&... args) {
116116
state.counters["TotalPointCount"] = point_count;
117117
}
118118

119-
#define MAKE_STROKE_BENCHMARK_CAPTURE(path, cap, join, closed, uvname, uvtype) \
120-
BENCHMARK_CAPTURE(BM_StrokePolyline, stroke_##path##_##cap##_##join##uvname, \
119+
#define MAKE_STROKE_BENCHMARK_CAPTURE(path, cap, join, closed) \
120+
BENCHMARK_CAPTURE(BM_StrokePolyline, stroke_##path##_##cap##_##join, \
121121
Create##path(closed), Cap::k##cap, Join::k##join)
122122

123-
#define MAKE_STROKE_BENCHMARK_CAPTURE_CAPS_JOINS(path, uvname, uvtype) \
124-
MAKE_STROKE_BENCHMARK_CAPTURE(path, Butt, Bevel, false, uvname, uvtype); \
125-
MAKE_STROKE_BENCHMARK_CAPTURE(path, Butt, Miter, false, uvname, uvtype); \
126-
MAKE_STROKE_BENCHMARK_CAPTURE(path, Butt, Round, false, uvname, uvtype); \
127-
MAKE_STROKE_BENCHMARK_CAPTURE(path, Square, Bevel, false, uvname, uvtype); \
128-
MAKE_STROKE_BENCHMARK_CAPTURE(path, Round, Bevel, false, uvname, uvtype)
123+
#define MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS(path, closed) \
124+
MAKE_STROKE_BENCHMARK_CAPTURE(path, Butt, Bevel, closed); \
125+
MAKE_STROKE_BENCHMARK_CAPTURE(path, Butt, Miter, closed); \
126+
MAKE_STROKE_BENCHMARK_CAPTURE(path, Butt, Round, closed); \
127+
MAKE_STROKE_BENCHMARK_CAPTURE(path, Square, Bevel, closed); \
128+
MAKE_STROKE_BENCHMARK_CAPTURE(path, Round, Bevel, closed)
129129

130-
BENCHMARK_CAPTURE(BM_Polyline, cubic_polyline, CreateCubic(true), false);
131-
BENCHMARK_CAPTURE(BM_Polyline,
132-
unclosed_cubic_polyline,
133-
CreateCubic(false),
134-
false);
130+
BENCHMARK_CAPTURE(BM_Polyline, cubic_polyline, CreateCubic(true));
131+
BENCHMARK_CAPTURE(BM_Polyline, unclosed_cubic_polyline, CreateCubic(false));
132+
MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS(Cubic, false);
135133

136-
BENCHMARK_CAPTURE(BM_Polyline, quad_polyline, CreateQuadratic(true), false);
137-
BENCHMARK_CAPTURE(BM_Polyline,
138-
unclosed_quad_polyline,
139-
CreateQuadratic(false),
140-
false);
134+
BENCHMARK_CAPTURE(BM_Polyline, quad_polyline, CreateQuadratic(true));
135+
BENCHMARK_CAPTURE(BM_Polyline, unclosed_quad_polyline, CreateQuadratic(false));
136+
MAKE_STROKE_BENCHMARK_CAPTURE_ALL_CAPS_JOINS(Quadratic, false);
141137

142138
BENCHMARK_CAPTURE(BM_Convex, rrect_convex, CreateRRect(), true);
143-
MAKE_STROKE_BENCHMARK_CAPTURE(RRect, Butt, Bevel, , , );
139+
// A round rect has no ends so we don't need to try it with all cap values
140+
// but it does have joins and even though they should all be almost
141+
// colinear, we run the benchmark against all 3 join values.
142+
MAKE_STROKE_BENCHMARK_CAPTURE(RRect, Butt, Bevel, );
143+
MAKE_STROKE_BENCHMARK_CAPTURE(RRect, Butt, Miter, );
144+
MAKE_STROKE_BENCHMARK_CAPTURE(RRect, Butt, Round, );
144145

145146
namespace {
146147

0 commit comments

Comments
 (0)