10#include "flutter/third_party/skia/include/core/SkArc.h"
17 return SkPathFillType::kEvenOdd;
19 return SkPathFillType::kWinding;
30 : builder_(builder) {}
32 void MoveTo(
const Point& p2,
bool will_be_closed) { builder_.MoveTo(p2); }
33 void LineTo(
const Point& p2) { builder_.LineTo(p2); }
34 void QuadTo(
const Point& cp,
const Point& p2) {
35 builder_.QuadraticCurveTo(cp, p2);
37 bool ConicTo(
const Point& cp,
const Point& p2, Scalar weight) {
38 builder_.ConicCurveTo(cp, p2, weight);
41 void CubicTo(
const Point& cp1,
const Point& cp2,
const Point& p2) {
42 builder_.CubicCurveTo(cp1, cp2, p2);
44 void Close() { builder_.Close(); }
55 path_.setFillType(ToSkFillType(fill_type));
60 path_.moveTo(p2.
x, p2.
y);
65 path_.lineTo(p2.
x, p2.
y);
70 path_.quadTo(cp.
x, cp.
y, p2.
x, p2.
y);
77 path_.conicTo(cp.
x, cp.
y, p2.
x, p2.
y, weight);
84 path_.cubicTo(cp1.
x, cp1.
y, cp2.
x, cp2.
y, p2.
x, p2.
y);
104 path_.addCircle(center.x, center.y, radius);
115 BuilderReceiver receiver(*
this);
137 path_.addPath(
path.GetSkPath());
DlPathBuilder & AddRoundSuperellipse(const DlRoundSuperellipse &rse)
Append a closed rounded super-ellipse contour to the path.
DlPathBuilder & LineTo(DlPoint p2)
Draw a line from the current point to the indicated point p2.
DlPathBuilder & AddPath(const DlPath &path)
Append the provided path to this path as if the commands used to construct it were repeated on this p...
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...
const DlPath TakePath()
Returns the path constructed by this path builder and resets its internal state to the default state ...
DlPathBuilder & ConicCurveTo(DlPoint cp, DlPoint p2, DlScalar weight)
Draw a conic curve (a rational quadratic bezier curve) from the current point to the indicated point ...
DlPathBuilder & AddCircle(DlPoint center, DlScalar radius)
Append a closed circular contour to the path centered on the provided point at the provided radius.
DlPathBuilder & AddRect(const DlRect &rect)
Append a closed rectangular contour to the path.
DlPathBuilder & AddRoundRect(const DlRoundRect &round_rect)
Append a closed rounded rect contour to the path.
DlPathBuilder & QuadraticCurveTo(DlPoint cp, DlPoint p2)
Draw a quadratic bezier curve from the current point to the indicated point p2, using the indicated p...
DlPathBuilder & Close()
The path is closed back to the location of the most recent MoveTo call. Contours that are filled are ...
DlPathBuilder & AddArc(const DlRect &bounds, DlDegrees start, DlDegrees sweep, bool use_center=false)
Append an arc contour to the path which:
DlPathBuilder & AddOval(const DlRect &bounds)
Append a closed elliptical contour to the path inscribed in the provided bounds.
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...
Collection of functions to receive path segments from the underlying path representation via the DlPa...
virtual void CubicTo(const Point &cp1, const Point &cp2, const Point &p2)=0
virtual void LineTo(const Point &p2)=0
virtual void QuadTo(const Point &cp, const Point &p2)=0
virtual void MoveTo(const Point &p2, bool will_be_closed)=0
virtual bool ConicTo(const Point &cp, const Point &p2, Scalar weight)
impeller::Scalar DlScalar
const SkPoint & ToSkPoint(const DlPoint &point)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
const SkRRect ToSkRRect(const DlRoundRect &round_rect)
const SkRect & ToSkRect(const DlRect &rect)
constexpr const Rect & GetBounds() const
constexpr const RoundingRadii & GetRadii() const
static RoundSuperellipseParam MakeBoundsRadii(const Rect &bounds, const RoundingRadii &radii)
void Dispatch(PathReceiver &receiver) const
constexpr Point GetCenter() const
Get the center point as a |Point|.