5#ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
6#define FLUTTER_IMPELLER_GEOMETRY_PATH_COMPONENT_H_
24 std::vector<uint16_t>& indices);
33 bool previous_contour_odd_points_ =
false;
34 size_t contour_start_ = 0u;
35 std::vector<Point>& points_;
36 std::vector<uint16_t>& indices_;
51 std::vector<Point>
Extrema()
const;
54 return p1 == other.
p1 &&
p2 == other.
p2;
74 :
p1(ap1),
cp(acp),
p2(ap2) {}
81 std::vector<Point>&
points)
const;
89 std::vector<Point>
Extrema()
const;
92 return p1 == other.
p1 &&
cp == other.
cp &&
p2 == other.
p2;
115 cp1(q.
p1 + (q.cp - q.
p1) * (2.0 / 3.0)),
116 cp2(q.
p2 + (q.cp - q.
p2) * (2.0 / 3.0)),
128 std::vector<Point>
Extrema()
const;
174 std::optional<Vector2>
operator()(std::monostate monostate) {
183 std::optional<Vector2>
operator()(std::monostate monostate) {
static const int points[]
An interface for generating a multi contour polyline as a triangle strip.
VertexWriter(std::vector< Point > &points, std::vector< uint16_t > &indices)
Dart_NativeFunction function
std::variant< std::monostate, const LinearPathComponent *, const QuadraticPathComponent *, const CubicPathComponent * > PathComponentVariant
static double time(int loops, Benchmark *bench, Target *target)
bool operator==(const ContourComponent &other) const
ContourComponent(Point p, bool is_closed=false)
void ToLinearPathComponents(Scalar scale, const PointProc &proc) const
void AppendPolylinePoints(Scalar scale, std::vector< Point > &points) const
CubicPathComponent(Point ap1, Point acp1, Point acp2, Point ap2)
bool operator==(const CubicPathComponent &other) const
std::function< void(const Point &point)> PointProc
CubicPathComponent Subsegment(Scalar t0, Scalar t1) const
Point Solve(Scalar time) const
std::optional< Vector2 > GetStartDirection() const
std::vector< Point > Extrema() const
std::optional< Vector2 > GetEndDirection() const
Point SolveDerivative(Scalar time) const
CubicPathComponent(const QuadraticPathComponent &q)
std::optional< Vector2 > GetEndDirection() const
LinearPathComponent(Point ap1, Point ap2)
std::optional< Vector2 > GetStartDirection() const
std::vector< Point > Extrema() const
bool operator==(const LinearPathComponent &other) const
Point Solve(Scalar time) const
void AppendPolylinePoints(std::vector< Point > &points) const
std::optional< Vector2 > operator()(const LinearPathComponent *component)
std::optional< Vector2 > operator()(std::monostate monostate)
std::optional< Vector2 > operator()(std::monostate monostate)
std::optional< Vector2 > operator()(const LinearPathComponent *component)
std::optional< Vector2 > GetEndDirection() const
QuadraticPathComponent(Point ap1, Point acp, Point ap2)
void AppendPolylinePoints(Scalar scale_factor, std::vector< Point > &points) const
bool operator==(const QuadraticPathComponent &other) const
std::function< void(const Point &point)> PointProc
std::vector< Point > Extrema() const
Point SolveDerivative(Scalar time) const
std::optional< Vector2 > GetStartDirection() const
void ToLinearPathComponents(Scalar scale_factor, const PointProc &proc) const
Point Solve(Scalar time) const