5 #ifndef FLUTTER_IMPELLER_GEOMETRY_PATH_BUILDER_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_PATH_BUILDER_H_
37 void Reserve(
size_t point_size,
size_t verb_size);
61 bool relative =
false);
71 bool relative =
false);
81 bool relative =
false);
90 bool use_center =
false);
136 Point subpath_start_;
138 size_t current_contour_location_ = 0u;
139 size_t contour_count_ = 0u;
140 Path::Data prototype_;
150 void AddContourComponent(
const Point& destination,
bool is_closed =
false);
152 void SetContourClosed(
bool is_closed);
154 void AddLinearComponent(
const Point& p1,
const Point& p2);
156 void AddLinearComponentIfNeeded(
const Point& p1,
const Point& p2);
158 void AddQuadraticComponent(
const Point& p1,
const Point& cp,
const Point& p2);
160 void AddConicComponent(
const Point& p1,
165 void AddCubicComponent(
const Point& p1,
175 std::optional<std::pair<Point, Point>> GetMinMaxCoveragePoints()
const;
Path TakePath(FillType fill=FillType::kNonZero)
PathBuilder & AddArc(const Rect &oval_bounds, Radians start, Radians sweep, bool use_center=false)
PathBuilder & AddRoundRect(RoundRect rect)
PathBuilder & LineTo(Point point, bool relative=false)
Insert a line from the current position to point.
PathBuilder & MoveTo(Point point, bool relative=false)
PathBuilder & AddRect(const Rect &rect)
PathBuilder & SetBounds(Rect bounds)
Set the bounding box that will be used by Path.GetBoundingBox in place of performing the computation.
void Reserve(size_t point_size, size_t verb_size)
Reserve [point_size] points and [verb_size] verbs in the underlying path buffer.
PathBuilder & AddCubicCurve(const Point &p1, const Point &cp1, const Point &cp2, const Point &p2)
Move to point p1, then insert a cubic curve from p1 to p2 with control points cp1 and cp2.
PathBuilder & AddOval(const Rect &rect)
PathBuilder & AddCircle(const Point ¢er, Scalar radius)
PathBuilder & AddPath(const Path &path)
PathBuilder & AddConicCurve(const Point &p1, const Point &cp, const Point &p2, Scalar weight)
Move to point p1, then insert a conic curve from p1 to p2 with the control point cp and weight weight...
Path CopyPath(FillType fill=FillType::kNonZero)
PathBuilder & VerticalLineTo(Scalar y, bool relative=false)
PathBuilder & Shift(Point offset)
Transform the existing path segments and contours by the given offset.
PathBuilder & AddLine(const Point &p1, const Point &p2)
Move to point p1, then insert a line from p1 to p2.
constexpr static const Scalar kArcApproximationMagic
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...
PathBuilder & ConicCurveTo(Point controlPoint, Point point, Scalar weight, bool relative=false)
Insert a conic curve from the current position to point using the control point controlPoint and the ...
PathBuilder & AddQuadraticCurve(const Point &p1, const Point &cp, const Point &p2)
Move to point p1, then insert a quadradic curve from p1 to p2 with the control point cp.
PathBuilder & HorizontalLineTo(Scalar x, bool relative=false)
PathBuilder & AddRoundSuperellipse(RoundSuperellipse rse)
PathBuilder & SetConvexity(Convexity value)
PathBuilder & QuadraticCurveTo(Point controlPoint, Point point, bool relative=false)
Insert a quadradic curve from the current position to point using the control point controlPoint.
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....