5 #ifndef FLUTTER_IMPELLER_TESSELLATOR_PATH_TESSELLATOR_H_
6 #define FLUTTER_IMPELLER_TESSELLATOR_PATH_TESSELLATOR_H_
70 return p1 * u * u + 2 *
cp * u * t +
p2 * t * t;
79 return (
p1 -
cp).Normalize();
82 return (
p1 -
p2).Normalize();
89 return (
p2 -
cp).Normalize();
92 return (
p2 -
p1).Normalize();
112 return (
p1 * coeff_1 +
cp * coeff_c +
p2 * coeff_2) /
113 (coeff_1 + coeff_c + coeff_2);
122 return (
p1 -
cp).Normalize();
125 return (
p1 -
p2).Normalize();
132 return (
p2 -
cp).Normalize();
135 return (
p2 -
p1).Normalize();
151 return p1 * u * u * u +
152 3 *
cp1 * u * u * t +
153 3 *
cp2 * u * t * t +
163 return (
p1 -
cp1).Normalize();
166 return (
p1 -
cp2).Normalize();
169 return (
p1 -
p2).Normalize();
176 return (
p2 -
cp2).Normalize();
179 return (
p2 -
cp1).Normalize();
182 return (
p2 -
p1).Normalize();
189 SegmentReceiver& receiver);
192 SegmentReceiver& receiver);
198 VertexWriter& writer,
An interface for receiving pruned path segments.
virtual void RecordLine(Point p1, Point p2)=0
virtual void RecordCubic(Point p1, Point cp1, Point cp2, Point p2)=0
virtual void RecordConic(Point p1, Point cp, Point p2, Scalar weight)=0
virtual void RecordQuad(Point p1, Point cp, Point p2)=0
virtual void EndContour(Point origin, bool with_close)=0
virtual void BeginContour(Point origin, bool will_be_closed)=0
An interface for generating a multi contour polyline as a triangle strip.
virtual void EndContour()=0
virtual void Write(Point point)=0
static void PathToFilledSegments(const PathSource &source, SegmentReceiver &receiver)
static void PathToStrokedSegments(const PathSource &source, SegmentReceiver &receiver)
static void PathToFilledVertices(const PathSource &source, VertexWriter &writer, Scalar scale)
static std::pair< size_t, size_t > CountFillStorage(const PathSource &source, Scalar scale)
Scalar ComputeConicSubdivisions(Scalar scale_factor, Point p0, Point p1, Point p2, Scalar w)
Scalar ComputeQuadradicSubdivisions(Scalar scale_factor, Point p0, Point p1, Point p2)
Scalar ComputeCubicSubdivisions(Scalar scale_factor, Point p0, Point p1, Point p2, Point p3)
std::optional< Vector2 > GetStartDirection() const
std::optional< Vector2 > GetEndDirection() const
Point Solve(Scalar t) const
Scalar SubdivisionCount(Scalar scale) const
Point Solve(Scalar t) const
std::optional< Vector2 > GetStartDirection() const
Scalar SubdivisionCount(Scalar scale) const
std::optional< Vector2 > GetEndDirection() const
Scalar SubdivisionCount(Scalar scale) const
Point Solve(Scalar t) const
std::optional< Vector2 > GetStartDirection() const
std::optional< Vector2 > GetEndDirection() const