23typedef CanvasPath
Path;
27CanvasPath::CanvasPath() {
28 sk_path_.setIsVolatile(
35void CanvasPath::resetVolatility() {
40 return static_cast<int>(sk_path_.getFillType());
44 sk_path_.setFillType(
static_cast<SkPathFillType
>(fill_type));
130 SafeNarrow(startAngle) * 180.0f /
static_cast<float>(M_PI),
131 SafeNarrow(sweepAngle) * 180.0f /
static_cast<float>(M_PI),
140 double xAxisRotation,
142 bool isClockwiseDirection) {
143 const auto arcSize = isLargeArc ? SkPath::ArcSize::kLarge_ArcSize
144 : SkPath::ArcSize::kSmall_ArcSize;
145 const auto direction =
146 isClockwiseDirection ? SkPathDirection::kCW : SkPathDirection::kCCW;
149 SafeNarrow(xAxisRotation), arcSize, direction,
158 double xAxisRotation,
160 bool isClockwiseDirection) {
161 const auto arcSize = isLargeArc ? SkPath::ArcSize::kLarge_ArcSize
162 : SkPath::ArcSize::kSmall_ArcSize;
163 const auto direction =
164 isClockwiseDirection ? SkPathDirection::kCW : SkPathDirection::kCCW;
166 SafeNarrow(xAxisRotation), arcSize, direction,
191 SafeNarrow(startAngle) * 180.0f /
static_cast<float>(M_PI),
192 SafeNarrow(sweepAngle) * 180.0f /
static_cast<float>(M_PI));
197 SkSpan<const SkPoint> ptsSpan = {
198 reinterpret_cast<const SkPoint*
>(
points.data()),
199 points.num_elements() / 2};
200 sk_path_.addPoly(ptsSpan,
close);
220 Dart_ThrowException(ToDart(
"Path.addPath called with non-genuine Path."));
224 SkPath::kAppend_AddPathMode);
231 Dart_Handle matrix4_handle) {
232 tonic::Float64List matrix4(matrix4_handle);
237 ToDart(
"Path.addPathWithMatrix called with non-genuine Path."));
243 matrix.setTranslateX(matrix.getTranslateX() +
SafeNarrow(dx));
244 matrix.setTranslateY(matrix.getTranslateY() +
SafeNarrow(dy));
245 sk_path_.addPath(
path->sk_path_, matrix, SkPath::kAppend_AddPathMode);
252 ToDart(
"Path.extendWithPath called with non-genuine Path."));
256 SkPath::kExtend_AddPathMode);
263 Dart_Handle matrix4_handle) {
264 tonic::Float64List matrix4(matrix4_handle);
269 ToDart(
"Path.addPathWithMatrix called with non-genuine Path."));
275 matrix.setTranslateX(matrix.getTranslateX() +
SafeNarrow(dx));
276 matrix.setTranslateY(matrix.getTranslateY() +
SafeNarrow(dy));
277 sk_path_.addPath(
path->sk_path_, matrix, SkPath::kExtend_AddPathMode);
297 auto& other_mutable_path =
path->sk_path_;
303 Dart_Handle matrix4_handle) {
304 tonic::Float64List matrix4(matrix4_handle);
308 auto& other_mutable_path =
path->sk_path_;
309 sk_path_.transform(
sk_matrix, &other_mutable_path);
313 tonic::Float32List rect(Dart_NewTypedData(Dart_TypedData_kFloat32, 4));
314 const SkRect& bounds = sk_path_.getBounds();
315 rect[0] = bounds.left();
316 rect[1] = bounds.top();
317 rect[2] = bounds.right();
318 rect[3] = bounds.bottom();
323 bool result =
Op(path1->sk_path_, path2->sk_path_,
324 static_cast<SkPathOp
>(operation), &sk_path_);
333 path->sk_path_ = this->sk_path_;
337 if (!dl_path_.has_value()) {
338 dl_path_.emplace(sk_path_);
340 return dl_path_.value();
void moveTo(double x, double y)
tonic::Float32List getBounds()
void shift(Dart_Handle path_handle, double dx, double dy)
static fml::RefPtr< CanvasPath > Create(Dart_Handle wrapper)
const DlPath & path() const
void relativeLineTo(double x, double y)
void clone(Dart_Handle path_handle)
void addRect(double left, double top, double right, double bottom)
void relativeQuadraticBezierTo(double x1, double y1, double x2, double y2)
void relativeArcToPoint(double arcEndDeltaX, double arcEndDeltaY, double radiusX, double radiusY, double xAxisRotation, bool isLargeArc, bool isClockwiseDirection)
void conicTo(double x1, double y1, double x2, double y2, double w)
void addPathWithMatrix(CanvasPath *path, double dx, double dy, Dart_Handle matrix4_handle)
bool contains(double x, double y)
void addRSuperellipse(const RSuperellipse *rse)
void addArc(double left, double top, double right, double bottom, double startAngle, double sweepAngle)
void relativeConicTo(double x1, double y1, double x2, double y2, double w)
void relativeMoveTo(double x, double y)
void lineTo(double x, double y)
void cubicTo(double x1, double y1, double x2, double y2, double x3, double y3)
void quadraticBezierTo(double x1, double y1, double x2, double y2)
bool op(CanvasPath *path1, CanvasPath *path2, int operation)
void arcToPoint(double arcEndX, double arcEndY, double radiusX, double radiusY, double xAxisRotation, bool isLargeArc, bool isClockwiseDirection)
void extendWithPath(CanvasPath *path, double dx, double dy)
void relativeCubicTo(double x1, double y1, double x2, double y2, double x3, double y3)
void addPolygon(const tonic::Float32List &points, bool close)
void addPath(CanvasPath *path, double dx, double dy)
void extendWithPathAndMatrix(CanvasPath *path, double dx, double dy, Dart_Handle matrix4_handle)
void addRRect(const RRect &rrect)
void setFillType(int fill_type)
void transform(Dart_Handle path_handle, Dart_Handle matrix4_handle)
void addOval(double left, double top, double right, double bottom)
void arcTo(double left, double top, double right, double bottom, double startAngle, double sweepAngle, bool forceMoveTo)
DlPathBuilder & AddRoundSuperellipse(const DlRoundSuperellipse &rse)
Append a closed rounded super-ellipse contour to the path.
const DlPath TakePath()
Returns the path constructed by this path builder and resets its internal state to the default state ...
const SkPath & GetSkPath() const
flutter::DlRect bounds() const
impeller::RoundingRadii radii() const
static UIDartState * Current()
#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName)
void Op(SkPath *one, SkPath *two, SkPathOp op)
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
SkMatrix ToSkMatrix(const DlMatrix &matrix)
static float SafeNarrow(double value)
const SkRRect ToSkRRect(const DlRoundRect &round_rect)
Dart_Handle ToDart(const T &object)
static RoundSuperellipse MakeRectRadii(const Rect &rect, const RoundingRadii &radii)
std::vector< Point > points