8 #ifndef SkPathBuilder_DEFINED
9 #define SkPathBuilder_DEFINED
18 #include "include/private/SkPathRef.h"
19 #include "include/private/base/SkTo.h"
21 #include <initializer_list>
64 return this->conicTo(pts[0], pts[1], w);
72 return this->cubicTo(pts[0], pts[1], pts[2]);
80 return this->polylineTo(list.begin(), SkToInt(list.size()));
89 return this->rQuadTo({x1, y1}, {x2, y2});
93 return this->rConicTo({x1, y1}, {x2, y2}, w);
97 return this->rCubicTo({x1, y1}, {x2, y2}, {x3, y3});
195 return this->addRect(rect, dir, 0);
199 return this->addOval(rect, dir, 1);
211 return this->addPolygon(list.begin(), SkToInt(list.size()), isClosed);
220 this->incReserve(extraPtCount, extraPtCount);
231 SkPathRef::PointsArray fPts;
232 SkPathRef::VerbsArray fVerbs;
233 SkPathRef::ConicWeightsArray fConicWeights;
238 unsigned fSegmentMask;
239 SkPoint fLastMovePoint;
249 IsA fIsA = kIsA_JustMoves;
251 bool fIsACCW =
false;
253 int countVerbs()
const {
return fVerbs.size(); }
257 fIsA = kIsA_MoreThanMoves;
258 if (fNeedsMoveVerb) {
259 this->moveTo(fLastMovePoint);
267 friend class SkPathPriv;
SkPathDirection
Definition: SkPathTypes.h:34
@ kCW
clockwise direction for adding closed contours
SkPathFillType
Definition: SkPathTypes.h:11
float SkScalar
Definition: SkScalar.h:14
Definition: SkPathBuilder.h:25
SkPathBuilder & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition: SkPathBuilder.h:68
SkPathBuilder & arcTo(const SkRect &oval, SkScalar startAngleDeg, SkScalar sweepAngleDeg, bool forceMoveTo)
Appends arc to the builder.
SkPathBuilder & conicTo(const SkPoint pts[2], SkScalar w)
Definition: SkPathBuilder.h:63
SkRect computeBounds() const
SkPathBuilder & operator=(const SkPathBuilder &)=default
SkPathBuilder & rCubicTo(SkPoint pt1, SkPoint pt2, SkPoint pt3)
SkPathBuilder & addCircle(SkScalar center_x, SkScalar center_y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
SkPathBuilder & arcTo(SkPoint p1, SkPoint p2, SkScalar radius)
Appends arc to SkPath, after appending line if needed.
SkPathBuilder & arcTo(SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, SkPathDirection sweep, SkPoint xy)
Appends arc to SkPath.
SkPathBuilder & addPolygon(const std::initializer_list< SkPoint > &list, bool isClosed)
Definition: SkPathBuilder.h:210
SkPathBuilder(const SkPathBuilder &)=default
SkPathBuilder & addRRect(const SkRRect &rrect, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPathBuilder.h:201
SkPathBuilder & rConicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
Definition: SkPathBuilder.h:92
SkPathBuilder & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
Definition: SkPathBuilder.h:54
SkPathBuilder & polylineTo(const std::initializer_list< SkPoint > &list)
Definition: SkPathBuilder.h:79
void incReserve(int extraPtCount)
Definition: SkPathBuilder.h:219
SkPathBuilder & quadTo(const SkPoint pts[2])
Definition: SkPathBuilder.h:57
SkPathBuilder & operator=(const SkPath &)
SkPathBuilder & rQuadTo(SkPoint pt1, SkPoint pt2)
SkPathBuilder & rCubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition: SkPathBuilder.h:96
SkPathBuilder & offset(SkScalar dx, SkScalar dy)
SkPathBuilder & addRect(const SkRect &rect, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPathBuilder.h:194
SkPathBuilder & lineTo(SkScalar x, SkScalar y)
Definition: SkPathBuilder.h:51
SkPathBuilder & rConicTo(SkPoint p1, SkPoint p2, SkScalar w)
SkPathFillType fillType() const
Definition: SkPathBuilder.h:36
SkPathBuilder & polylineTo(const SkPoint pts[], int count)
SkPathBuilder & conicTo(SkPoint pt1, SkPoint pt2, SkScalar w)
SkPathBuilder & rQuadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
Definition: SkPathBuilder.h:88
SkPathBuilder & addPolygon(const SkPoint pts[], int count, bool isClosed)
void incReserve(int extraPtCount, int extraVerbCount)
SkPathBuilder & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
Definition: SkPathBuilder.h:60
SkPathBuilder & toggleInverseFillType()
Definition: SkPathBuilder.h:225
SkPathBuilder & addRect(const SkRect &, SkPathDirection, unsigned startIndex)
SkPathBuilder & addOval(const SkRect &rect, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPathBuilder.h:197
SkPathBuilder & addArc(const SkRect &oval, SkScalar startAngleDeg, SkScalar sweepAngleDeg)
Appends arc to the builder, as the start of new contour.
SkPathBuilder & setFillType(SkPathFillType ft)
Definition: SkPathBuilder.h:42
SkPathBuilder & setIsVolatile(bool isVolatile)
Definition: SkPathBuilder.h:43
SkPathBuilder & quadTo(SkPoint pt1, SkPoint pt2)
SkPathBuilder & cubicTo(const SkPoint pts[3])
Definition: SkPathBuilder.h:71
SkPathBuilder & rLineTo(SkScalar x, SkScalar y)
Definition: SkPathBuilder.h:86
SkPathBuilder & lineTo(SkPoint pt)
SkPathBuilder(SkPathFillType)
SkPathBuilder & addRRect(const SkRRect &, SkPathDirection, unsigned startIndex)
SkPathBuilder & cubicTo(SkPoint pt1, SkPoint pt2, SkPoint pt3)
SkPathBuilder & rLineTo(SkPoint pt)
SkPathBuilder & addOval(const SkRect &, SkPathDirection, unsigned startIndex)
SkPathBuilder & moveTo(SkPoint pt)
SkPathBuilder(const SkPath &)
SkPathBuilder & addPath(const SkPath &)
ArcSize
Definition: SkPathBuilder.h:141
@ kSmall_ArcSize
smaller of arc pair
Definition: SkPathBuilder.h:142
@ kLarge_ArcSize
larger of arc pair
Definition: SkPathBuilder.h:143
SkPathBuilder & moveTo(SkScalar x, SkScalar y)
Definition: SkPathBuilder.h:48
SkPath contain geometry.
Definition: SkPath.h:58
SkRRect describes a rounded rectangle with a bounds and a pair of radii for each corner.
Definition: SkRRect.h:35
sk_sp< SkDrawLooper > SK_API Make(SkColor4f color, SkColorSpace *cs, SkScalar sigma, SkScalar dx, SkScalar dy)
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582