18 #include "include/private/base/SkDebug.h"
19 #include "include/private/base/SkTo.h"
20 #include "include/private/base/SkTypeTraits.h"
25 #include <initializer_list>
27 #include <type_traits>
33 enum class SkPathConvexity;
34 enum class SkPathFirstDirection;
35 struct SkPathVerbAnalysis;
80 const uint8_t[],
int verbCount,
81 const SkScalar[],
int conicWeightCount,
85 unsigned startIndex = 0);
97 bool isVolatile =
false);
99 static SkPath Polygon(
const std::initializer_list<SkPoint>& list,
bool isClosed,
101 bool isVolatile =
false) {
102 return Polygon(list.begin(), SkToInt(list.size()), isClosed, fillType, isVolatile);
106 return Polygon({a, b},
false);
223 fFillType = SkToU8(ft);
328 return SkToBool(fIsVolatile);
348 fIsVolatile = isVolatile;
380 const SkPoint& p3,
bool exact);
395 const SkPoint& p3,
const SkPoint& p4,
bool exact);
550 #ifdef SK_HIDE_PATH_EDIT_METHODS
570 return this->moveTo(p.fX, p.fY);
610 return this->lineTo(p.fX, p.fY);
662 return this->quadTo(p1.fX, p1.fY, p2.fX, p2.fY);
735 return this->conicTo(p1.fX, p1.fY, p2.fX, p2.fY, w);
799 return this->cubicTo(p1.fX, p1.fY, p2.fX, p2.fY, p3.fX, p3.fY);
891 return this->arcTo(p1.fX, p1.fY, p2.fX, p2.fY, radius);
955 return this->arcTo(r.fX, r.fY, xAxisRotate, largeArc, sweep, xy.fX, xy.fY);
1001 #ifdef SK_HIDE_PATH_EDIT_METHODS
1032 SkScalar w, SkPoint pts[],
int pow2);
1050 #ifdef SK_HIDE_PATH_EDIT_METHODS
1082 return this->addRect(rect, dir, 0);
1087 return this->addRect({left, top, right, bottom}, dir, 0);
1239 return this->addPoly(list.begin(), SkToInt(list.size()), close);
1242 #ifdef SK_HIDE_PATH_EDIT_METHODS
1291 return this->addPath(src, m, mode);
1336 this->offset(dx, dy,
this);
1362 this->transform(matrix,
this, pc);
1368 this->transform(m, &dst, pc);
1402 this->setLastPt(p.fX, p.fY);
1437 kDone_Verb = kClose_Verb + 1
1524 const SkPoint* fPts;
1525 const uint8_t* fVerbs;
1526 const uint8_t* fVerbStop;
1534 Verb autoClose(SkPoint pts[2]);
1546 RangeIter() =
default;
1547 RangeIter(
const uint8_t* verbs,
const SkPoint* points,
const SkScalar* weights)
1548 : fVerb(verbs), fPoints(points), fWeights(weights) {
1549 SkDEBUGCODE(fInitialPoints = fPoints;)
1551 bool operator!=(
const RangeIter& that)
const {
1552 return fVerb != that.fVerb;
1554 bool operator==(
const RangeIter& that)
const {
1555 return fVerb == that.fVerb;
1557 RangeIter& operator++() {
1558 auto verb =
static_cast<SkPathVerb>(*fVerb++);
1559 fPoints += pts_advance_after_verb(verb);
1565 RangeIter operator++(
int) {
1566 RangeIter copy = *
this;
1573 std::tuple<SkPathVerb, const SkPoint*, const SkScalar*> operator*()
const {
1578 int backset = pts_backset_for_verb(verb);
1579 SkASSERT(fPoints + backset >= fInitialPoints);
1580 return {verb, fPoints + backset, fWeights};
1583 constexpr
static int pts_advance_after_verb(
SkPathVerb verb) {
1594 constexpr
static int pts_backset_for_verb(
SkPathVerb verb) {
1605 const uint8_t* fVerb =
nullptr;
1606 const SkPoint* fPoints =
nullptr;
1607 const SkScalar* fWeights =
nullptr;
1608 SkDEBUGCODE(
const SkPoint* fInitialPoints =
nullptr;)
1655 return (fIter != fEnd) ?
static_cast<Verb>(std::get<0>(*fIter)) : kDone_Verb;
1666 return fConicWeight;
1780 SkPathFirstDirection firstDirection);
1783 int fLastMoveToIndex;
1784 mutable std::atomic<uint8_t> fConvexity;
1785 mutable std::atomic<uint8_t> fFirstDirection;
1786 uint8_t fFillType : 2;
1787 uint8_t fIsVolatile : 1;
1801 void copyFields(
const SkPath& that);
1803 size_t writeToMemoryAsRRect(
void* buffer)
const;
1804 size_t readAsRRect(
const void*,
size_t);
1805 size_t readFromMemory_EQ4Or5(
const void*,
size_t);
1808 friend class SkPathPriv;
1809 friend class SkPathStroker;
1823 inline void injectMoveToIfNeeded();
1825 inline bool hasOnlyMoveTos()
const;
1827 SkPathConvexity computeConvexity()
const;
1829 bool isValidImpl()
const;
1834 void validate()
const;
1835 void validateRef()
const;
1839 bool isZeroLengthSincePoint(
int startPtIndex)
const;
1844 bool hasComputedBounds()
const;
1847 void setBounds(
const SkRect& rect);
1851 SkPath& dirtyAfterEdit();
1855 void setConvexity(SkPathConvexity)
const;
1857 void setFirstDirection(SkPathFirstDirection)
const;
1858 SkPathFirstDirection getFirstDirection()
const;
1863 SkPathConvexity getConvexity()
const;
1865 SkPathConvexity getConvexityOrUnknown()
const;
1868 bool isConvexityAccurate()
const;
1876 void setConvexity(SkPathConvexity convexity);
1888 static SkPath MakeInternal(
const SkPathVerbAnalysis& analsis,
1889 const SkPoint points[],
1890 const uint8_t verbs[],
1896 friend class SkAutoPathBoundsUpdate;
1897 friend class SkAutoDisableOvalCheck;
1898 friend class SkAutoDisableDirectionCheck;
1900 friend class SkPathEdgeIter;
1901 friend class SkPathWriter;
1903 friend class SkBench_AddPathTest;
1904 friend class PathTest_Private;
1905 friend class ForceIsRRect_Private;
1906 friend class FuzzPath;
SkApplyPerspectiveClip
When we transform points through a matrix containing perspective (the bottom row is something other t...
Definition: SkMatrix.h:34
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
@ kCubic_SkPathSegmentMask
Definition: SkPathTypes.h:45
@ kConic_SkPathSegmentMask
Definition: SkPathTypes.h:44
@ kQuad_SkPathSegmentMask
Definition: SkPathTypes.h:43
@ kLine_SkPathSegmentMask
Definition: SkPathTypes.h:42
static bool SkPathFillType_IsInverse(SkPathFillType ft)
Definition: SkPathTypes.h:26
SkPathDirection
Definition: SkPathTypes.h:34
@ kCW
clockwise direction for adding closed contours
SkPathFillType
Definition: SkPathTypes.h:11
@ kWinding
Specifies that "inside" is computed by a non-zero sum of signed edge crossings.
SkPathVerb
Definition: SkPathTypes.h:48
@ kClose
SkPath::RawIter returns 0 points.
@ kCubic
SkPath::RawIter returns 4 points.
@ kConic
SkPath::RawIter returns 3 points + 1 weight.
@ kQuad
SkPath::RawIter returns 3 points.
@ kMove
SkPath::RawIter returns 1 point.
@ kLine
SkPath::RawIter returns 2 points.
bool operator!=(const sk_sp< T > &a, const sk_sp< U > &b)
Definition: SkRefCnt.h:355
bool operator==(const sk_sp< T > &a, const sk_sp< U > &b)
Definition: SkRefCnt.h:345
float SkScalar
Definition: SkScalar.h:14
SkData holds an immutable data buffer.
Definition: SkData.h:25
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:53
SkMatrix & reset()
Sets SkMatrix to identity; which has no effect on mapped SkPoint.
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Sets SkMatrix to scale by (sx, sy).
Definition: SkMatrix.h:74
Perform a series of path operations, optimized for unioning many paths together.
Definition: SkPathOps.h:86
Definition: SkPathBuilder.h:25
Iterates through verb array, and associated SkPoint array and conic weight.
Definition: SkPath.h:1445
bool isClosedContour() const
Returns true if subsequent calls to next() return kClose_Verb before returning kMove_Verb.
void setPath(const SkPath &path, bool forceClose)
Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path.
Verb next(SkPoint pts[4])
Returns next SkPath::Verb in verb array, and advances SkPath::Iter.
SkScalar conicWeight() const
Returns conic weight if next() returned kConic_Verb.
Definition: SkPath.h:1500
Iter()
Initializes SkPath::Iter with an empty SkPath.
Iter(const SkPath &path, bool forceClose)
Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path.
bool isCloseLine() const
Returns true if last kLine_Verb returned by next() was generated by kClose_Verb.
Definition: SkPath.h:1511
Use Iter instead.
Definition: SkPath.h:1615
SkScalar conicWeight() const
Returns conic weight if next() returned kConic_Verb.
Definition: SkPath.h:1665
RawIter(const SkPath &path)
Sets RawIter to return elements of verb array, SkPoint array, and conic weight in path.
Definition: SkPath.h:1630
RawIter()
Initializes RawIter with an empty SkPath.
Definition: SkPath.h:1623
Verb peek() const
Returns next SkPath::Verb, but does not advance RawIter.
Definition: SkPath.h:1654
Verb next(SkPoint[4])
Returns next SkPath::Verb in verb array, and advances RawIter.
void setPath(const SkPath &)
Sets SkPath::Iter to return elements of verb array, SkPoint array, and conic weight in path.
SkPath contain geometry.
Definition: SkPath.h:58
SegmentMask
Definition: SkPath.h:1409
bool isEmpty() const
Returns if SkPath is empty.
size_t readFromMemory(const void *buffer, size_t length)
Initializes SkPath from buffer of size length.
void dumpArrays() const
Definition: SkPath.h:1704
bool isInverseFillType() const
Returns if FillType describes area outside SkPath geometry.
Definition: SkPath.h:231
uint32_t getGenerationID() const
(See Skia bug 1762.) Returns a non-zero, globally unique value.
SkPath & operator=(const SkPath &path)
Constructs a copy of an existing path.
static SkPath Oval(const SkRect &, SkPathDirection=SkPathDirection::kCW)
SkPath & conicTo(const SkPoint &p1, const SkPoint &p2, SkScalar w)
Adds conic from last point towards SkPoint p1, to SkPoint p2, weighted by w.
Definition: SkPath.h:734
SkPath & rMoveTo(SkScalar dx, SkScalar dy)
Adds beginning of contour relative to last point.
void offset(SkScalar dx, SkScalar dy, SkPath *dst) const
Offsets SkPoint array by (dx, dy).
SkPath & rQuadTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2)
Adds quad from last point towards vector (dx1, dy1), to vector (dx2, dy2).
int countPoints() const
Returns the number of points in SkPath.
SkPath()
Constructs an empty SkPath.
bool conservativelyContainsRect(const SkRect &rect) const
Returns true if rect is contained by SkPath.
void setLastPt(SkScalar x, SkScalar y)
Sets last point to (x, y).
static bool IsQuadDegenerate(const SkPoint &p1, const SkPoint &p2, const SkPoint &p3, bool exact)
Tests if quad is degenerate.
bool isFinite() const
Returns true for finite SkPoint array values between negative SK_ScalarMax and positive SK_ScalarMax.
SkPath & lineTo(const SkPoint &p)
Adds line from last point to SkPoint p.
Definition: SkPath.h:609
SkPoint getPoint(int index) const
Returns SkPoint at index in SkPoint array.
SkPath & arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, SkPathDirection sweep, SkScalar x, SkScalar y)
Appends arc to SkPath.
bool isLine(SkPoint line[2]) const
Returns true if SkPath contains only one line; SkPath::Verb array has two entries: kMove_Verb,...
friend SK_API bool operator==(const SkPath &a, const SkPath &b)
Compares a and b; returns true if SkPath::FillType, verb array, SkPoint array, and weights are equiva...
SkPath & addCircle(SkScalar x, SkScalar y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb, four kConic_Verb,...
void incReserve(int extraPtCount)
Grows SkPath verb array and SkPoint array to contain extraPtCount additional SkPoint.
SkPath & addRect(const SkRect &rect, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPath.h:1081
bool getLastPt(SkPoint *lastPt) const
Returns last point on SkPath in lastPt.
SkPath & addOval(const SkRect &oval, SkPathDirection dir, unsigned start)
Adds oval to SkPath, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
static SkPath Circle(SkScalar center_x, SkScalar center_y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
Adds a new contour to the path, defined by the rect, and wound in the specified direction.
SkPath & rCubicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar dx3, SkScalar dy3)
Adds cubic from last point towards vector (dx1, dy1), then towards vector (dx2, dy2),...
SkPath & close()
Appends kClose_Verb to SkPath.
SkPath & addPath(const SkPath &src, SkScalar dx, SkScalar dy, AddPathMode mode=kAppend_AddPathMode)
Appends src to SkPath, offset by (dx, dy).
SkPathFillType getFillType() const
Returns SkPathFillType, the rule used to fill SkPath.
Definition: SkPath.h:217
int getPoints(SkPoint points[], int max) const
Returns number of points in SkPath.
void setFillType(SkPathFillType ft)
Sets FillType, the rule used to fill SkPath.
Definition: SkPath.h:222
SkPath & addRRect(const SkRRect &rrect, SkPathDirection dir, unsigned start)
Adds rrect to SkPath, creating a new closed contour.
SkPath & rLineTo(SkScalar dx, SkScalar dy)
Adds line from last point to vector (dx, dy).
SkPath & arcTo(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
Appends arc to SkPath.
SkPath & lineTo(SkScalar x, SkScalar y)
Adds line from last point to (x, y).
friend bool operator!=(const SkPath &a, const SkPath &b)
Compares a and b; returns true if SkPath::FillType, verb array, SkPoint array, and weights are not eq...
Definition: SkPath.h:172
static SkPath Make(const SkPoint[], int pointCount, const uint8_t[], int verbCount, const SkScalar[], int conicWeightCount, SkPathFillType, bool isVolatile=false)
Create a new path with the specified segments.
void toggleInverseFillType()
Replaces FillType with its inverse.
Definition: SkPath.h:236
SkPath & setIsVolatile(bool isVolatile)
Specifies whether SkPath is volatile; whether it will be altered or discarded by the caller after it ...
Definition: SkPath.h:347
SkRect computeTightBounds() const
Returns minimum and maximum axes values of the lines and curves in SkPath.
size_t approximateBytesUsed() const
Returns the approximate byte size of the SkPath in memory.
SkPath & addArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle)
Appends arc to SkPath, as the start of new contour.
void offset(SkScalar dx, SkScalar dy)
Offsets SkPoint array by (dx, dy).
Definition: SkPath.h:1335
SkPath & reset()
Sets SkPath to its initial state.
~SkPath()
Releases ownership of any shared data and deletes data if SkPath is sole owner.
void updateBoundsCache() const
Updates internal bounds so that subsequent calls to getBounds() are instantaneous.
Definition: SkPath.h:501
bool isVolatile() const
Returns true if the path is volatile; it will not be altered or discarded by the caller after it is d...
Definition: SkPath.h:327
SkPath & moveTo(SkScalar x, SkScalar y)
Adds beginning of contour at SkPoint (x, y).
void dump() const
Definition: SkPath.h:1699
SkPath & addOval(const SkRect &oval, SkPathDirection dir=SkPathDirection::kCW)
Adds oval to path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
bool isInterpolatable(const SkPath &compare) const
Returns true if SkPath contain equal verbs and equal weights.
bool interpolate(const SkPath &ending, SkScalar weight, SkPath *out) const
Interpolates between SkPath with SkPoint array of equal size.
std::true_type sk_is_trivially_relocatable
Definition: SkPath.h:1776
SkPath makeScale(SkScalar sx, SkScalar sy)
Definition: SkPath.h:1372
static SkPath Polygon(const std::initializer_list< SkPoint > &list, bool isClosed, SkPathFillType fillType=SkPathFillType::kWinding, bool isVolatile=false)
Definition: SkPath.h:99
void setLastPt(const SkPoint &p)
Sets the last point on the path.
Definition: SkPath.h:1401
SkPath & moveTo(const SkPoint &p)
Adds beginning of contour at SkPoint p.
Definition: SkPath.h:569
static int ConvertConicToQuads(const SkPoint &p0, const SkPoint &p1, const SkPoint &p2, SkScalar w, SkPoint pts[], int pow2)
Approximates conic with quad array.
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at (x3,...
SkPath & rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, SkPathDirection sweep, SkScalar dx, SkScalar dy)
Appends arc to SkPath, relative to last SkPath SkPoint.
bool isOval(SkRect *bounds) const
Returns true if this path is recognized as an oval or circle.
void transform(const SkMatrix &matrix, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes)
Transforms verb array, SkPoint array, and weight by matrix.
Definition: SkPath.h:1360
SkPath & rewind()
Sets SkPath to its initial state, preserving internal storage.
SkPath & addRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, SkPathDirection dir=SkPathDirection::kCW)
Appends SkRRect to SkPath, creating a new closed contour.
static bool IsCubicDegenerate(const SkPoint &p1, const SkPoint &p2, const SkPoint &p3, const SkPoint &p4, bool exact)
Tests if cubic is degenerate.
int getVerbs(uint8_t verbs[], int max) const
Returns the number of verbs in the path.
SkPath & cubicTo(const SkPoint &p1, const SkPoint &p2, const SkPoint &p3)
Adds cubic from last point towards SkPoint p1, then towards SkPoint p2, ending at SkPoint p3.
Definition: SkPath.h:798
SkPath & quadTo(const SkPoint &p1, const SkPoint &p2)
Adds quad from last point towards SkPoint p1, to SkPoint p2.
Definition: SkPath.h:661
ArcSize
Definition: SkPath.h:898
@ kSmall_ArcSize
smaller of arc pair
Definition: SkPath.h:899
@ kLarge_ArcSize
larger of arc pair
Definition: SkPath.h:900
static SkPath RRect(const SkRRect &, SkPathDirection dir=SkPathDirection::kCW)
SkPath & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.
SkPath & addPath(const SkPath &src, AddPathMode mode=kAppend_AddPathMode)
Appends src to SkPath.
Definition: SkPath.h:1288
bool isConvex() const
Returns true if the path is convex.
SkPath & arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)
Appends arc to SkPath, after appending line if needed.
SkPath(const SkPath &path)
Constructs a copy of an existing path.
SkPath & rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar w)
Adds conic from last point towards vector (dx1, dy1), to vector (dx2, dy2), weighted by w.
sk_sp< SkData > serialize() const
Writes SkPath to buffer, returning the buffer written to, wrapped in SkData.
SkPath & reverseAddPath(const SkPath &src)
Appends src to SkPath, from back to front.
SkPath & addPoly(const SkPoint pts[], int count, bool close)
Adds contour created from line array, adding (count - 1) line segments.
AddPathMode
Definition: SkPath.h:1250
@ kExtend_AddPathMode
Extends the last contour of the destination path with the first countour of the source path,...
Definition: SkPath.h:1260
@ kAppend_AddPathMode
Contours are appended to the destination path as new contours.
Definition: SkPath.h:1253
uint32_t getSegmentMasks() const
Returns a mask, where each set bit corresponds to a SegmentMask constant if SkPath contains one or mo...
void dumpHex() const
Definition: SkPath.h:1700
SkPath & arcTo(const SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, SkPathDirection sweep, const SkPoint xy)
Appends arc to SkPath.
Definition: SkPath.h:953
size_t writeToMemory(void *buffer) const
Writes SkPath to buffer, returning the number of bytes written.
static SkPath Oval(const SkRect &, SkPathDirection, unsigned startIndex)
void dumpArrays(SkWStream *stream, bool dumpAsHex) const
SkPath & addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPath.h:1085
int countVerbs() const
Returns the number of verbs: kMove_Verb, kLine_Verb, kQuad_Verb, kConic_Verb, kCubic_Verb,...
Verb
Definition: SkPath.h:1430
const SkRect & getBounds() const
Returns minimum and maximum axes values of SkPoint array.
bool isLastContourClosed() const
Returns if contour is closed.
SkPath & addPoly(const std::initializer_list< SkPoint > &list, bool close)
Adds contour created from list.
Definition: SkPath.h:1238
static SkPath Polygon(const SkPoint pts[], int count, bool isClosed, SkPathFillType=SkPathFillType::kWinding, bool isVolatile=false)
bool isValid() const
Returns if SkPath data is consistent.
void swap(SkPath &other)
Exchanges the verb array, SkPoint array, weights, and SkPath::FillType with other.
static bool IsLineDegenerate(const SkPoint &p1, const SkPoint &p2, bool exact)
Tests if line between SkPoint pair is degenerate.
bool isRect(SkRect *rect, bool *isClosed=nullptr, SkPathDirection *direction=nullptr) const
Returns true if SkPath is equivalent to SkRect when filled.
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
Adds quad from last point towards (x1, y1), to (x2, y2).
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Transforms verb array, SkPoint array, and weight by matrix.
void dump(SkWStream *stream, bool dumpAsHex) const
Writes text representation of SkPath to stream.
SkPath & addRoundRect(const SkRect &rect, const SkScalar radii[], SkPathDirection dir=SkPathDirection::kCW)
Appends SkRRect to SkPath, creating a new closed contour.
bool isRRect(SkRRect *rrect) const
Returns true if path is representable as SkRRect.
static SkPath RRect(const SkRRect &, SkPathDirection, unsigned startIndex)
SkPath & arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius)
Appends arc to SkPath, after appending line if needed.
Definition: SkPath.h:890
SkPath & addPath(const SkPath &src, const SkMatrix &matrix, AddPathMode mode=kAppend_AddPathMode)
Appends src to SkPath, transformed by matrix.
SkPath makeTransform(const SkMatrix &m, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkPath.h:1365
SkPath & addRRect(const SkRRect &rrect, SkPathDirection dir=SkPathDirection::kCW)
Adds rrect to SkPath, creating a new closed contour.
static SkPath Rect(const SkRect &, SkPathDirection=SkPathDirection::kCW, unsigned startIndex=0)
bool contains(SkScalar x, SkScalar y) const
Returns true if the point (x, y) is contained by SkPath, taking into account FillType.
static SkPath Line(const SkPoint a, const SkPoint b)
Definition: SkPath.h:105
static SkPath RRect(const SkRect &bounds, SkScalar rx, SkScalar ry, SkPathDirection dir=SkPathDirection::kCW)
SkRRect describes a rounded rectangle with a bounds and a pair of radii for each corner.
Definition: SkRRect.h:35
Definition: SkStream.h:218
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582