21 std::vector<Point> output;
22 std::vector<uint16_t> indices;
24 for (
auto j = 0u; j < polyline.
contours.size(); j++) {
26 auto center = polyline.
points[start];
31 if (polyline.
points[end - 1] == polyline.
points[start]) {
34 output.emplace_back(center);
35 output.emplace_back(polyline.
points[start + 1]);
37 for (
auto i = start + 2; i < end; i++) {
38 const auto& point_b = polyline.
points[i];
39 output.emplace_back(point_b);
41 indices.emplace_back(0);
42 indices.emplace_back(i - 1);
43 indices.emplace_back(i);
46 return std::make_pair(output, indices);
49 VertexBufferBuilder<TextureFillVertexShader::PerVertexData>
53 Size texture_coverage,
58 [&vertex_builder, &texture_coverage, &effect_transform,
59 &texture_origin](SolidFillVertexShader::PerVertexData old_vtx) {
60 TextureFillVertexShader::PerVertexData data;
61 data.position = old_vtx.position;
62 data.texture_coords = effect_transform *
63 (old_vtx.position - texture_origin) /
67 return vertex_builder;
71 Rect texture_coverage,
78 std::vector<Point> data(8);
80 for (
auto i = 0u, j = 0u; i < 8; i += 2, j++) {
82 data[i + 1] = effect_transform * (points[j] - texture_coverage.
origin) /
83 texture_coverage.
size;
90 .vertex_buffer = host_buffer.Emplace(
91 data.data(), 16 *
sizeof(float),
alignof(
float)),
97 .prevent_overdraw =
false,
115 std::optional<Rect> inner_rect) {
116 return std::make_unique<FillPathGeometry>(path, inner_rect);
122 return std::make_unique<PointFieldGeometry>(std::move(points), radius, round);
131 if (miter_limit < 0) {
134 return std::make_unique<StrokePathGeometry>(path, stroke_width, miter_limit,
135 stroke_cap, stroke_join);
139 return std::make_unique<CoverGeometry>();
143 return std::make_unique<RectGeometry>(rect);