50 [&
points](
const float* vertices,
size_t vertices_count,
51 const uint16_t* indices,
size_t indices_count) {
53 std::vector<Point> raw_points;
54 for (
auto i = 0u;
i < vertices_count * 2;
i += 2) {
55 raw_points.emplace_back(
Point{vertices[
i], vertices[
i + 1]});
57 for (
auto i = 0u;
i < indices_count;
i++) {
58 auto point = raw_points[indices[
i]];
68 vertices->points =
new float[
points.size()];
69 if (!vertices->points) {
72 vertices->length =
points.size();
73 std::copy(
points.begin(),
points.end(), vertices->points);
DlPathBuilder & LineTo(DlPoint p2)
Draw a line from the current point to the indicated point p2.
DlPathBuilder & MoveTo(DlPoint p2)
Start a new contour that will originate at the indicated point p2.
const DlPath CopyPath()
Returns the path constructed by this path builder so far and retains all current geometry to continue...
DlPathBuilder & SetFillType(DlPathFillType fill_type)
Set the fill type that should be used to determine the interior of this path to the indicated |fill_t...
DlPathBuilder & Close()
The path is closed back to the location of the most recent MoveTo call. Contours that are filled are ...
DlPathBuilder & CubicCurveTo(DlPoint cp1, DlPoint cp2, DlPoint p2)
Draw a cubic bezier curve from the current point to the indicated point p2, using the indicated point...
An extended tessellator that offers arbitrary/concave tessellation via the libtess2 library.
TessellatorLibtess::Result Tessellate(const PathSource &source, Scalar tolerance, const BuilderCallback &callback)
Generates filled triangles from the path. A callback is invoked once for the entire tessellation.
struct Vertices * Tessellate(PathBuilder *builder, int fill_type, Scalar tolerance)
PathBuilder * CreatePathBuilder()
void DestroyPathBuilder(PathBuilder *builder)
flutter::DlPathBuilder PathBuilder
void DestroyVertices(Vertices *vertices)
void MoveTo(PathBuilder *builder, Scalar x, Scalar y)
void LineTo(PathBuilder *builder, Scalar x, Scalar y)
void CubicTo(PathBuilder *builder, Scalar x1, Scalar y1, Scalar x2, Scalar y2, Scalar x3, Scalar y3)
void Close(PathBuilder *builder)
std::vector< Point > points