@@ -116,31 +116,32 @@ static void BM_Convex(benchmark::State& state, Args&&... args) {
116
116
state.counters [" TotalPointCount" ] = point_count;
117
117
}
118
118
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, \
121
121
Create##path(closed), Cap::k##cap, Join::k##join)
122
122
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 )
129
129
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 );
135
133
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 );
141
137
142
138
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, );
144
145
145
146
namespace {
146
147
0 commit comments