 |
Flutter Impeller
|
|
Go to the documentation of this file.
45 std::vector<float> points;
47 path.GetFillType(), polyline,
48 [&points](
const float* vertices,
size_t vertices_count,
49 const uint16_t* indices,
size_t indices_count) {
51 std::vector<Point> raw_points;
52 for (auto i = 0u; i < vertices_count * 2; i += 2) {
53 raw_points.emplace_back(Point{vertices[i], vertices[i + 1]});
55 for (
auto i = 0u; i < indices_count; i++) {
56 auto point = raw_points[indices[i]];
57 points.push_back(point.x);
58 points.push_back(point.y);
65 Vertices* vertices =
new Vertices();
66 vertices->points =
new float[points.size()];
67 if (!vertices->points) {
70 vertices->length = points.size();
71 std::copy(points.begin(), points.end(), vertices->points);
void DestroyVertices(Vertices *vertices)
A utility that generates triangles of the specified fill type given a polyline. This happens on the C...
PathBuilder & CubicCurveTo(Point controlPoint1, Point controlPoint2, Point point, bool relative=false)
Insert a cubic curve from the curren position to point using the control points controlPoint1 and con...
void MoveTo(PathBuilder *builder, Scalar x, Scalar y)
PathBuilder * CreatePathBuilder()
void CubicTo(PathBuilder *builder, Scalar x1, Scalar y1, Scalar x2, Scalar y2, Scalar x3, Scalar y3)
PathBuilder & LineTo(Point point, bool relative=false)
Insert a line from the current position to point.
void Close(PathBuilder *builder)
Tessellator::Result Tessellate(FillType fill_type, const Path::Polyline &polyline, const BuilderCallback &callback) const
Generates filled triangles from the polyline. A callback is invoked once for the entire tessellation.
Path CopyPath(FillType fill=FillType::kNonZero) const
void LineTo(PathBuilder *builder, Scalar x, Scalar y)
PathBuilder & MoveTo(Point point, bool relative=false)
void DestroyPathBuilder(PathBuilder *builder)
struct Vertices * Tessellate(PathBuilder *builder, int fill_type, Scalar tolerance)
Polyline CreatePolyline(Scalar scale) const