Flutter Engine
The Flutter Engine
Functions
path.cpp File Reference
#include "export.h"
#include "helpers.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/pathops/SkPathOps.h"

Go to the source code of this file.

Functions

SKWASM_EXPORT SkPathpath_create ()
 
SKWASM_EXPORT void path_dispose (SkPath *path)
 
SKWASM_EXPORT SkPathpath_copy (SkPath *path)
 
SKWASM_EXPORT void path_setFillType (SkPath *path, SkPathFillType fillType)
 
SKWASM_EXPORT SkPathFillType path_getFillType (SkPath *path)
 
SKWASM_EXPORT void path_moveTo (SkPath *path, SkScalar x, SkScalar y)
 
SKWASM_EXPORT void path_relativeMoveTo (SkPath *path, SkScalar x, SkScalar y)
 
SKWASM_EXPORT void path_lineTo (SkPath *path, SkScalar x, SkScalar y)
 
SKWASM_EXPORT void path_relativeLineTo (SkPath *path, SkScalar x, SkScalar y)
 
SKWASM_EXPORT void path_quadraticBezierTo (SkPath *path, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
 
SKWASM_EXPORT void path_relativeQuadraticBezierTo (SkPath *path, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
 
SKWASM_EXPORT void path_cubicTo (SkPath *path, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
 
SKWASM_EXPORT void path_relativeCubicTo (SkPath *path, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
 
SKWASM_EXPORT void path_conicTo (SkPath *path, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
 
SKWASM_EXPORT void path_relativeConicTo (SkPath *path, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
 
SKWASM_EXPORT void path_arcToOval (SkPath *path, const SkRect *rect, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
 
SKWASM_EXPORT void path_arcToRotated (SkPath *path, SkScalar rx, SkScalar ry, SkScalar xAxisRotate, SkPath::ArcSize arcSize, SkPathDirection pathDirection, SkScalar x, SkScalar y)
 
SKWASM_EXPORT void path_relativeArcToRotated (SkPath *path, SkScalar rx, SkScalar ry, SkScalar xAxisRotate, SkPath::ArcSize arcSize, SkPathDirection pathDirection, SkScalar x, SkScalar y)
 
SKWASM_EXPORT void path_addRect (SkPath *path, const SkRect *rect)
 
SKWASM_EXPORT void path_addOval (SkPath *path, const SkRect *oval)
 
SKWASM_EXPORT void path_addArc (SkPath *path, const SkRect *oval, SkScalar startAngle, SkScalar sweepAngle)
 
SKWASM_EXPORT void path_addPolygon (SkPath *path, const SkPoint *points, int count, bool close)
 
SKWASM_EXPORT void path_addRRect (SkPath *path, const SkScalar *rrectValues)
 
SKWASM_EXPORT void path_addPath (SkPath *path, const SkPath *other, const SkScalar *matrix33, SkPath::AddPathMode extendPath)
 
SKWASM_EXPORT void path_close (SkPath *path)
 
SKWASM_EXPORT void path_reset (SkPath *path)
 
SKWASM_EXPORT bool path_contains (SkPath *path, SkScalar x, SkScalar y)
 
SKWASM_EXPORT void path_transform (SkPath *path, const SkScalar *matrix33)
 
SKWASM_EXPORT void path_getBounds (SkPath *path, SkRect *rect)
 
SKWASM_EXPORT SkPathpath_combine (SkPathOp operation, const SkPath *path1, const SkPath *path2)
 

Function Documentation

◆ path_addArc()

SKWASM_EXPORT void path_addArc ( SkPath path,
const SkRect oval,
SkScalar  startAngle,
SkScalar  sweepAngle 
)

Definition at line 140 of file path.cpp.

143 {
144 path->addArc(*oval, startAngle, sweepAngle);
145}
SkRect oval
Definition: SkRecords.h:249
SkScalar startAngle
Definition: SkRecords.h:250
SkScalar sweepAngle
Definition: SkRecords.h:251
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
Definition: switches.h:57

◆ path_addOval()

SKWASM_EXPORT void path_addOval ( SkPath path,
const SkRect oval 
)

Definition at line 136 of file path.cpp.

136 {
137 path->addOval(*oval, SkPathDirection::kCW, 1);
138}

◆ path_addPath()

SKWASM_EXPORT void path_addPath ( SkPath path,
const SkPath other,
const SkScalar matrix33,
SkPath::AddPathMode  extendPath 
)

Definition at line 158 of file path.cpp.

161 {
162 path->addPath(*other, createMatrix(matrix33), extendPath);
163}
SkMatrix createMatrix(const SkScalar *f)
Definition: helpers.h:14

◆ path_addPolygon()

SKWASM_EXPORT void path_addPolygon ( SkPath path,
const SkPoint points,
int  count,
bool  close 
)

Definition at line 147 of file path.cpp.

150 {
151 path->addPoly(points, count, close);
152}
int count
Definition: FontMgrTest.cpp:50
static const int points[]

◆ path_addRect()

SKWASM_EXPORT void path_addRect ( SkPath path,
const SkRect rect 
)

Definition at line 132 of file path.cpp.

132 {
133 path->addRect(*rect);
134}
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ path_addRRect()

SKWASM_EXPORT void path_addRRect ( SkPath path,
const SkScalar rrectValues 
)

Definition at line 154 of file path.cpp.

154 {
155 path->addRRect(createRRect(rrectValues), SkPathDirection::kCW);
156}
SkRRect createRRect(const SkScalar *f)
Definition: helpers.h:19

◆ path_arcToOval()

SKWASM_EXPORT void path_arcToOval ( SkPath path,
const SkRect rect,
SkScalar  startAngle,
SkScalar  sweepAngle,
bool  forceMoveTo 
)

Definition at line 102 of file path.cpp.

106 {
107 path->arcTo(*rect, startAngle, sweepAngle, forceMoveTo);
108}

◆ path_arcToRotated()

SKWASM_EXPORT void path_arcToRotated ( SkPath path,
SkScalar  rx,
SkScalar  ry,
SkScalar  xAxisRotate,
SkPath::ArcSize  arcSize,
SkPathDirection  pathDirection,
SkScalar  x,
SkScalar  y 
)

Definition at line 110 of file path.cpp.

117 {
118 path->arcTo(rx, ry, xAxisRotate, arcSize, pathDirection, x, y);
119}
double y
double x

◆ path_close()

SKWASM_EXPORT void path_close ( SkPath path)

Definition at line 165 of file path.cpp.

165 {
166 path->close();
167}

◆ path_combine()

SKWASM_EXPORT SkPath * path_combine ( SkPathOp  operation,
const SkPath path1,
const SkPath path2 
)

Definition at line 185 of file path.cpp.

187 {
188 SkPath* output = new SkPath();
189 if (Op(*path1, *path2, operation, output)) {
190 output->setFillType(path1->getFillType());
191 return output;
192 } else {
193 delete output;
194 return nullptr;
195 }
196}
static SkPath path1()
static SkPath path2()
static void operation(T operation, uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint8_t s, uint32_t t)
Definition: SkMD5.cpp:144
Definition: SkPath.h:59
SkPathFillType getFillType() const
Definition: SkPath.h:230

◆ path_conicTo()

SKWASM_EXPORT void path_conicTo ( SkPath path,
SkScalar  x1,
SkScalar  y1,
SkScalar  x2,
SkScalar  y2,
SkScalar  w 
)

Definition at line 84 of file path.cpp.

89 {
90 path->conicTo(x1, y1, x2, y2, w);
91}
SkScalar w

◆ path_contains()

SKWASM_EXPORT bool path_contains ( SkPath path,
SkScalar  x,
SkScalar  y 
)

Definition at line 173 of file path.cpp.

173 {
174 return path->contains(x, y);
175}

◆ path_copy()

SKWASM_EXPORT SkPath * path_copy ( SkPath path)

Definition at line 20 of file path.cpp.

20 {
21 return new SkPath(*path);
22}

◆ path_create()

SKWASM_EXPORT SkPath * path_create ( )

Definition at line 12 of file path.cpp.

12 {
13 return new SkPath();
14}

◆ path_cubicTo()

SKWASM_EXPORT void path_cubicTo ( SkPath path,
SkScalar  x1,
SkScalar  y1,
SkScalar  x2,
SkScalar  y2,
SkScalar  x3,
SkScalar  y3 
)

Definition at line 64 of file path.cpp.

70 {
71 path->cubicTo(x1, y1, x2, y2, x3, y3);
72}

◆ path_dispose()

SKWASM_EXPORT void path_dispose ( SkPath path)

Definition at line 16 of file path.cpp.

16 {
17 delete path;
18}

◆ path_getBounds()

SKWASM_EXPORT void path_getBounds ( SkPath path,
SkRect rect 
)

Definition at line 181 of file path.cpp.

181 {
182 *rect = path->getBounds();
183}

◆ path_getFillType()

SKWASM_EXPORT SkPathFillType path_getFillType ( SkPath path)

Definition at line 28 of file path.cpp.

28 {
29 return path->getFillType();
30}

◆ path_lineTo()

SKWASM_EXPORT void path_lineTo ( SkPath path,
SkScalar  x,
SkScalar  y 
)

Definition at line 40 of file path.cpp.

40 {
41 path->lineTo(x, y);
42}

◆ path_moveTo()

SKWASM_EXPORT void path_moveTo ( SkPath path,
SkScalar  x,
SkScalar  y 
)

Definition at line 32 of file path.cpp.

32 {
33 path->moveTo(x, y);
34}

◆ path_quadraticBezierTo()

SKWASM_EXPORT void path_quadraticBezierTo ( SkPath path,
SkScalar  x1,
SkScalar  y1,
SkScalar  x2,
SkScalar  y2 
)

Definition at line 48 of file path.cpp.

52 {
53 path->quadTo(x1, y1, x2, y2);
54}

◆ path_relativeArcToRotated()

SKWASM_EXPORT void path_relativeArcToRotated ( SkPath path,
SkScalar  rx,
SkScalar  ry,
SkScalar  xAxisRotate,
SkPath::ArcSize  arcSize,
SkPathDirection  pathDirection,
SkScalar  x,
SkScalar  y 
)

Definition at line 121 of file path.cpp.

128 {
129 path->rArcTo(rx, ry, xAxisRotate, arcSize, pathDirection, x, y);
130}

◆ path_relativeConicTo()

SKWASM_EXPORT void path_relativeConicTo ( SkPath path,
SkScalar  x1,
SkScalar  y1,
SkScalar  x2,
SkScalar  y2,
SkScalar  w 
)

Definition at line 93 of file path.cpp.

98 {
99 path->rConicTo(x1, y1, x2, y2, w);
100}

◆ path_relativeCubicTo()

SKWASM_EXPORT void path_relativeCubicTo ( SkPath path,
SkScalar  x1,
SkScalar  y1,
SkScalar  x2,
SkScalar  y2,
SkScalar  x3,
SkScalar  y3 
)

Definition at line 74 of file path.cpp.

80 {
81 path->rCubicTo(x1, y1, x2, y2, x3, y3);
82}

◆ path_relativeLineTo()

SKWASM_EXPORT void path_relativeLineTo ( SkPath path,
SkScalar  x,
SkScalar  y 
)

Definition at line 44 of file path.cpp.

44 {
45 path->rLineTo(x, y);
46}

◆ path_relativeMoveTo()

SKWASM_EXPORT void path_relativeMoveTo ( SkPath path,
SkScalar  x,
SkScalar  y 
)

Definition at line 36 of file path.cpp.

36 {
37 path->rMoveTo(x, y);
38}

◆ path_relativeQuadraticBezierTo()

SKWASM_EXPORT void path_relativeQuadraticBezierTo ( SkPath path,
SkScalar  x1,
SkScalar  y1,
SkScalar  x2,
SkScalar  y2 
)

Definition at line 56 of file path.cpp.

60 {
61 path->rQuadTo(x1, y1, x2, y2);
62}

◆ path_reset()

SKWASM_EXPORT void path_reset ( SkPath path)

Definition at line 169 of file path.cpp.

169 {
170 path->reset();
171}

◆ path_setFillType()

SKWASM_EXPORT void path_setFillType ( SkPath path,
SkPathFillType  fillType 
)

Definition at line 24 of file path.cpp.

24 {
25 path->setFillType(fillType);
26}

◆ path_transform()

SKWASM_EXPORT void path_transform ( SkPath path,
const SkScalar matrix33 
)

Definition at line 177 of file path.cpp.

177 {
178 path->transform(createMatrix(matrix33));
179}