1 SkPath Reference 2 === 3 4 5 <a name='SkPath'></a> 6 7 --- 8 9 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 10 class <a href='SkPath_Reference#SkPath'>SkPath</a> { 11 12 enum <a href='#SkPath_Direction'>Direction</a> : int { 13 <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, 14 <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>, 15 }; 16 17 <a href='#SkPath_empty_constructor'>SkPath()</a>; 18 <a href='#SkPath_copy_const_SkPath'>SkPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>); 19 <a href='#SkPath_destructor'>~SkPath()</a>; 20 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_copy_operator'>operator=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>); 21 friend bool <a href='#SkPath_equal_operator'>operator==</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& a, const <a href='SkPath_Reference#SkPath'>SkPath</a>& b); 22 friend bool <a href='#SkPath_notequal_operator'>operator!=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& a, const <a href='SkPath_Reference#SkPath'>SkPath</a>& b); 23 bool <a href='#SkPath_isInterpolatable'>isInterpolatable</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& compare) const; 24 bool <a href='#SkPath_interpolate'>interpolate</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& ending, <a href='undocumented#SkScalar'>SkScalar</a> weight, <a href='SkPath_Reference#SkPath'>SkPath</a>* out) const; 25 26 enum <a href='#SkPath_FillType'>FillType</a> { 27 <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>, 28 <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a>, 29 <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a>, 30 <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a>, 31 }; 32 33 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a>() const; 34 void <a href='#SkPath_setFillType'>setFillType</a>(<a href='#SkPath_FillType'>FillType</a> ft); 35 bool <a href='#SkPath_isInverseFillType'>isInverseFillType</a>() const; 36 void <a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a>(); 37 38 enum <a href='#SkPath_Convexity'>Convexity</a> : uint8_t { 39 <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a>, 40 <a href='#SkPath_kConvex_Convexity'>kConvex_Convexity</a>, 41 <a href='#SkPath_kConcave_Convexity'>kConcave_Convexity</a>, 42 }; 43 44 <a href='#SkPath_Convexity'>Convexity</a> <a href='#SkPath_getConvexity'>getConvexity</a>() const; 45 <a href='#SkPath_Convexity'>Convexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a>() const; 46 void <a href='#SkPath_setConvexity'>setConvexity</a>(<a href='#SkPath_Convexity'>Convexity</a> convexity); 47 bool <a href='#SkPath_isConvex'>isConvex</a>() const; 48 bool <a href='#SkPath_isOval'>isOval</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* bounds) const; 49 bool <a href='#SkPath_isRRect'>isRRect</a>(<a href='SkRRect_Reference#SkRRect'>SkRRect</a>* rrect) const; 50 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_reset'>reset()</a>; 51 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rewind'>rewind()</a>; 52 bool <a href='#SkPath_isEmpty'>isEmpty</a>() const; 53 bool <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a>() const; 54 bool <a href='#SkPath_isFinite'>isFinite</a>() const; 55 bool <a href='#SkPath_isVolatile'>isVolatile</a>() const; 56 void <a href='#SkPath_setIsVolatile'>setIsVolatile</a>(bool <a href='#SkPath_isVolatile'>isVolatile</a>); 57 static bool <a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, bool exact); 58 static bool <a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, 59 const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3, bool exact); 60 static bool <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, 61 const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p4, bool exact); 62 bool <a href='#SkPath_isLine'>isLine</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='undocumented#Line'>line</a>[2]) const; 63 int <a href='#SkPath_countPoints'>countPoints</a>() const; 64 <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_getPoint'>getPoint</a>(int index) const; 65 int <a href='#SkPath_getPoints'>getPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='SkPoint_Reference#Point'>points</a>[], int max) const; 66 int <a href='#SkPath_countVerbs'>countVerbs</a>() const; 67 int <a href='#SkPath_getVerbs'>getVerbs</a>(uint8_t <a href='SkPath_Reference#Verb'>verbs</a>[], int max) const; 68 void <a href='#SkPath_swap'>swap</a>(<a href='SkPath_Reference#SkPath'>SkPath</a>& other); 69 const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkPath_getBounds'>getBounds</a>() const; 70 void <a href='#SkPath_updateBoundsCache'>updateBoundsCache</a>() const; 71 <a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPath_computeTightBounds'>computeTightBounds</a>() const; 72 bool <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>) const; 73 void <a href='#SkPath_incReserve'>incReserve</a>(int extraPtCount); 74 void <a href='#SkPath_shrinkToFit'>shrinkToFit</a>(); 75 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_moveTo'>moveTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y); 76 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_moveTo'>moveTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p); 77 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rMoveTo'>rMoveTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy); 78 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_lineTo'>lineTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y); 79 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_lineTo'>lineTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p); 80 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rLineTo'>rLineTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy); 81 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_quadTo'>quadTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2); 82 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_quadTo'>quadTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2); 83 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rQuadTo'>rQuadTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2); 84 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_conicTo'>conicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, 85 <a href='undocumented#SkScalar'>SkScalar</a> w); 86 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_conicTo'>conicTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, <a href='undocumented#SkScalar'>SkScalar</a> w); 87 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rConicTo'>rConicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2, 88 <a href='undocumented#SkScalar'>SkScalar</a> w); 89 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_cubicTo'>cubicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, 90 <a href='undocumented#SkScalar'>SkScalar</a> x3, <a href='undocumented#SkScalar'>SkScalar</a> y3); 91 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_cubicTo'>cubicTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3); 92 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rCubicTo'>rCubicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2, 93 <a href='undocumented#SkScalar'>SkScalar</a> dx3, <a href='undocumented#SkScalar'>SkScalar</a> dy3); 94 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='undocumented#SkScalar'>SkScalar</a> startAngle, <a href='undocumented#SkScalar'>SkScalar</a> sweepAngle, bool forceMoveTo); 95 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> radius); 96 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> p2, <a href='undocumented#SkScalar'>SkScalar</a> radius); 97 98 enum <a href='#SkPath_ArcSize'>ArcSize</a> { 99 <a href='#SkPath_kSmall_ArcSize'>kSmall_ArcSize</a>, 100 <a href='#SkPath_kLarge_ArcSize'>kLarge_ArcSize</a>, 101 }; 102 103 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, 104 <a href='#SkPath_Direction'>Direction</a> sweep, <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y); 105 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> r, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, <a href='#SkPath_Direction'>Direction</a> sweep, 106 const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> xy); 107 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rArcTo'>rArcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, 108 <a href='#SkPath_Direction'>Direction</a> sweep, <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy); 109 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_close'>close()</a>; 110 static bool <a href='#SkPath_IsInverseFillType'>IsInverseFillType</a>(<a href='#SkPath_FillType'>FillType</a> fill); 111 static <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_ConvertToNonInverseFillType'>ConvertToNonInverseFillType</a>(<a href='#SkPath_FillType'>FillType</a> fill); 112 static int <a href='#SkPath_ConvertConicToQuads'>ConvertConicToQuads</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p0, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, 113 <a href='undocumented#SkScalar'>SkScalar</a> w, <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int pow2); 114 bool <a href='#SkPath_isRect'>isRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* <a href='SkRect_Reference#Rect'>rect</a>, bool* isClosed = nullptr, <a href='#SkPath_Direction'>Direction</a>* direction = nullptr) const; 115 bool <a href='#SkPath_isNestedFillRects'>isNestedFillRects</a>(<a href='SkRect_Reference#SkRect'>SkRect</a> <a href='SkRect_Reference#Rect'>rect</a>[2], <a href='#SkPath_Direction'>Direction</a> dirs[2] = nullptr) const; 116 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRect'>addRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>); 117 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRect'>addRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start); 118 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRect'>addRect</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom, 119 <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>); 120 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addOval'>addOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>); 121 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addOval'>addOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start); 122 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addCircle'>addCircle</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='undocumented#SkScalar'>SkScalar</a> radius, 123 <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>); 124 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addArc'>addArc</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='undocumented#SkScalar'>SkScalar</a> startAngle, <a href='undocumented#SkScalar'>SkScalar</a> sweepAngle); 125 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRoundRect'>addRoundRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, <a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, 126 <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>); 127 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRoundRect'>addRoundRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, const <a href='undocumented#SkScalar'>SkScalar</a> radii[], 128 <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>); 129 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRRect'>addRRect</a>(const <a href='SkRRect_Reference#SkRRect'>SkRRect</a>& rrect, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>); 130 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRRect'>addRRect</a>(const <a href='SkRRect_Reference#SkRRect'>SkRRect</a>& rrect, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start); 131 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPoly'>addPoly</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count, bool close); 132 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPoly'>addPoly</a>(const std::initializer_list<<a href='SkPoint_Reference#SkPoint'>SkPoint</a>>& list, bool close); 133 134 enum <a href='#SkPath_AddPathMode'>AddPathMode</a> { 135 <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>, 136 <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a>, 137 }; 138 139 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPath'>addPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, 140 <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>); 141 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPath'>addPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>); 142 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPath'>addPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='SkMatrix_Reference#Matrix'>matrix</a>, 143 <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>); 144 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_reverseAddPath'>reverseAddPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src); 145 void <a href='#SkPath_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='SkPath_Reference#SkPath'>SkPath</a>* dst) const; 146 void <a href='#SkPath_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy); 147 void <a href='#SkPath_transform'>transform</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='SkMatrix_Reference#Matrix'>matrix</a>, <a href='SkPath_Reference#SkPath'>SkPath</a>* dst) const; 148 void <a href='#SkPath_transform'>transform</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='SkMatrix_Reference#Matrix'>matrix</a>); 149 bool <a href='#SkPath_getLastPt'>getLastPt</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a>* lastPt) const; 150 void <a href='#SkPath_setLastPt'>setLastPt</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y); 151 void <a href='#SkPath_setLastPt'>setLastPt</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p); 152 153 enum <a href='#SkPath_SegmentMask'>SegmentMask</a> { 154 <a href='#SkPath_kLine_SegmentMask'>kLine_SegmentMask</a> = 1 << 0, 155 <a href='#SkPath_kQuad_SegmentMask'>kQuad_SegmentMask</a> = 1 << 1, 156 <a href='#SkPath_kConic_SegmentMask'>kConic_SegmentMask</a> = 1 << 2, 157 <a href='#SkPath_kCubic_SegmentMask'>kCubic_SegmentMask</a> = 1 << 3, 158 }; 159 160 uint32_t <a href='#SkPath_getSegmentMasks'>getSegmentMasks</a>() const; 161 162 enum <a href='#SkPath_Verb'>Verb</a> { 163 <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, 164 <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, 165 <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a>, 166 <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, 167 <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a>, 168 <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, 169 <a href='#SkPath_kDone_Verb'>kDone_Verb</a>, 170 }; 171 172 bool <a href='#SkPath_contains'>contains</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) const; 173 void <a href='#SkPath_dump'>dump</a>(<a href='SkWStream_Reference#SkWStream'>SkWStream</a>* <a href='SkStream_Reference#Stream'>stream</a>, bool forceClose, bool dumpAsHex) const; 174 void <a href='#SkPath_dump'>dump()</a> const; 175 void <a href='#SkPath_dumpHex'>dumpHex</a>() const; 176 size_t <a href='#SkPath_writeToMemory'>writeToMemory</a>(void* buffer) const; 177 <a href='undocumented#sk_sp'>sk_sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkPath_serialize'>serialize()</a> const; 178 size_t <a href='#SkPath_readFromMemory'>readFromMemory</a>(const void* buffer, size_t length); 179 uint32_t <a href='#SkPath_getGenerationID'>getGenerationID</a>() const; 180 bool <a href='#SkPath_isValid'>isValid</a>() const; 181 }; 182 183 </pre> 184 185 <a href='SkPath_Reference#Path'>Paths</a> contain geometry. <a href='SkPath_Reference#Path'>Paths</a> may be empty, or contain one or more <a href='SkPath_Reference#Verb'>Verbs</a> that 186 outline a figure. <a href='SkPath_Reference#Path'>Path</a> always starts with a move verb to a <a href='#Cartesian_Coordinate'>Cartesian_Coordinate</a>, 187 and may be followed by additional <a href='SkPath_Reference#Verb'>verbs</a> that add <a href='undocumented#Line'>lines</a> or <a href='undocumented#Curve'>curves</a>. 188 Adding a close verb makes the geometry into a continuous loop, a closed <a href='SkPath_Overview#Contour'>contour</a>. 189 <a href='SkPath_Reference#Path'>Paths</a> may contain any number of <a href='SkPath_Overview#Contour'>contours</a>, each beginning with a move verb. 190 191 <a href='SkPath_Reference#Path'>Path</a> <a href='SkPath_Overview#Contour'>contours</a> may contain only a move verb, or may also contain <a href='undocumented#Line'>lines</a>, 192 <a href='#Path_Quad'>Quadratic_Beziers</a>, <a href='SkPath_Reference#Conic'>Conics</a>, and <a href='#Path_Cubic'>Cubic_Beziers</a>. <a href='SkPath_Reference#Path'>Path</a> <a href='SkPath_Overview#Contour'>contours</a> may be open or 193 closed. 194 195 When used to draw a filled area, <a href='SkPath_Reference#Path'>Path</a> describes whether the fill is inside or 196 outside the geometry. <a href='SkPath_Reference#Path'>Path</a> also describes the winding rule used to fill 197 overlapping <a href='SkPath_Overview#Contour'>contours</a>. 198 199 Internally, <a href='SkPath_Reference#Path'>Path</a> lazily computes metrics likes bounds and convexity. Call 200 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_updateBoundsCache'>updateBoundsCache</a> to make <a href='SkPath_Reference#Path'>Path</a> thread safe. 201 202 <a name='Verb'></a> 203 204 <a name='SkPath_Verb'></a> 205 206 --- 207 208 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 209 enum <a href='#SkPath_Verb'>Verb</a> { 210 <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, 211 <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, 212 <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a>, 213 <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, 214 <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a>, 215 <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, 216 <a href='#SkPath_kDone_Verb'>kDone_Verb</a>, 217 }; 218 </pre> 219 220 <a href='#SkPath_Verb'>Verb</a> instructs <a href='SkPath_Reference#Path'>Path</a> how to interpret one or more <a href='SkPoint_Reference#Point'>Point</a> and optional <a href='#Path_Conic_Weight'>Conic_Weight</a>; 221 manage <a href='SkPath_Overview#Contour'>Contour</a>, and terminate <a href='SkPath_Reference#Path'>Path</a>. 222 223 ### Constants 224 225 <table style='border-collapse: collapse; width: 62.5em'> 226 <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> 227 <th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> 228 <th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> 229 <tr style='background-color: #f0f0f0; '> 230 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kMove_Verb'><code>SkPath::kMove_Verb</code></a></td> 231 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> 232 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 233 Consecutive <a href='#SkPath_kMove_Verb'>kMove_Verb</a> are preserved but all but the last <a href='#SkPath_kMove_Verb'>kMove_Verb</a> is 234 ignored. <a href='#SkPath_kMove_Verb'>kMove_Verb</a> after other <a href='SkPath_Reference#Verb'>Verbs</a> implicitly closes the previous <a href='SkPath_Overview#Contour'>Contour</a> 235 if <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_kFill_Style'>kFill_Style</a> is set when drawn; otherwise, stroke is drawn open. 236 <a href='#SkPath_kMove_Verb'>kMove_Verb</a> as the last <a href='#SkPath_Verb'>Verb</a> is preserved but ignored. 237 </td> 238 </tr> 239 <tr> 240 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kLine_Verb'><code>SkPath::kLine_Verb</code></a></td> 241 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> 242 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 243 <a href='undocumented#Line'>Line</a> is a straight segment from <a href='SkPoint_Reference#Point'>Point</a> to <a href='SkPoint_Reference#Point'>Point</a>. Consecutive <a href='#SkPath_kLine_Verb'>kLine_Verb</a> 244 extend <a href='SkPath_Overview#Contour'>Contour</a>. <a href='#SkPath_kLine_Verb'>kLine_Verb</a> at same position as prior <a href='#SkPath_kMove_Verb'>kMove_Verb</a> is 245 preserved, and draws <a href='SkPoint_Reference#Point'>Point</a> if <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_kStroke_Style'>kStroke_Style</a> is set, and 246 <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_Cap'>Cap</a> is <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_kSquare_Cap'>kSquare_Cap</a> or <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_kRound_Cap'>kRound_Cap</a>. <a href='#SkPath_kLine_Verb'>kLine_Verb</a> 247 at same position as prior <a href='undocumented#Line'>line</a> or <a href='undocumented#Curve'>curve</a> <a href='#SkPath_Verb'>Verb</a> is preserved but is ignored. 248 </td> 249 </tr> 250 <tr style='background-color: #f0f0f0; '> 251 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kQuad_Verb'><code>SkPath::kQuad_Verb</code></a></td> 252 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> 253 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 254 Adds <a href='SkPath_Reference#Quad'>Quad</a> from <a href='#Path_Last_Point'>Last_Point</a>, using control <a href='SkPoint_Reference#Point'>Point</a>, and end <a href='SkPoint_Reference#Point'>Point</a>. 255 <a href='SkPath_Reference#Quad'>Quad</a> is a parabolic section within tangents from <a href='#Path_Last_Point'>Last_Point</a> to control <a href='SkPoint_Reference#Point'>Point</a>, 256 and control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>. 257 </td> 258 </tr> 259 <tr> 260 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConic_Verb'><code>SkPath::kConic_Verb</code></a></td> 261 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> 262 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 263 Adds <a href='SkPath_Reference#Conic'>Conic</a> from <a href='#Path_Last_Point'>Last_Point</a>, using control <a href='SkPoint_Reference#Point'>Point</a>, end <a href='SkPoint_Reference#Point'>Point</a>, and <a href='#Path_Conic_Weight'>Conic_Weight</a>. 264 <a href='SkPath_Reference#Conic'>Conic</a> is a elliptical, parabolic, or hyperbolic section within tangents 265 from <a href='#Path_Last_Point'>Last_Point</a> to control <a href='SkPoint_Reference#Point'>Point</a>, and control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>, constrained 266 by <a href='#Path_Conic_Weight'>Conic_Weight</a>. <a href='#Path_Conic_Weight'>Conic_Weight</a> less than one is elliptical; equal to one is 267 parabolic (and identical to <a href='SkPath_Reference#Quad'>Quad</a>); greater than one hyperbolic. 268 </td> 269 </tr> 270 <tr style='background-color: #f0f0f0; '> 271 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCubic_Verb'><code>SkPath::kCubic_Verb</code></a></td> 272 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> 273 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 274 Adds <a href='SkPath_Reference#Cubic'>Cubic</a> from <a href='#Path_Last_Point'>Last_Point</a>, using two control <a href='SkPoint_Reference#Point'>Points</a>, and end <a href='SkPoint_Reference#Point'>Point</a>. 275 <a href='SkPath_Reference#Cubic'>Cubic</a> is a third-order <a href='#Bezier_Curve'>Bezier_Curve</a> section within tangents from <a href='#Path_Last_Point'>Last_Point</a> 276 to first control <a href='SkPoint_Reference#Point'>Point</a>, and from second control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>. 277 </td> 278 </tr> 279 <tr> 280 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kClose_Verb'><code>SkPath::kClose_Verb</code></a></td> 281 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>5</td> 282 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 283 Closes <a href='SkPath_Overview#Contour'>Contour</a>, connecting <a href='#Path_Last_Point'>Last_Point</a> to <a href='#SkPath_kMove_Verb'>kMove_Verb</a> <a href='SkPoint_Reference#Point'>Point</a>. Consecutive 284 <a href='#SkPath_kClose_Verb'>kClose_Verb</a> are preserved but only first has an effect. <a href='#SkPath_kClose_Verb'>kClose_Verb</a> after 285 <a href='#SkPath_kMove_Verb'>kMove_Verb</a> has no effect. 286 </td> 287 </tr> 288 <tr style='background-color: #f0f0f0; '> 289 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kDone_Verb'><code>SkPath::kDone_Verb</code></a></td> 290 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>6</td> 291 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 292 Not in <a href='#Path_Verb_Array'>Verb_Array</a>, but returned by <a href='SkPath_Reference#Path'>Path</a> iterator. 293 </td> 294 </tr> 295 Each <a href='#SkPath_Verb'>Verb</a> has zero or more <a href='SkPoint_Reference#Point'>Points</a> stored in <a href='SkPath_Reference#Path'>Path</a>. 296 <a href='SkPath_Reference#Path'>Path</a> iterator returns complete <a href='undocumented#Curve'>curve</a> descriptions, duplicating shared <a href='SkPoint_Reference#Point'>Points</a> 297 for consecutive entries. 298 299 </table> 300 301 | <a href='#SkPath_Verb'>Verb</a> | Allocated <a href='SkPoint_Reference#Point'>Points</a> | Iterated <a href='SkPoint_Reference#Point'>Points</a> | <a href='SkPath_Reference#Conic_Weight'>Weights</a> | 302 | --- | --- | --- | --- | 303 | <a href='#SkPath_kMove_Verb'>kMove_Verb</a> | 1 | 1 | 0 | 304 | <a href='#SkPath_kLine_Verb'>kLine_Verb</a> | 1 | 2 | 0 | 305 | <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a> | 2 | 3 | 0 | 306 | <a href='#SkPath_kConic_Verb'>kConic_Verb</a> | 2 | 3 | 1 | 307 | <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a> | 3 | 4 | 0 | 308 | <a href='#SkPath_kClose_Verb'>kClose_Verb</a> | 0 | 1 | 0 | 309 | <a href='#SkPath_kDone_Verb'>kDone_Verb</a> | -- | 0 | 0 | 310 311 ### Example 312 313 <div><fiddle-embed name="799096fdc1298aa815934a74e76570ca"> 314 315 #### Example Output 316 317 ~~~~ 318 verb count: 7 319 verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConic_Verb 320 ~~~~ 321 322 </fiddle-embed></div> 323 324 <a name='Direction'></a> 325 326 <a name='SkPath_Direction'></a> 327 328 --- 329 330 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 331 enum <a href='#SkPath_Direction'>Direction</a> : int { 332 <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, 333 <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>, 334 }; 335 </pre> 336 337 <a href='#SkPath_Direction'>Direction</a> describes whether <a href='SkPath_Overview#Contour'>Contour</a> is clockwise or counterclockwise. 338 When <a href='SkPath_Reference#Path'>Path</a> contains multiple overlapping <a href='SkPath_Overview#Contour'>Contours</a>, <a href='#SkPath_Direction'>Direction</a> together with 339 <a href='#Path_Fill_Type'>Fill_Type</a> determines whether overlaps are filled or form holes. 340 341 <a href='#SkPath_Direction'>Direction</a> also determines how <a href='SkPath_Overview#Contour'>Contour</a> is measured. For instance, dashing 342 measures along <a href='SkPath_Reference#Path'>Path</a> to determine where to start and stop stroke; <a href='#SkPath_Direction'>Direction</a> 343 will change dashed results as it steps clockwise or counterclockwise. 344 345 Closed <a href='SkPath_Overview#Contour'>Contours</a> like <a href='SkRect_Reference#Rect'>Rect</a>, <a href='#RRect'>Round_Rect</a>, <a href='undocumented#Circle'>Circle</a>, and <a href='undocumented#Oval'>Oval</a> added with 346 <a href='#SkPath_kCW_Direction'>kCW_Direction</a> travel clockwise; the same added with <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a> 347 travel counterclockwise. 348 349 ### Constants 350 351 <table style='border-collapse: collapse; width: 62.5em'> 352 <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> 353 <th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> 354 <th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> 355 <tr style='background-color: #f0f0f0; '> 356 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCW_Direction'><code>SkPath::kCW_Direction</code></a></td> 357 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> 358 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 359 contour travels clockwise</td> 360 </tr> 361 <tr> 362 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCCW_Direction'><code>SkPath::kCCW_Direction</code></a></td> 363 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> 364 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 365 contour travels counterclockwise</td> 366 </tr> 367 </table> 368 369 ### Example 370 371 <div><fiddle-embed name="4bbae00b40ed2cfcd0007921ad693a7b"></fiddle-embed></div> 372 373 ### See Also 374 375 <a href='#SkPath_arcTo'>arcTo</a> <a href='#SkPath_rArcTo'>rArcTo</a> <a href='#SkPath_isRect'>isRect</a> <a href='#SkPath_isNestedFillRects'>isNestedFillRects</a> <a href='#SkPath_addRect'>addRect</a> <a href='#SkPath_addOval'>addOval</a> 376 377 <a name='SkPath_empty_constructor'></a> 378 379 --- 380 381 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 382 <a href='#SkPath_empty_constructor'>SkPath()</a> 383 </pre> 384 385 Constructs an empty <a href='SkPath_Reference#SkPath'>SkPath</a>. By default, <a href='SkPath_Reference#SkPath'>SkPath</a> has no <a href='SkPath_Reference#Verb'>verbs</a>, no <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and no <a href='SkPath_Reference#Conic_Weight'>weights</a>. 386 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a> is set to <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>. 387 388 ### Return Value 389 390 empty <a href='SkPath_Reference#SkPath'>SkPath</a> 391 392 ### Example 393 394 <div><fiddle-embed name="0a0026fca638d1cd75c0ab884e3ee1c6"> 395 396 #### Example Output 397 398 ~~~~ 399 path is empty 400 ~~~~ 401 402 </fiddle-embed></div> 403 404 ### See Also 405 406 <a href='#SkPath_reset'>reset</a> <a href='#SkPath_rewind'>rewind</a> 407 408 <a name='SkPath_copy_const_SkPath'></a> 409 410 --- 411 412 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 413 <a href='#SkPath_copy_const_SkPath'>SkPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) 414 </pre> 415 416 Constructs a copy of an existing <a href='#SkPath_copy_const_SkPath_path'>path</a>. 417 Copy constructor makes two <a href='SkPath_Reference#Path'>paths</a> identical by value. Internally, <a href='#SkPath_copy_const_SkPath_path'>path</a> and 418 the returned result share pointer values. The underlying <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a> 419 and <a href='SkPath_Reference#Conic_Weight'>weights</a> are copied when modified. 420 421 Creating a <a href='SkPath_Reference#SkPath'>SkPath</a> copy is very efficient and never allocates memory. 422 <a href='SkPath_Reference#SkPath'>SkPath</a> are always copied by value from the interface; the underlying shared 423 pointers are not exposed. 424 425 ### Parameters 426 427 <table> <tr> <td><a name='SkPath_copy_const_SkPath_path'><code><strong>path</strong></code></a></td> 428 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to copy by value</td> 429 </tr> 430 </table> 431 432 ### Return Value 433 434 copy of <a href='SkPath_Reference#SkPath'>SkPath</a> 435 436 ### Example 437 438 <div><fiddle-embed name="647312aacd946c8a6eabaca797140432"><div>Modifying one <a href='#SkPath_copy_const_SkPath_path'>path</a> does not effect another, even if they started as copies 439 of each other. 440 </div> 441 442 #### Example Output 443 444 ~~~~ 445 path verbs: 2 446 path2 verbs: 3 447 after reset 448 path verbs: 0 449 path2 verbs: 3 450 ~~~~ 451 452 </fiddle-embed></div> 453 454 ### See Also 455 456 <a href='#SkPath_copy_operator'>operator=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_copy_const_SkPath_path'>path</a>) 457 458 <a name='SkPath_destructor'></a> 459 460 --- 461 462 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 463 <a href='#SkPath_destructor'>~SkPath()</a> 464 </pre> 465 466 Releases ownership of any shared <a href='undocumented#Data'>data</a> and deletes <a href='undocumented#Data'>data</a> if <a href='SkPath_Reference#SkPath'>SkPath</a> is sole owner. 467 468 ### Example 469 470 <div><fiddle-embed name="01ad6be9b7d15a2217daea273eb3d466"><div>delete calls <a href='SkPath_Reference#Path'>Path</a> destructor, but copy of original in path2 is unaffected. 471 </div></fiddle-embed></div> 472 473 ### See Also 474 475 <a href='#SkPath_empty_constructor'>SkPath()</a> <a href='#SkPath_copy_const_SkPath'>SkPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) <a href='#SkPath_copy_operator'>operator=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) 476 477 <a name='SkPath_copy_operator'></a> 478 479 --- 480 481 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 482 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_copy_operator'>operator=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) 483 </pre> 484 485 Constructs a copy of an existing <a href='#SkPath_copy_operator_path'>path</a>. 486 <a href='SkPath_Reference#SkPath'>SkPath</a> assignment makes two <a href='SkPath_Reference#Path'>paths</a> identical by value. Internally, assignment 487 shares pointer values. The underlying <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a> and <a href='SkPath_Reference#Conic_Weight'>weights</a> 488 are copied when modified. 489 490 Copying <a href='SkPath_Reference#SkPath'>SkPath</a> by assignment is very efficient and never allocates memory. 491 <a href='SkPath_Reference#SkPath'>SkPath</a> are always copied by value from the interface; the underlying shared 492 pointers are not exposed. 493 494 ### Parameters 495 496 <table> <tr> <td><a name='SkPath_copy_operator_path'><code><strong>path</strong></code></a></td> 497 <td><a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, <a href='SkPath_Reference#Conic_Weight'>weights</a>, and <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a> to copy</td> 498 </tr> 499 </table> 500 501 ### Return Value 502 503 <a href='SkPath_Reference#SkPath'>SkPath</a> copied by value 504 505 ### Example 506 507 <div><fiddle-embed name="bba288f5f77fc8e37e89d2ec08e0ac60"> 508 509 #### Example Output 510 511 ~~~~ 512 path1 bounds = 10, 20, 30, 40 513 path2 bounds = 10, 20, 30, 40 514 ~~~~ 515 516 </fiddle-embed></div> 517 518 ### See Also 519 520 <a href='#SkPath_swap'>swap</a> <a href='#SkPath_copy_const_SkPath'>SkPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_copy_operator_path'>path</a>) 521 522 <a name='SkPath_equal_operator'></a> 523 524 --- 525 526 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 527 bool <a href='#SkPath_equal_operator'>operator==</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& a, const <a href='SkPath_Reference#SkPath'>SkPath</a>& b) 528 </pre> 529 530 Compares <a href='#SkPath_equal_operator_a'>a</a> and <a href='#SkPath_equal_operator_b'>b</a>; returns true if <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a>, <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='SkPath_Reference#Conic_Weight'>weights</a> 531 are equivalent. 532 533 ### Parameters 534 535 <table> <tr> <td><a name='SkPath_equal_operator_a'><code><strong>a</strong></code></a></td> 536 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to compare</td> 537 </tr> 538 <tr> <td><a name='SkPath_equal_operator_b'><code><strong>b</strong></code></a></td> 539 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to compare</td> 540 </tr> 541 </table> 542 543 ### Return Value 544 545 true if <a href='SkPath_Reference#SkPath'>SkPath</a> pair are equivalent 546 547 ### Example 548 549 <div><fiddle-embed name="31883f51bb357f2ac5990d88f8b82e02"><div><a href='#SkPath_rewind'>rewind()</a> removes <a href='#Path_Verb_Array'>Verb_Array</a> but leaves storage; since storage is not compared, 550 <a href='SkPath_Reference#Path'>Path</a> pair are equivalent. 551 </div> 552 553 #### Example Output 554 555 ~~~~ 556 empty one == two 557 moveTo one != two 558 rewind one == two 559 reset one == two 560 ~~~~ 561 562 </fiddle-embed></div> 563 564 ### See Also 565 566 <a href='#SkPath_notequal_operator'>operator!=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_equal_operator_a'>a</a>, const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_equal_operator_b'>b</a>) <a href='#SkPath_copy_operator'>operator=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) 567 568 <a name='SkPath_notequal_operator'></a> 569 570 --- 571 572 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 573 bool <a href='#SkPath_notequal_operator'>operator!=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& a, const <a href='SkPath_Reference#SkPath'>SkPath</a>& b) 574 </pre> 575 576 Compares <a href='#SkPath_notequal_operator_a'>a</a> and <a href='#SkPath_notequal_operator_b'>b</a>; returns true if <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a>, <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='SkPath_Reference#Conic_Weight'>weights</a> 577 are not equivalent. 578 579 ### Parameters 580 581 <table> <tr> <td><a name='SkPath_notequal_operator_a'><code><strong>a</strong></code></a></td> 582 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to compare</td> 583 </tr> 584 <tr> <td><a name='SkPath_notequal_operator_b'><code><strong>b</strong></code></a></td> 585 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to compare</td> 586 </tr> 587 </table> 588 589 ### Return Value 590 591 true if <a href='SkPath_Reference#SkPath'>SkPath</a> pair are not equivalent 592 593 ### Example 594 595 <div><fiddle-embed name="bbbda1cc818d96c9c0d2a06c0c48902b"><div><a href='SkPath_Reference#Path'>Path</a> pair are equal though their convexity is not equal. 596 </div> 597 598 #### Example Output 599 600 ~~~~ 601 empty one == two 602 add rect one == two 603 setConvexity one == two 604 convexity != 605 ~~~~ 606 607 </fiddle-embed></div> 608 609 <a name='Property'></a> 610 611 <a name='SkPath_isInterpolatable'></a> 612 613 --- 614 615 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 616 bool <a href='#SkPath_isInterpolatable'>isInterpolatable</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& compare)const 617 </pre> 618 619 Returns true if <a href='SkPath_Reference#SkPath'>SkPath</a> contain equal <a href='SkPath_Reference#Verb'>verbs</a> and equal <a href='SkPath_Reference#Conic_Weight'>weights</a>. 620 If <a href='SkPath_Reference#SkPath'>SkPath</a> contain one or more <a href='SkPath_Reference#Conic'>conics</a>, the <a href='SkPath_Reference#Conic_Weight'>weights</a> must match. 621 622 <a href='#SkPath_conicTo'>conicTo</a>() may add different <a href='SkPath_Reference#Verb'>verbs</a> depending on <a href='#Conic_Weight'>conic weight</a>, so it is not 623 trivial to interpolate a pair of <a href='SkPath_Reference#SkPath'>SkPath</a> containing <a href='SkPath_Reference#Conic'>conics</a> with different 624 <a href='#Conic_Weight'>conic weight</a> values. 625 626 ### Parameters 627 628 <table> <tr> <td><a name='SkPath_isInterpolatable_compare'><code><strong>compare</strong></code></a></td> 629 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to <a href='#SkPath_isInterpolatable_compare'>compare</a></td> 630 </tr> 631 </table> 632 633 ### Return Value 634 635 true if <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='#Verb_Array'>verb array</a> and <a href='SkPath_Reference#Conic_Weight'>weights</a> are equivalent 636 637 ### Example 638 639 <div><fiddle-embed name="c81fc7dfaf785c3fb77209c7f2ebe5b8"> 640 641 #### Example Output 642 643 ~~~~ 644 paths are interpolatable 645 ~~~~ 646 647 </fiddle-embed></div> 648 649 ### See Also 650 651 <a href='#SkPath_isInterpolatable'>isInterpolatable</a> 652 653 <a name='Interpolate'></a> 654 655 <a name='SkPath_interpolate'></a> 656 657 --- 658 659 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 660 bool interpolate(const <a href='SkPath_Reference#SkPath'>SkPath</a>& ending, <a href='undocumented#SkScalar'>SkScalar</a> weight, <a href='SkPath_Reference#SkPath'>SkPath</a>* out)const 661 </pre> 662 663 Interpolates between <a href='SkPath_Reference#Path'>Paths</a> with <a href='#Path_Point_Array'>Point_Array</a> of equal <a href='undocumented#Size'>size</a>. 664 Copy <a href='#Path_Verb_Array'>Verb_Array</a> and <a href='SkPath_Reference#Conic_Weight'>Weights</a> to <a href='#SkPath_interpolate_out'>out</a>, and set <a href='#SkPath_interpolate_out'>out</a> <a href='#Path_Point_Array'>Point_Array</a> to a weighted 665 average of this <a href='#Path_Point_Array'>Point_Array</a> and <a href='#SkPath_interpolate_ending'>ending</a> <a href='#Path_Point_Array'>Point_Array</a>, using the formula: 666 <code>(<a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> * <a href='#SkPath_interpolate_weight'>weight</a>) + <a href='#SkPath_interpolate_ending'>ending</a> <a href='SkPoint_Reference#Point'>Point</a> * (1 - <a href='#SkPath_interpolate_weight'>weight</a>)</code>. 667 668 <a href='#SkPath_interpolate_weight'>weight</a> is most useful when between zero (<a href='#SkPath_interpolate_ending'>ending</a> <a href='#Path_Point_Array'>Point_Array</a>) and 669 one (this <a href='#Path_Point_Array'>Point_Array</a>); will work with values outside of this 670 range. 671 672 <a href='#SkPath_interpolate'>interpolate()</a> returns false and leaves <a href='#SkPath_interpolate_out'>out</a> unchanged if <a href='#Path_Point_Array'>Point_Array</a> is not 673 the same <a href='undocumented#Size'>size</a> as <a href='#SkPath_interpolate_ending'>ending</a> <a href='#Path_Point_Array'>Point_Array</a>. Call <a href='#SkPath_isInterpolatable'>isInterpolatable</a> to check <a href='SkPath_Reference#Path'>Path</a> 674 compatibility prior to calling <a href='#SkPath_interpolate'>interpolate()</a>. 675 676 ### Parameters 677 678 <table> <tr> <td><a name='SkPath_interpolate_ending'><code><strong>ending</strong></code></a></td> 679 <td><a href='#Path_Point_Array'>Point_Array</a> averaged with this <a href='#Path_Point_Array'>Point_Array</a></td> 680 </tr> 681 <tr> <td><a name='SkPath_interpolate_weight'><code><strong>weight</strong></code></a></td> 682 <td>contribution of this <a href='#Path_Point_Array'>Point_Array</a>, and 683 one minus contribution of <a href='#SkPath_interpolate_ending'>ending</a> <a href='#Path_Point_Array'>Point_Array</a> 684 </td> 685 </tr> 686 <tr> <td><a name='SkPath_interpolate_out'><code><strong>out</strong></code></a></td> 687 <td><a href='SkPath_Reference#Path'>Path</a> replaced by interpolated averages</td> 688 </tr> 689 </table> 690 691 ### Return Value 692 693 true if <a href='SkPath_Reference#Path'>Paths</a> contain same number of <a href='SkPoint_Reference#Point'>Points</a> 694 695 ### Example 696 697 <div><fiddle-embed name="404f11c5c9c9ca8a64822d484552a473"></fiddle-embed></div> 698 699 ### See Also 700 701 <a href='#SkPath_isInterpolatable'>isInterpolatable</a> 702 703 <a name='Fill_Type'></a> 704 705 <a name='SkPath_FillType'></a> 706 707 --- 708 709 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 710 enum <a href='#SkPath_FillType'>FillType</a> { 711 <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>, 712 <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a>, 713 <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a>, 714 <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a>, 715 }; 716 </pre> 717 718 <a href='#Path_Fill_Type'>Fill_Type</a> selects the rule used to fill <a href='SkPath_Reference#Path'>Path</a>. <a href='SkPath_Reference#Path'>Path</a> set to <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> 719 fills if the sum of <a href='SkPath_Overview#Contour'>Contour</a> edges is not zero, where clockwise edges add one, and 720 counterclockwise edges subtract one. <a href='SkPath_Reference#Path'>Path</a> set to <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> fills if the 721 number of <a href='SkPath_Overview#Contour'>Contour</a> edges is odd. Each <a href='#Path_Fill_Type'>Fill_Type</a> has an inverse variant that 722 reverses the rule: 723 <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a> fills where the sum of <a href='SkPath_Overview#Contour'>Contour</a> edges is zero; 724 <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> fills where the number of <a href='SkPath_Overview#Contour'>Contour</a> edges is even. 725 726 ### Example 727 728 <div><fiddle-embed name="71fc6c069c377d808799f2453edabaf5"><div>The top row has two clockwise rectangles. The second row has one clockwise and 729 one counterclockwise rectangle. The even-odd variants draw the same. The 730 winding variants draw the top rectangle overlap, which has a winding of 2, the 731 same as the outer parts of the top rectangles, which have a winding of 1. 732 </div></fiddle-embed></div> 733 734 ### Constants 735 736 <table style='border-collapse: collapse; width: 62.5em'> 737 <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> 738 <th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> 739 <th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> 740 <tr style='background-color: #f0f0f0; '> 741 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kWinding_FillType'><code>SkPath::kWinding_FillType</code></a></td> 742 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> 743 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 744 is enclosed by a non-zero sum of Contour Directions</td> 745 </tr> 746 <tr> 747 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kEvenOdd_FillType'><code>SkPath::kEvenOdd_FillType</code></a></td> 748 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> 749 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 750 is enclosed by an odd number of Contours</td> 751 </tr> 752 <tr style='background-color: #f0f0f0; '> 753 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kInverseWinding_FillType'><code>SkPath::kInverseWinding_FillType</code></a></td> 754 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> 755 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 756 is enclosed by a zero sum of Contour Directions</td> 757 </tr> 758 <tr> 759 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kInverseEvenOdd_FillType'><code>SkPath::kInverseEvenOdd_FillType</code></a></td> 760 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> 761 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 762 is enclosed by an even number of Contours</td> 763 </tr> 764 </table> 765 766 ### Example 767 768 <div><fiddle-embed name="d2c33dc791cd165dcc2423226ba5b095"></fiddle-embed></div> 769 770 ### See Also 771 772 <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_Style'>Style</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> 773 774 <a name='SkPath_getFillType'></a> 775 776 --- 777 778 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 779 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a>()const 780 </pre> 781 782 Returns <a href='#SkPath_FillType'>FillType</a>, the rule used to fill <a href='SkPath_Reference#SkPath'>SkPath</a>. <a href='#SkPath_FillType'>FillType</a> of a new <a href='SkPath_Reference#SkPath'>SkPath</a> is 783 <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>. 784 785 ### Return Value 786 787 one of: <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a>, <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a>, 788 789 <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> 790 791 ### Example 792 793 <div><fiddle-embed name="019af90e778914e8a109d6305ede4fc4"> 794 795 #### Example Output 796 797 ~~~~ 798 default path fill type is kWinding_FillType 799 ~~~~ 800 801 </fiddle-embed></div> 802 803 ### See Also 804 805 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_isInverseFillType'>isInverseFillType</a> 806 807 <a name='SkPath_setFillType'></a> 808 809 --- 810 811 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 812 void <a href='#SkPath_setFillType'>setFillType</a>(<a href='#SkPath_FillType'>FillType</a> ft) 813 </pre> 814 815 Sets <a href='#SkPath_FillType'>FillType</a>, the rule used to fill <a href='SkPath_Reference#SkPath'>SkPath</a>. While there is no check 816 that <a href='#SkPath_setFillType_ft'>ft</a> is legal, values outside of <a href='#SkPath_FillType'>FillType</a> are not supported. 817 818 ### Parameters 819 820 <table> <tr> <td><a name='SkPath_setFillType_ft'><code><strong>ft</strong></code></a></td> 821 <td>one of: <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a>, <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a>,</td> 822 </tr> 823 </table> 824 825 <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> 826 827 ### Example 828 829 <div><fiddle-embed name="b4a91cd7f50b2a0a0d1bec6d0ac823d2"><div>If empty <a href='SkPath_Reference#Path'>Path</a> is set to inverse <a href='#SkPath_FillType'>FillType</a>, it fills all pixels. 830 </div></fiddle-embed></div> 831 832 ### See Also 833 834 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a> 835 836 <a name='SkPath_isInverseFillType'></a> 837 838 --- 839 840 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 841 bool <a href='#SkPath_isInverseFillType'>isInverseFillType</a>()const 842 </pre> 843 844 Returns if <a href='#SkPath_FillType'>FillType</a> describes area outside <a href='SkPath_Reference#SkPath'>SkPath</a> geometry. The inverse fill area 845 extends indefinitely. 846 847 ### Return Value 848 849 true if <a href='#SkPath_FillType'>FillType</a> is <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a> or <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> 850 851 ### Example 852 853 <div><fiddle-embed name="2a2d39f5da611545caa18bbcea873ab2"> 854 855 #### Example Output 856 857 ~~~~ 858 default path fill type is inverse: false 859 ~~~~ 860 861 </fiddle-embed></div> 862 863 ### See Also 864 865 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a> 866 867 <a name='SkPath_toggleInverseFillType'></a> 868 869 --- 870 871 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 872 void <a href='#SkPath_toggleInverseFillType'>toggleInverseFillType</a>() 873 </pre> 874 875 Replaces <a href='#SkPath_FillType'>FillType</a> with its inverse. The inverse of <a href='#SkPath_FillType'>FillType</a> describes the area 876 unmodified by the original <a href='#SkPath_FillType'>FillType</a>. 877 878 | <a href='#SkPath_FillType'>FillType</a> | toggled <a href='#SkPath_FillType'>FillType</a> | 879 | --- | --- | 880 | <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> | <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a> | 881 | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> | <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> | 882 | <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a> | <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> | 883 | <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> | 884 885 ### Example 886 887 <div><fiddle-embed name="400facce23d417bc5043c5f58404afbd"><div><a href='SkPath_Reference#Path'>Path</a> drawn normally and through its inverse touches every <a href='undocumented#Pixel'>pixel</a> once. 888 </div></fiddle-embed></div> 889 890 ### See Also 891 892 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_isInverseFillType'>isInverseFillType</a> 893 894 <a name='Convexity'></a> 895 896 <a name='SkPath_Convexity'></a> 897 898 --- 899 900 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 901 enum <a href='#SkPath_Convexity'>Convexity</a> : uint8_t { 902 <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a>, 903 <a href='#SkPath_kConvex_Convexity'>kConvex_Convexity</a>, 904 <a href='#SkPath_kConcave_Convexity'>kConcave_Convexity</a>, 905 }; 906 </pre> 907 908 <a href='SkPath_Reference#Path'>Path</a> is convex if it contains one <a href='SkPath_Overview#Contour'>Contour</a> and <a href='SkPath_Overview#Contour'>Contour</a> loops no more than 909 360 degrees, and <a href='SkPath_Overview#Contour'>Contour</a> angles all have same <a href='#SkPath_Direction'>Direction</a>. Convex <a href='SkPath_Reference#Path'>Path</a> 910 may have better performance and require fewer resources on <a href='#GPU_Surface'>GPU_Surface</a>. 911 912 <a href='SkPath_Reference#Path'>Path</a> is concave when either at least one <a href='#SkPath_Direction'>Direction</a> change is clockwise and 913 another is counterclockwise, or the sum of the changes in <a href='#SkPath_Direction'>Direction</a> is not 360 914 degrees. 915 916 Initially <a href='SkPath_Reference#Path'>Path</a> <a href='#SkPath_Convexity'>Convexity</a> is <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a>. <a href='SkPath_Reference#Path'>Path</a> <a href='#SkPath_Convexity'>Convexity</a> is computed 917 if needed by destination <a href='SkSurface_Reference#Surface'>Surface</a>. 918 919 ### Constants 920 921 <table style='border-collapse: collapse; width: 62.5em'> 922 <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> 923 <th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> 924 <th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> 925 <tr style='background-color: #f0f0f0; '> 926 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kUnknown_Convexity'><code>SkPath::kUnknown_Convexity</code></a></td> 927 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> 928 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 929 indicates Convexity has not been determined</td> 930 </tr> 931 <tr> 932 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConvex_Convexity'><code>SkPath::kConvex_Convexity</code></a></td> 933 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> 934 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 935 one Contour made of a simple geometry without indentations</td> 936 </tr> 937 <tr style='background-color: #f0f0f0; '> 938 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConcave_Convexity'><code>SkPath::kConcave_Convexity</code></a></td> 939 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> 940 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 941 more than one Contour, or a geometry with indentations</td> 942 </tr> 943 </table> 944 945 ### Example 946 947 <div><fiddle-embed name="ac49e8b810bd6ed5d84b4f5a3b40a0ec"></fiddle-embed></div> 948 949 ### See Also 950 951 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_setConvexity'>setConvexity</a> <a href='#SkPath_isConvex'>isConvex</a> 952 953 <a name='SkPath_getConvexity'></a> 954 955 --- 956 957 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 958 <a href='#SkPath_Convexity'>Convexity</a> <a href='#SkPath_getConvexity'>getConvexity</a>()const 959 </pre> 960 961 Computes <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> if required, and returns stored value. 962 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> is computed if stored value is <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a>, 963 or if <a href='SkPath_Reference#SkPath'>SkPath</a> has been altered since <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> was computed or set. 964 965 ### Return Value 966 967 computed or stored <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> 968 969 ### Example 970 971 <div><fiddle-embed name="a8f36f2fa90003e3691fd0da0bb0c243"></fiddle-embed></div> 972 973 ### See Also 974 975 <a href='#SkPath_Convexity'>Convexity</a> <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_setConvexity'>setConvexity</a> <a href='#SkPath_isConvex'>isConvex</a> 976 977 <a name='SkPath_getConvexityOrUnknown'></a> 978 979 --- 980 981 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 982 <a href='#SkPath_Convexity'>Convexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a>()const 983 </pre> 984 985 Returns last computed <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a>, or <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a> if 986 <a href='SkPath_Reference#SkPath'>SkPath</a> has been altered since <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> was computed or set. 987 988 ### Return Value 989 990 stored <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> 991 992 ### Example 993 994 <div><fiddle-embed name="111c59e9afadb940ab8f41bdc25378a4"><div><a href='#SkPath_Convexity'>Convexity</a> is unknown unless <a href='#SkPath_getConvexity'>getConvexity</a> is called without a subsequent call 995 that alters the <a href='SkPath_Reference#Path'>path</a>. 996 </div></fiddle-embed></div> 997 998 ### See Also 999 1000 <a href='#SkPath_Convexity'>Convexity</a> <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_setConvexity'>setConvexity</a> <a href='#SkPath_isConvex'>isConvex</a> 1001 1002 <a name='SkPath_setConvexity'></a> 1003 1004 --- 1005 1006 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1007 void <a href='#SkPath_setConvexity'>setConvexity</a>(<a href='#SkPath_Convexity'>Convexity</a> convexity) 1008 </pre> 1009 1010 Stores <a href='#SkPath_setConvexity_convexity'>convexity</a> so that it is later returned by <a href='#SkPath_getConvexity'>getConvexity</a>() or <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a>(). 1011 <a href='#SkPath_setConvexity_convexity'>convexity</a> may differ from <a href='#SkPath_getConvexity'>getConvexity</a>(), although setting an incorrect value may 1012 cause incorrect or inefficient drawing. 1013 1014 If <a href='#SkPath_setConvexity_convexity'>convexity</a> is <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a>: <a href='#SkPath_getConvexity'>getConvexity</a>() will 1015 compute <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a>, and <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a>() will return <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a>. 1016 1017 If <a href='#SkPath_setConvexity_convexity'>convexity</a> is <a href='#SkPath_kConvex_Convexity'>kConvex_Convexity</a> or <a href='#SkPath_kConcave_Convexity'>kConcave_Convexity</a>, <a href='#SkPath_getConvexity'>getConvexity</a>() 1018 and <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a>() will return <a href='#SkPath_setConvexity_convexity'>convexity</a> until the <a href='SkPath_Reference#Path'>path</a> is 1019 altered. 1020 1021 ### Parameters 1022 1023 <table> <tr> <td><a name='SkPath_setConvexity_convexity'><code><strong>convexity</strong></code></a></td> 1024 <td>one of: <a href='#SkPath_kUnknown_Convexity'>kUnknown_Convexity</a>, <a href='#SkPath_kConvex_Convexity'>kConvex_Convexity</a>, or <a href='#SkPath_kConcave_Convexity'>kConcave_Convexity</a></td> 1025 </tr> 1026 </table> 1027 1028 ### Example 1029 1030 <div><fiddle-embed name="875e32b4b1cb48d739325705fc0fa42c"></fiddle-embed></div> 1031 1032 ### See Also 1033 1034 <a href='#SkPath_Convexity'>Convexity</a> <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_isConvex'>isConvex</a> 1035 1036 <a name='SkPath_isConvex'></a> 1037 1038 --- 1039 1040 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1041 bool <a href='#SkPath_isConvex'>isConvex</a>()const 1042 </pre> 1043 1044 Computes <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> if required, and returns true if value is <a href='#SkPath_kConvex_Convexity'>kConvex_Convexity</a>. 1045 If <a href='#SkPath_setConvexity'>setConvexity</a>() was called with <a href='#SkPath_kConvex_Convexity'>kConvex_Convexity</a> or <a href='#SkPath_kConcave_Convexity'>kConcave_Convexity</a>, and 1046 the <a href='SkPath_Reference#Path'>path</a> has not been altered, <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> is not recomputed. 1047 1048 ### Return Value 1049 1050 true if <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> stored or computed is <a href='#SkPath_kConvex_Convexity'>kConvex_Convexity</a> 1051 1052 ### Example 1053 1054 <div><fiddle-embed name="d8be8b6e59de244e4cbf58ec9554557b"><div>Concave shape is erroneously considered convex after a forced call to 1055 <a href='#SkPath_setConvexity'>setConvexity</a>. 1056 </div></fiddle-embed></div> 1057 1058 ### See Also 1059 1060 <a href='#SkPath_Convexity'>Convexity</a> <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_Direction'>Direction</a> <a href='#SkPath_getConvexity'>getConvexity</a> <a href='#SkPath_getConvexityOrUnknown'>getConvexityOrUnknown</a> <a href='#SkPath_setConvexity'>setConvexity</a> 1061 1062 <a name='SkPath_isOval'></a> 1063 1064 --- 1065 1066 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1067 bool <a href='#SkPath_isOval'>isOval</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* bounds)const 1068 </pre> 1069 1070 Returns true if this <a href='SkPath_Reference#Path'>path</a> is recognized as an <a href='undocumented#Oval'>oval</a> or <a href='undocumented#Circle'>circle</a>. 1071 1072 <a href='#SkPath_isOval_bounds'>bounds</a> receives <a href='#SkPath_isOval_bounds'>bounds</a> of <a href='undocumented#Oval'>oval</a>. 1073 1074 <a href='#SkPath_isOval_bounds'>bounds</a> is unmodified if <a href='undocumented#Oval'>oval</a> is not found. 1075 1076 ### Parameters 1077 1078 <table> <tr> <td><a name='SkPath_isOval_bounds'><code><strong>bounds</strong></code></a></td> 1079 <td>storage for bounding <a href='SkRect_Reference#SkRect'>SkRect</a> of <a href='undocumented#Oval'>oval</a>; may be nullptr</td> 1080 </tr> 1081 </table> 1082 1083 ### Return Value 1084 1085 true if <a href='SkPath_Reference#SkPath'>SkPath</a> is recognized as an <a href='undocumented#Oval'>oval</a> or <a href='undocumented#Circle'>circle</a> 1086 1087 ### Example 1088 1089 <div><fiddle-embed name="a51256952b183ee0f7004f2c87cbbf5b"></fiddle-embed></div> 1090 1091 ### See Also 1092 1093 <a href='undocumented#Oval'>Oval</a> <a href='#SkPath_addCircle'>addCircle</a> <a href='#SkPath_addOval'>addOval</a> 1094 1095 <a name='SkPath_isRRect'></a> 1096 1097 --- 1098 1099 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1100 bool <a href='#SkPath_isRRect'>isRRect</a>(<a href='SkRRect_Reference#SkRRect'>SkRRect</a>* rrect)const 1101 </pre> 1102 1103 Returns true if <a href='SkPath_Reference#Path'>path</a> is representable as <a href='SkRRect_Reference#SkRRect'>SkRRect</a>. 1104 Returns false if <a href='SkPath_Reference#Path'>path</a> is representable as <a href='undocumented#Oval'>oval</a>, <a href='undocumented#Circle'>circle</a>, or <a href='SkRect_Reference#SkRect'>SkRect</a>. 1105 1106 <a href='#SkPath_isRRect_rrect'>rrect</a> receives bounds of <a href='SkRRect_Reference#SkRRect'>SkRRect</a>. 1107 1108 <a href='#SkPath_isRRect_rrect'>rrect</a> is unmodified if <a href='SkRRect_Reference#SkRRect'>SkRRect</a> is not found. 1109 1110 ### Parameters 1111 1112 <table> <tr> <td><a name='SkPath_isRRect_rrect'><code><strong>rrect</strong></code></a></td> 1113 <td>storage for bounding <a href='SkRect_Reference#SkRect'>SkRect</a> of <a href='SkRRect_Reference#SkRRect'>SkRRect</a>; may be nullptr</td> 1114 </tr> 1115 </table> 1116 1117 ### Return Value 1118 1119 true if <a href='SkPath_Reference#SkPath'>SkPath</a> contains only <a href='SkRRect_Reference#SkRRect'>SkRRect</a> 1120 1121 ### Example 1122 1123 <div><fiddle-embed name="2aa939b90d96aff436b145a96305132c"><div>Draw rounded rectangle and its bounds. 1124 </div></fiddle-embed></div> 1125 1126 ### See Also 1127 1128 <a href='#RRect'>Round_Rect</a> <a href='#SkPath_addRoundRect'>addRoundRect</a> <a href='#SkPath_addRRect'>addRRect</a> 1129 1130 <a name='SkPath_reset'></a> 1131 1132 --- 1133 1134 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1135 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_reset'>reset()</a> 1136 </pre> 1137 1138 Sets <a href='SkPath_Reference#SkPath'>SkPath</a> to its initial state. 1139 Removes verb array, <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array, and <a href='SkPath_Reference#Conic_Weight'>weights</a>, and sets <a href='#SkPath_FillType'>FillType</a> to <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>. 1140 Internal storage associated with <a href='SkPath_Reference#SkPath'>SkPath</a> is released. 1141 1142 ### Return Value 1143 1144 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 1145 1146 ### Example 1147 1148 <div><fiddle-embed name="8cdca35d2964bbbecb93d79a13f71c65"></fiddle-embed></div> 1149 1150 ### See Also 1151 1152 <a href='#SkPath_rewind'>rewind()</a> 1153 1154 <a name='SkPath_rewind'></a> 1155 1156 --- 1157 1158 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1159 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rewind'>rewind()</a> 1160 </pre> 1161 1162 Sets <a href='SkPath_Reference#SkPath'>SkPath</a> to its initial state, preserving internal storage. 1163 Removes verb array, <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array, and <a href='SkPath_Reference#Conic_Weight'>weights</a>, and sets <a href='#SkPath_FillType'>FillType</a> to <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>. 1164 Internal storage associated with <a href='SkPath_Reference#SkPath'>SkPath</a> is retained. 1165 1166 Use <a href='#SkPath_rewind'>rewind()</a> instead of <a href='#SkPath_reset'>reset()</a> if <a href='SkPath_Reference#SkPath'>SkPath</a> storage will be reused and performance 1167 is critical. 1168 1169 ### Return Value 1170 1171 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 1172 1173 ### Example 1174 1175 <div><fiddle-embed name="f1fedbb89da9c2a33a91805175663012"><div>Although path1 retains its internal storage, it is indistinguishable from 1176 a newly initialized <a href='SkPath_Reference#Path'>path</a>. 1177 </div></fiddle-embed></div> 1178 1179 ### See Also 1180 1181 <a href='#SkPath_reset'>reset()</a> 1182 1183 <a name='SkPath_isEmpty'></a> 1184 1185 --- 1186 1187 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1188 bool <a href='#SkPath_isEmpty'>isEmpty</a>()const 1189 </pre> 1190 1191 Returns if <a href='SkPath_Reference#SkPath'>SkPath</a> is empty. 1192 Empty <a href='SkPath_Reference#SkPath'>SkPath</a> may have <a href='#SkPath_FillType'>FillType</a> but has no <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a>, or <a href='SkPath_Reference#Conic'>conic</a> weight. 1193 <a href='#SkPath_empty_constructor'>SkPath()</a> constructs empty <a href='SkPath_Reference#SkPath'>SkPath</a>; <a href='#SkPath_reset'>reset()</a> and <a href='#SkPath_rewind'>rewind()</a> make <a href='SkPath_Reference#SkPath'>SkPath</a> empty. 1194 1195 ### Return Value 1196 1197 true if the <a href='SkPath_Reference#Path'>path</a> contains no <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> array 1198 1199 ### Example 1200 1201 <div><fiddle-embed name="0b34e6d55d11586744adeb889d2a12f4"> 1202 1203 #### Example Output 1204 1205 ~~~~ 1206 initial path is empty 1207 after moveTo path is not empty 1208 after rewind path is empty 1209 after lineTo path is not empty 1210 after reset path is empty 1211 ~~~~ 1212 1213 </fiddle-embed></div> 1214 1215 ### See Also 1216 1217 <a href='#SkPath_empty_constructor'>SkPath()</a> <a href='#SkPath_reset'>reset()</a> <a href='#SkPath_rewind'>rewind()</a> 1218 1219 <a name='SkPath_isLastContourClosed'></a> 1220 1221 --- 1222 1223 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1224 bool <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a>()const 1225 </pre> 1226 1227 Returns if <a href='SkPath_Overview#Contour'>contour</a> is closed. 1228 <a href='SkPath_Overview#Contour'>Contour</a> is closed if <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> array was last modified by <a href='#SkPath_close'>close()</a>. When stroked, 1229 closed <a href='SkPath_Overview#Contour'>contour</a> draws <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_Join'>Join</a> instead of <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_Cap'>Cap</a> at first and last <a href='SkPoint_Reference#SkPoint'>SkPoint</a>. 1230 1231 ### Return Value 1232 1233 true if the last <a href='SkPath_Overview#Contour'>contour</a> ends with a <a href='#SkPath_kClose_Verb'>kClose_Verb</a> 1234 1235 ### Example 1236 1237 <div><fiddle-embed name="03b740ab94b9017800a52e30b5e7fee7"><div><a href='#SkPath_close'>close()</a> has no effect if <a href='SkPath_Reference#Path'>Path</a> is empty; <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a>() returns 1238 false until <a href='SkPath_Reference#Path'>Path</a> has geometry followed by <a href='#SkPath_close'>close()</a>. 1239 </div> 1240 1241 #### Example Output 1242 1243 ~~~~ 1244 initial last contour is not closed 1245 after close last contour is not closed 1246 after lineTo last contour is not closed 1247 after close last contour is closed 1248 ~~~~ 1249 1250 </fiddle-embed></div> 1251 1252 ### See Also 1253 1254 <a href='#SkPath_close'>close()</a> 1255 1256 <a name='SkPath_isFinite'></a> 1257 1258 --- 1259 1260 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1261 bool <a href='#SkPath_isFinite'>isFinite</a>()const 1262 </pre> 1263 1264 Returns true for finite <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array values between negative <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> and 1265 positive <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a>. Returns false for any <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array value of 1266 <a href='undocumented#SK_ScalarInfinity'>SK_ScalarInfinity</a>, <a href='undocumented#SK_ScalarNegativeInfinity'>SK_ScalarNegativeInfinity</a>, or <a href='undocumented#SK_ScalarNaN'>SK_ScalarNaN</a>. 1267 1268 ### Return Value 1269 1270 true if all <a href='SkPoint_Reference#SkPoint'>SkPoint</a> values are finite 1271 1272 ### Example 1273 1274 <div><fiddle-embed name="dd4e4dd2aaa8039b2430729c6b3af817"> 1275 1276 #### Example Output 1277 1278 ~~~~ 1279 initial path is finite 1280 after line path is finite 1281 after scale path is not finite 1282 ~~~~ 1283 1284 </fiddle-embed></div> 1285 1286 ### See Also 1287 1288 <a href='undocumented#SkScalar'>SkScalar</a> 1289 1290 <a name='SkPath_isVolatile'></a> 1291 1292 --- 1293 1294 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1295 bool <a href='#SkPath_isVolatile'>isVolatile</a>()const 1296 </pre> 1297 1298 Returns true if the <a href='SkPath_Reference#Path'>path</a> is volatile; it will not be altered or discarded 1299 by the caller after it is drawn. <a href='SkPath_Reference#SkPath'>SkPath</a> by default have volatile set false, allowing 1300 <a href='SkSurface_Reference#SkSurface'>SkSurface</a> to attach a cache of <a href='undocumented#Data'>data</a> which speeds repeated drawing. If true, <a href='SkSurface_Reference#SkSurface'>SkSurface</a> 1301 may not speed repeated drawing. 1302 1303 ### Return Value 1304 1305 true if caller will alter <a href='SkPath_Reference#SkPath'>SkPath</a> after drawing 1306 1307 ### Example 1308 1309 <div><fiddle-embed name="c722ebe8ac991d77757799ce29e509e1"> 1310 1311 #### Example Output 1312 1313 ~~~~ 1314 volatile by default is false 1315 ~~~~ 1316 1317 </fiddle-embed></div> 1318 1319 ### See Also 1320 1321 <a href='#SkPath_setIsVolatile'>setIsVolatile</a> 1322 1323 <a name='Volatile'></a> 1324 1325 <a name='SkPath_setIsVolatile'></a> 1326 1327 --- 1328 1329 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1330 void <a href='#SkPath_setIsVolatile'>setIsVolatile</a>(bool <a href='#SkPath_isVolatile'>isVolatile</a>) 1331 </pre> 1332 1333 Specifies whether <a href='SkPath_Reference#SkPath'>SkPath</a> is volatile; whether it will be altered or discarded 1334 by the caller after it is drawn. <a href='SkPath_Reference#SkPath'>SkPath</a> by default have volatile set false, allowing 1335 <a href='undocumented#SkBaseDevice'>SkBaseDevice</a> to attach a cache of <a href='undocumented#Data'>data</a> which speeds repeated drawing. 1336 1337 Mark temporary <a href='SkPath_Reference#Path'>paths</a>, discarded or modified after use, as volatile 1338 to inform <a href='undocumented#SkBaseDevice'>SkBaseDevice</a> that the <a href='SkPath_Reference#Path'>path</a> need not be cached. 1339 1340 Mark animating <a href='SkPath_Reference#SkPath'>SkPath</a> volatile to improve performance. 1341 Mark unchanging <a href='SkPath_Reference#SkPath'>SkPath</a> non-volatile to improve repeated rendering. 1342 1343 <a href='undocumented#Raster_Surface'>raster surface</a> <a href='SkPath_Reference#SkPath'>SkPath</a> draws are affected by volatile for some shadows. 1344 <a href='undocumented#GPU_Surface'>GPU surface</a> <a href='SkPath_Reference#SkPath'>SkPath</a> draws are affected by volatile for some shadows and concave geometries. 1345 1346 ### Parameters 1347 1348 <table> <tr> <td><a name='SkPath_setIsVolatile_isVolatile'><code><strong>isVolatile</strong></code></a></td> 1349 <td>true if caller will alter <a href='SkPath_Reference#SkPath'>SkPath</a> after drawing</td> 1350 </tr> 1351 </table> 1352 1353 ### Example 1354 1355 <div><fiddle-embed name="2049ff5141f0c80aac497618622b28af"></fiddle-embed></div> 1356 1357 ### See Also 1358 1359 <a href='#SkPath_setIsVolatile_isVolatile'>isVolatile</a> 1360 1361 <a name='SkPath_IsLineDegenerate'></a> 1362 1363 --- 1364 1365 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1366 static bool <a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, bool exact) 1367 </pre> 1368 1369 Tests if <a href='undocumented#Line'>line</a> between <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pair is degenerate. 1370 <a href='undocumented#Line'>Line</a> with no length or that moves a very short distance is degenerate; it is 1371 treated as a <a href='SkPoint_Reference#Point'>point</a>. 1372 1373 <a href='#SkPath_IsLineDegenerate_exact'>exact</a> changes the equality test. If true, returns true only if <a href='#SkPath_IsLineDegenerate_p1'>p1</a> equals <a href='#SkPath_IsLineDegenerate_p2'>p2</a>. 1374 If false, returns true if <a href='#SkPath_IsLineDegenerate_p1'>p1</a> equals or nearly equals <a href='#SkPath_IsLineDegenerate_p2'>p2</a>. 1375 1376 ### Parameters 1377 1378 <table> <tr> <td><a name='SkPath_IsLineDegenerate_p1'><code><strong>p1</strong></code></a></td> 1379 <td><a href='undocumented#Line'>line</a> start <a href='SkPoint_Reference#Point'>point</a></td> 1380 </tr> 1381 <tr> <td><a name='SkPath_IsLineDegenerate_p2'><code><strong>p2</strong></code></a></td> 1382 <td><a href='undocumented#Line'>line</a> end <a href='SkPoint_Reference#Point'>point</a></td> 1383 </tr> 1384 <tr> <td><a name='SkPath_IsLineDegenerate_exact'><code><strong>exact</strong></code></a></td> 1385 <td>if false, allow nearly equals</td> 1386 </tr> 1387 </table> 1388 1389 ### Return Value 1390 1391 true if <a href='undocumented#Line'>line</a> is degenerate; its length is effectively zero 1392 1393 ### Example 1394 1395 <div><fiddle-embed name="97a031f9186ade586928563840ce9116"><div>As single precision floats, 100 and 100.000001 have the same bit representation, 1396 and are exactly equal. 100 and 100.0001 have different bit representations, and 1397 are not exactly equal, but are nearly equal. 1398 </div> 1399 1400 #### Example Output 1401 1402 ~~~~ 1403 line from (100,100) to (100,100) is degenerate, nearly 1404 line from (100,100) to (100,100) is degenerate, exactly 1405 line from (100,100) to (100.0001,100.0001) is degenerate, nearly 1406 line from (100,100) to (100.0001,100.0001) is not degenerate, exactly 1407 ~~~~ 1408 1409 </fiddle-embed></div> 1410 1411 ### See Also 1412 1413 <a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a> <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a> 1414 1415 <a name='SkPath_IsQuadDegenerate'></a> 1416 1417 --- 1418 1419 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1420 static bool <a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3, bool exact) 1421 </pre> 1422 1423 Tests if <a href='SkPath_Reference#Quad'>quad</a> is degenerate. 1424 <a href='SkPath_Reference#Quad'>Quad</a> with no length or that moves a very short distance is degenerate; it is 1425 treated as a <a href='SkPoint_Reference#Point'>point</a>. 1426 1427 ### Parameters 1428 1429 <table> <tr> <td><a name='SkPath_IsQuadDegenerate_p1'><code><strong>p1</strong></code></a></td> 1430 <td><a href='SkPath_Reference#Quad'>quad</a> start <a href='SkPoint_Reference#Point'>point</a></td> 1431 </tr> 1432 <tr> <td><a name='SkPath_IsQuadDegenerate_p2'><code><strong>p2</strong></code></a></td> 1433 <td><a href='SkPath_Reference#Quad'>quad</a> control <a href='SkPoint_Reference#Point'>point</a></td> 1434 </tr> 1435 <tr> <td><a name='SkPath_IsQuadDegenerate_p3'><code><strong>p3</strong></code></a></td> 1436 <td><a href='SkPath_Reference#Quad'>quad</a> end <a href='SkPoint_Reference#Point'>point</a></td> 1437 </tr> 1438 <tr> <td><a name='SkPath_IsQuadDegenerate_exact'><code><strong>exact</strong></code></a></td> 1439 <td>if true, returns true only if <a href='#SkPath_IsQuadDegenerate_p1'>p1</a>, <a href='#SkPath_IsQuadDegenerate_p2'>p2</a>, and <a href='#SkPath_IsQuadDegenerate_p3'>p3</a> are equal;</td> 1440 </tr> 1441 </table> 1442 1443 if false, returns true if <a href='#SkPath_IsQuadDegenerate_p1'>p1</a>, <a href='#SkPath_IsQuadDegenerate_p2'>p2</a>, and <a href='#SkPath_IsQuadDegenerate_p3'>p3</a> are equal or nearly equal 1444 1445 ### Return Value 1446 1447 true if <a href='SkPath_Reference#Quad'>quad</a> is degenerate; its length is effectively zero 1448 1449 ### Example 1450 1451 <div><fiddle-embed name="a2b255a7dac1926cc3a247d318d63c62"><div>As single precision floats: 100, 100.00001, and 100.00002 have different bit representations 1452 but nearly the same value. Translating all three by 1000 gives them the same bit representation; 1453 the fractional portion of the number can not be represented by the float and is lost. 1454 </div> 1455 1456 #### Example Output 1457 1458 ~~~~ 1459 quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is degenerate, nearly 1460 quad (1100,1100), (1100,1100), (1100,1100) is degenerate, nearly 1461 quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is not degenerate, exactly 1462 quad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly 1463 ~~~~ 1464 1465 </fiddle-embed></div> 1466 1467 ### See Also 1468 1469 <a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a> <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a> 1470 1471 <a name='SkPath_IsCubicDegenerate'></a> 1472 1473 --- 1474 1475 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1476 static bool <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3, 1477 const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p4, bool exact) 1478 </pre> 1479 1480 Tests if <a href='SkPath_Reference#Cubic'>cubic</a> is degenerate. 1481 <a href='SkPath_Reference#Cubic'>Cubic</a> with no length or that moves a very short distance is degenerate; it is 1482 treated as a <a href='SkPoint_Reference#Point'>point</a>. 1483 1484 ### Parameters 1485 1486 <table> <tr> <td><a name='SkPath_IsCubicDegenerate_p1'><code><strong>p1</strong></code></a></td> 1487 <td><a href='SkPath_Reference#Cubic'>cubic</a> start <a href='SkPoint_Reference#Point'>point</a></td> 1488 </tr> 1489 <tr> <td><a name='SkPath_IsCubicDegenerate_p2'><code><strong>p2</strong></code></a></td> 1490 <td><a href='SkPath_Reference#Cubic'>cubic</a> control <a href='SkPoint_Reference#Point'>point</a> 1</td> 1491 </tr> 1492 <tr> <td><a name='SkPath_IsCubicDegenerate_p3'><code><strong>p3</strong></code></a></td> 1493 <td><a href='SkPath_Reference#Cubic'>cubic</a> control <a href='SkPoint_Reference#Point'>point</a> 2</td> 1494 </tr> 1495 <tr> <td><a name='SkPath_IsCubicDegenerate_p4'><code><strong>p4</strong></code></a></td> 1496 <td><a href='SkPath_Reference#Cubic'>cubic</a> end <a href='SkPoint_Reference#Point'>point</a></td> 1497 </tr> 1498 <tr> <td><a name='SkPath_IsCubicDegenerate_exact'><code><strong>exact</strong></code></a></td> 1499 <td>if true, returns true only if <a href='#SkPath_IsCubicDegenerate_p1'>p1</a>, <a href='#SkPath_IsCubicDegenerate_p2'>p2</a>, <a href='#SkPath_IsCubicDegenerate_p3'>p3</a>, and <a href='#SkPath_IsCubicDegenerate_p4'>p4</a> are equal;</td> 1500 </tr> 1501 </table> 1502 1503 if false, returns true if <a href='#SkPath_IsCubicDegenerate_p1'>p1</a>, <a href='#SkPath_IsCubicDegenerate_p2'>p2</a>, <a href='#SkPath_IsCubicDegenerate_p3'>p3</a>, and <a href='#SkPath_IsCubicDegenerate_p4'>p4</a> are equal or nearly equal 1504 1505 ### Return Value 1506 1507 true if <a href='SkPath_Reference#Cubic'>cubic</a> is degenerate; its length is effectively zero 1508 1509 ### Example 1510 1511 <div><fiddle-embed name="6b97099acdae80b16df0c4241f593991"> 1512 1513 #### Example Output 1514 1515 ~~~~ 1516 0.00024414062 is degenerate 1517 0.00024414065 is length 1518 ~~~~ 1519 1520 </fiddle-embed></div> 1521 1522 <a name='SkPath_isLine'></a> 1523 1524 --- 1525 1526 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1527 bool <a href='#SkPath_isLine'>isLine</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='undocumented#Line'>line</a>[2])const 1528 </pre> 1529 1530 Returns true if <a href='SkPath_Reference#SkPath'>SkPath</a> contains only one <a href='#SkPath_isLine_line'>line</a>; 1531 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> array has two entries: <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, <a href='#SkPath_kLine_Verb'>kLine_Verb</a>. 1532 If <a href='SkPath_Reference#SkPath'>SkPath</a> contains one <a href='#SkPath_isLine_line'>line</a> and <a href='#SkPath_isLine_line'>line</a> is not nullptr, <a href='#SkPath_isLine_line'>line</a> is set to 1533 <a href='#SkPath_isLine_line'>line</a> start <a href='SkPoint_Reference#Point'>point</a> and <a href='#SkPath_isLine_line'>line</a> end <a href='SkPoint_Reference#Point'>point</a>. 1534 Returns false if <a href='SkPath_Reference#SkPath'>SkPath</a> is not one <a href='#SkPath_isLine_line'>line</a>; <a href='#SkPath_isLine_line'>line</a> is unaltered. 1535 1536 ### Parameters 1537 1538 <table> <tr> <td><a name='SkPath_isLine_line'><code><strong>line</strong></code></a></td> 1539 <td>storage for <a href='#SkPath_isLine_line'>line</a>. May be nullptr</td> 1540 </tr> 1541 </table> 1542 1543 ### Return Value 1544 1545 true if <a href='SkPath_Reference#SkPath'>SkPath</a> contains exactly one <a href='#SkPath_isLine_line'>line</a> 1546 1547 ### Example 1548 1549 <div><fiddle-embed name="1ad07d56e4258e041606d50cad969392"> 1550 1551 #### Example Output 1552 1553 ~~~~ 1554 empty is not line 1555 zero line is line (0,0) (0,0) 1556 line is line (10,10) (20,20) 1557 second move is not line 1558 ~~~~ 1559 1560 </fiddle-embed></div> 1561 1562 <a name='Point_Array'></a> 1563 1564 <a href='#Path_Point_Array'>Point_Array</a> contains <a href='SkPoint_Reference#Point'>Points</a> satisfying the allocated <a href='SkPoint_Reference#Point'>Points</a> for 1565 each <a href='#SkPath_Verb'>Verb</a> in <a href='#Path_Verb_Array'>Verb_Array</a>. For instance, <a href='SkPath_Reference#Path'>Path</a> containing one <a href='SkPath_Overview#Contour'>Contour</a> with <a href='undocumented#Line'>Line</a> 1566 and <a href='SkPath_Reference#Quad'>Quad</a> is described by <a href='#Path_Verb_Array'>Verb_Array</a>: <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a>; and 1567 one <a href='SkPoint_Reference#Point'>Point</a> for move, one <a href='SkPoint_Reference#Point'>Point</a> for <a href='undocumented#Line'>Line</a>, two <a href='SkPoint_Reference#Point'>Points</a> for <a href='SkPath_Reference#Quad'>Quad</a>; totaling four <a href='SkPoint_Reference#Point'>Points</a>. 1568 1569 <a href='#Path_Point_Array'>Point_Array</a> may be read directly from <a href='SkPath_Reference#Path'>Path</a> with <a href='#SkPath_getPoints'>getPoints</a>, or inspected with 1570 <a href='#SkPath_getPoint'>getPoint</a>, with <a href='#SkPath_Iter'>Iter</a>, or with <a href='#SkPath_RawIter'>RawIter</a>. 1571 1572 <a name='SkPath_getPoints'></a> 1573 1574 --- 1575 1576 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1577 int <a href='#SkPath_getPoints'>getPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='SkPoint_Reference#Point'>points</a>[], int max)const 1578 </pre> 1579 1580 Returns number of <a href='#SkPath_getPoints_points'>points</a> in <a href='SkPath_Reference#SkPath'>SkPath</a>. Up to <a href='#SkPath_getPoints_max'>max</a> <a href='#SkPath_getPoints_points'>points</a> are copied. 1581 <a href='#SkPath_getPoints_points'>points</a> may be nullptr; then, <a href='#SkPath_getPoints_max'>max</a> must be zero. 1582 If <a href='#SkPath_getPoints_max'>max</a> is greater than number of <a href='#SkPath_getPoints_points'>points</a>, excess <a href='#SkPath_getPoints_points'>points</a> storage is unaltered. 1583 1584 ### Parameters 1585 1586 <table> <tr> <td><a name='SkPath_getPoints_points'><code><strong>points</strong></code></a></td> 1587 <td>storage for <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. May be nullptr</td> 1588 </tr> 1589 <tr> <td><a name='SkPath_getPoints_max'><code><strong>max</strong></code></a></td> 1590 <td>maximum to copy; must be greater than or equal to zero</td> 1591 </tr> 1592 </table> 1593 1594 ### Return Value 1595 1596 <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#Point_Array'>SkPoint array</a> length 1597 1598 ### Example 1599 1600 <div><fiddle-embed name="9bc86efda08cbcd9c6f7c5f220294a24"> 1601 1602 #### Example Output 1603 1604 ~~~~ 1605 no points point count: 3 1606 zero max point count: 3 1607 too small point count: 3 (0,0) (20,20) 1608 just right point count: 3 (0,0) (20,20) (-10,-10) 1609 ~~~~ 1610 1611 </fiddle-embed></div> 1612 1613 ### See Also 1614 1615 <a href='#SkPath_countPoints'>countPoints</a> <a href='#SkPath_getPoint'>getPoint</a> 1616 1617 <a name='SkPath_countPoints'></a> 1618 1619 --- 1620 1621 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1622 int <a href='#SkPath_countPoints'>countPoints</a>()const 1623 </pre> 1624 1625 Returns the number of <a href='SkPoint_Reference#Point'>points</a> in <a href='SkPath_Reference#SkPath'>SkPath</a>. 1626 <a href='SkPoint_Reference#SkPoint'>SkPoint</a> count is initially zero. 1627 1628 ### Return Value 1629 1630 <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array length 1631 1632 ### Example 1633 1634 <div><fiddle-embed name="bca6379ccef62cb081b10db7381deb27"> 1635 1636 #### Example Output 1637 1638 ~~~~ 1639 empty point count: 0 1640 zero line point count: 2 1641 line point count: 2 1642 second move point count: 3 1643 ~~~~ 1644 1645 </fiddle-embed></div> 1646 1647 ### See Also 1648 1649 <a href='#SkPath_getPoints'>getPoints</a> 1650 1651 <a name='SkPath_getPoint'></a> 1652 1653 --- 1654 1655 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1656 <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_getPoint'>getPoint</a>(int index)const 1657 </pre> 1658 1659 Returns <a href='SkPoint_Reference#SkPoint'>SkPoint</a> at <a href='#SkPath_getPoint_index'>index</a> in <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. Valid range for <a href='#SkPath_getPoint_index'>index</a> is 1660 0 to <a href='#SkPath_countPoints'>countPoints</a>() - 1. 1661 Returns (0, 0) if <a href='#SkPath_getPoint_index'>index</a> is out of range. 1662 1663 ### Parameters 1664 1665 <table> <tr> <td><a name='SkPath_getPoint_index'><code><strong>index</strong></code></a></td> 1666 <td><a href='SkPath_Reference#Point_Array'>SkPoint array</a> element selector</td> 1667 </tr> 1668 </table> 1669 1670 ### Return Value 1671 1672 <a href='SkPath_Reference#Point_Array'>SkPoint array</a> value or (0, 0) 1673 1674 ### Example 1675 1676 <div><fiddle-embed name="42885f1df13de109adccc5d531f62111"> 1677 1678 #### Example Output 1679 1680 ~~~~ 1681 point 0: (-10,-10) 1682 point 1: (10,10) 1683 ~~~~ 1684 1685 </fiddle-embed></div> 1686 1687 ### See Also 1688 1689 <a href='#SkPath_countPoints'>countPoints</a> <a href='#SkPath_getPoints'>getPoints</a> 1690 1691 <a name='Verb_Array'></a> 1692 1693 <a href='#Path_Verb_Array'>Verb_Array</a> always starts with <a href='#SkPath_kMove_Verb'>kMove_Verb</a>. 1694 If <a href='#SkPath_kClose_Verb'>kClose_Verb</a> is not the last entry, it is always followed by <a href='#SkPath_kMove_Verb'>kMove_Verb</a>; 1695 the quantity of <a href='#SkPath_kMove_Verb'>kMove_Verb</a> equals the <a href='SkPath_Overview#Contour'>Contour</a> count. 1696 <a href='#Path_Verb_Array'>Verb_Array</a> does not include or count <a href='#SkPath_kDone_Verb'>kDone_Verb</a>; it is a convenience 1697 returned when iterating through <a href='#Path_Verb_Array'>Verb_Array</a>. 1698 1699 <a href='#Path_Verb_Array'>Verb_Array</a> may be read directly from <a href='SkPath_Reference#Path'>Path</a> with <a href='#SkPath_getVerbs'>getVerbs</a>, or inspected with <a href='#SkPath_Iter'>Iter</a>, 1700 or with <a href='#SkPath_RawIter'>RawIter</a>. 1701 1702 <a name='SkPath_countVerbs'></a> 1703 1704 --- 1705 1706 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1707 int <a href='#SkPath_countVerbs'>countVerbs</a>()const 1708 </pre> 1709 1710 Returns the number of <a href='SkPath_Reference#Verb'>verbs</a>: <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a>, <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, 1711 <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose_Verb</a>; added to <a href='SkPath_Reference#SkPath'>SkPath</a>. 1712 1713 ### Return Value 1714 1715 length of verb array 1716 1717 ### Example 1718 1719 <div><fiddle-embed name="af0c66aea3ef81b709664c7007f48aae"> 1720 1721 #### Example Output 1722 1723 ~~~~ 1724 empty verb count: 0 1725 round rect verb count: 10 1726 ~~~~ 1727 1728 </fiddle-embed></div> 1729 1730 ### See Also 1731 1732 <a href='#SkPath_getVerbs'>getVerbs</a> <a href='#SkPath_Iter'>Iter</a> <a href='#SkPath_RawIter'>RawIter</a> 1733 1734 <a name='SkPath_getVerbs'></a> 1735 1736 --- 1737 1738 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1739 int <a href='#SkPath_getVerbs'>getVerbs</a>(uint8_t <a href='SkPath_Reference#Verb'>verbs</a>[], int max)const 1740 </pre> 1741 1742 Returns the number of <a href='#SkPath_getVerbs_verbs'>verbs</a> in the <a href='SkPath_Reference#Path'>path</a>. Up to <a href='#SkPath_getVerbs_max'>max</a> <a href='#SkPath_getVerbs_verbs'>verbs</a> are copied. The 1743 <a href='#SkPath_getVerbs_verbs'>verbs</a> are copied as one byte per verb. 1744 1745 ### Parameters 1746 1747 <table> <tr> <td><a name='SkPath_getVerbs_verbs'><code><strong>verbs</strong></code></a></td> 1748 <td>storage for <a href='#SkPath_getVerbs_verbs'>verbs</a>, may be nullptr</td> 1749 </tr> 1750 <tr> <td><a name='SkPath_getVerbs_max'><code><strong>max</strong></code></a></td> 1751 <td>maximum number to copy into <a href='#SkPath_getVerbs_verbs'>verbs</a></td> 1752 </tr> 1753 </table> 1754 1755 ### Return Value 1756 1757 the actual number of <a href='#SkPath_getVerbs_verbs'>verbs</a> in the <a href='SkPath_Reference#Path'>path</a> 1758 1759 ### Example 1760 1761 <div><fiddle-embed name="2ec66880966a6133ddd9331ce7323438"> 1762 1763 #### Example Output 1764 1765 ~~~~ 1766 no verbs verb count: 3 1767 zero max verb count: 3 1768 too small verb count: 3 move line 1769 just right verb count: 3 move line line 1770 ~~~~ 1771 1772 </fiddle-embed></div> 1773 1774 ### See Also 1775 1776 <a href='#SkPath_countVerbs'>countVerbs</a> <a href='#SkPath_getPoints'>getPoints</a> <a href='#SkPath_Iter'>Iter</a> <a href='#SkPath_RawIter'>RawIter</a> 1777 1778 <a name='SkPath_swap'></a> 1779 1780 --- 1781 1782 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1783 void <a href='#SkPath_swap'>swap</a>(<a href='SkPath_Reference#SkPath'>SkPath</a>& other) 1784 </pre> 1785 1786 Exchanges the <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, <a href='SkPath_Reference#Conic_Weight'>weights</a>, and <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a> with <a href='#SkPath_swap_other'>other</a>. 1787 Cached state is also exchanged. <a href='#SkPath_swap'>swap()</a> internally exchanges pointers, so 1788 it is lightweight and does not allocate memory. 1789 1790 <a href='#SkPath_swap'>swap()</a> usage has largely been replaced by <a href='#SkPath_copy_operator'>operator=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>). 1791 <a href='SkPath_Reference#SkPath'>SkPath</a> do not copy their content on assignment until they are written to, 1792 making assignment as efficient as <a href='#SkPath_swap'>swap()</a>. 1793 1794 ### Parameters 1795 1796 <table> <tr> <td><a name='SkPath_swap_other'><code><strong>other</strong></code></a></td> 1797 <td><a href='SkPath_Reference#SkPath'>SkPath</a> exchanged by value</td> 1798 </tr> 1799 </table> 1800 1801 ### Example 1802 1803 <div><fiddle-embed name="4c5ebee2b5039e5faefa07ae63a15467"> 1804 1805 #### Example Output 1806 1807 ~~~~ 1808 path1 bounds = 0, 0, 0, 0 1809 path2 bounds = 10, 20, 30, 40 1810 ~~~~ 1811 1812 </fiddle-embed></div> 1813 1814 ### See Also 1815 1816 <a href='#SkPath_copy_operator'>operator=</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) 1817 1818 <a name='SkPath_getBounds'></a> 1819 1820 --- 1821 1822 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1823 const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkPath_getBounds'>getBounds</a>()const 1824 </pre> 1825 1826 Returns minimum and maximum axes values of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array. 1827 Returns (0, 0, 0, 0) if <a href='SkPath_Reference#SkPath'>SkPath</a> contains no <a href='SkPoint_Reference#Point'>points</a>. Returned bounds width and height may 1828 be larger or smaller than area affected when <a href='SkPath_Reference#SkPath'>SkPath</a> is drawn. 1829 1830 <a href='SkRect_Reference#SkRect'>SkRect</a> returned includes all <a href='SkPoint_Reference#SkPoint'>SkPoint</a> added to <a href='SkPath_Reference#SkPath'>SkPath</a>, including <a href='SkPoint_Reference#SkPoint'>SkPoint</a> associated with 1831 <a href='#SkPath_kMove_Verb'>kMove_Verb</a> that define empty <a href='SkPath_Overview#Contour'>contours</a>. 1832 1833 ### Return Value 1834 1835 bounds of all <a href='SkPoint_Reference#SkPoint'>SkPoint</a> in <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array 1836 1837 ### Example 1838 1839 <div><fiddle-embed name="45c0fc3acb74fab99d544b80eadd10ad"><div>Bounds of upright <a href='undocumented#Circle'>Circle</a> can be predicted from center and radius. 1840 Bounds of rotated <a href='undocumented#Circle'>Circle</a> includes control <a href='SkPoint_Reference#Point'>Points</a> outside of filled area. 1841 </div> 1842 1843 #### Example Output 1844 1845 ~~~~ 1846 empty bounds = 0, 0, 0, 0 1847 circle bounds = 25, 20, 75, 70 1848 rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553 1849 ~~~~ 1850 1851 </fiddle-embed></div> 1852 1853 ### See Also 1854 1855 <a href='#SkPath_computeTightBounds'>computeTightBounds</a> <a href='#SkPath_updateBoundsCache'>updateBoundsCache</a> 1856 1857 <a name='Utility'></a> 1858 1859 <a name='SkPath_updateBoundsCache'></a> 1860 1861 --- 1862 1863 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1864 void <a href='#SkPath_updateBoundsCache'>updateBoundsCache</a>()const 1865 </pre> 1866 1867 Updates internal bounds so that subsequent calls to <a href='#SkPath_getBounds'>getBounds</a>() are instantaneous. 1868 Unaltered copies of <a href='SkPath_Reference#SkPath'>SkPath</a> may also access cached bounds through <a href='#SkPath_getBounds'>getBounds</a>(). 1869 1870 For now, identical to calling <a href='#SkPath_getBounds'>getBounds</a>() and ignoring the returned value. 1871 1872 Call to prepare <a href='SkPath_Reference#SkPath'>SkPath</a> subsequently drawn from multiple threads, 1873 to avoid a race condition where each draw separately computes the bounds. 1874 1875 ### Example 1876 1877 <div><fiddle-embed name="bb761cd858e6d0ca05627262cd22ff5e"> 1878 1879 #### Example Output 1880 1881 ~~~~ 1882 #Volatile 1883 uncached avg: 0.18048 ms 1884 cached avg: 0.182784 ms 1885 ~~~~ 1886 1887 </fiddle-embed></div> 1888 1889 ### See Also 1890 1891 <a href='#SkPath_getBounds'>getBounds</a> 1892 1893 <a name='SkPath_computeTightBounds'></a> 1894 1895 --- 1896 1897 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1898 <a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPath_computeTightBounds'>computeTightBounds</a>()const 1899 </pre> 1900 1901 Returns minimum and maximum axes values of the <a href='undocumented#Line'>lines</a> and <a href='undocumented#Curve'>curves</a> in <a href='SkPath_Reference#SkPath'>SkPath</a>. 1902 Returns (0, 0, 0, 0) if <a href='SkPath_Reference#SkPath'>SkPath</a> contains no <a href='SkPoint_Reference#Point'>points</a>. 1903 Returned bounds width and height may be larger or smaller than area affected 1904 when <a href='SkPath_Reference#SkPath'>SkPath</a> is drawn. 1905 1906 Includes <a href='SkPoint_Reference#SkPoint'>SkPoint</a> associated with <a href='#SkPath_kMove_Verb'>kMove_Verb</a> that define empty 1907 <a href='SkPath_Overview#Contour'>contours</a>. 1908 1909 Behaves identically to <a href='#SkPath_getBounds'>getBounds</a>() when <a href='SkPath_Reference#SkPath'>SkPath</a> contains 1910 only <a href='undocumented#Line'>lines</a>. If <a href='SkPath_Reference#SkPath'>SkPath</a> contains <a href='undocumented#Curve'>curves</a>, computed bounds includes 1911 the maximum extent of the <a href='SkPath_Reference#Quad'>quad</a>, <a href='SkPath_Reference#Conic'>conic</a>, or <a href='SkPath_Reference#Cubic'>cubic</a>; is slower than <a href='#SkPath_getBounds'>getBounds</a>(); 1912 and unlike <a href='#SkPath_getBounds'>getBounds</a>(), does not cache the result. 1913 1914 ### Return Value 1915 1916 tight bounds of <a href='undocumented#Curve'>curves</a> in <a href='SkPath_Reference#SkPath'>SkPath</a> 1917 1918 ### Example 1919 1920 <div><fiddle-embed name="9a39c56e95b19a657133b7ad1fe0cf03"> 1921 1922 #### Example Output 1923 1924 ~~~~ 1925 empty bounds = 0, 0, 0, 0 1926 circle bounds = 25, 20, 75, 70 1927 rotated circle bounds = 25, 20, 75, 70 1928 ~~~~ 1929 1930 </fiddle-embed></div> 1931 1932 ### See Also 1933 1934 <a href='#SkPath_getBounds'>getBounds</a> 1935 1936 <a name='SkPath_conservativelyContainsRect'></a> 1937 1938 --- 1939 1940 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1941 bool <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>)const 1942 </pre> 1943 1944 Returns true if <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained by <a href='SkPath_Reference#SkPath'>SkPath</a>. 1945 May return false when <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained by <a href='SkPath_Reference#SkPath'>SkPath</a>. 1946 1947 For now, only returns true if <a href='SkPath_Reference#SkPath'>SkPath</a> has one <a href='SkPath_Overview#Contour'>contour</a> and is convex. 1948 <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> may share <a href='SkPoint_Reference#Point'>points</a> and edges with <a href='SkPath_Reference#SkPath'>SkPath</a> and be contained. 1949 Returns true if <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is empty, that is, it has zero width or height; and 1950 the <a href='SkPoint_Reference#SkPoint'>SkPoint</a> or <a href='undocumented#Line'>line</a> described by <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained by <a href='SkPath_Reference#SkPath'>SkPath</a>. 1951 1952 ### Parameters 1953 1954 <table> <tr> <td><a name='SkPath_conservativelyContainsRect_rect'><code><strong>rect</strong></code></a></td> 1955 <td><a href='SkRect_Reference#SkRect'>SkRect</a>, <a href='undocumented#Line'>line</a>, or <a href='SkPoint_Reference#SkPoint'>SkPoint</a> checked for containment</td> 1956 </tr> 1957 </table> 1958 1959 ### Return Value 1960 1961 true if <a href='#SkPath_conservativelyContainsRect_rect'>rect</a> is contained 1962 1963 ### Example 1964 1965 <div><fiddle-embed name="41638d13e40fa449ece354dde5fb1941"><div><a href='SkRect_Reference#Rect'>Rect</a> is drawn in blue if it is contained by red <a href='SkPath_Reference#Path'>Path</a>. 1966 </div></fiddle-embed></div> 1967 1968 ### See Also 1969 1970 <a href='#SkPath_contains'>contains</a> <a href='undocumented#Op'>Op</a> <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkPath_Convexity'>Convexity</a> 1971 1972 <a name='SkPath_incReserve'></a> 1973 1974 --- 1975 1976 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 1977 void <a href='#SkPath_incReserve'>incReserve</a>(int extraPtCount) 1978 </pre> 1979 1980 Grows <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='#Verb_Array'>verb array</a> and <a href='SkPath_Reference#Point_Array'>SkPoint array</a> to contain <a href='#SkPath_incReserve_extraPtCount'>extraPtCount</a> additional <a href='SkPoint_Reference#SkPoint'>SkPoint</a>. 1981 May improve performance and use less memory by 1982 reducing the number and <a href='undocumented#Size'>size</a> of allocations when creating <a href='SkPath_Reference#SkPath'>SkPath</a>. 1983 1984 ### Parameters 1985 1986 <table> <tr> <td><a name='SkPath_incReserve_extraPtCount'><code><strong>extraPtCount</strong></code></a></td> 1987 <td>number of additional <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to allocate</td> 1988 </tr> 1989 </table> 1990 1991 ### Example 1992 1993 <div><fiddle-embed name="f2260f2a170a54aef5bafe5b91c121b3"></fiddle-embed></div> 1994 1995 ### See Also 1996 1997 <a href='#Path_Point_Array'>Point_Array</a> 1998 1999 <a name='SkPath_shrinkToFit'></a> 2000 2001 --- 2002 2003 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2004 void <a href='#SkPath_shrinkToFit'>shrinkToFit</a>() 2005 </pre> 2006 2007 Shrinks <a href='SkPath_Reference#SkPath'>SkPath</a> verb array and <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array storage to discard unused capacity. 2008 May reduce the heap overhead for <a href='SkPath_Reference#SkPath'>SkPath</a> known to be fully constructed. 2009 2010 ### See Also 2011 2012 <a href='#SkPath_incReserve'>incReserve</a> 2013 2014 <a name='Build'></a> 2015 2016 <a name='SkPath_moveTo'></a> 2017 2018 --- 2019 2020 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2021 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_moveTo'>moveTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) 2022 </pre> 2023 2024 Adds beginning of <a href='SkPath_Overview#Contour'>contour</a> at <a href='SkPoint_Reference#SkPoint'>SkPoint</a> (<a href='#SkPath_moveTo_x'>x</a>, <a href='#SkPath_moveTo_y'>y</a>). 2025 2026 ### Parameters 2027 2028 <table> <tr> <td><a name='SkPath_moveTo_x'><code><strong>x</strong></code></a></td> 2029 <td>x-axis value of <a href='SkPath_Overview#Contour'>contour</a> start</td> 2030 </tr> 2031 <tr> <td><a name='SkPath_moveTo_y'><code><strong>y</strong></code></a></td> 2032 <td>y-axis value of <a href='SkPath_Overview#Contour'>contour</a> start</td> 2033 </tr> 2034 </table> 2035 2036 ### Return Value 2037 2038 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2039 2040 ### Example 2041 2042 <div><fiddle-embed name="84101d341e934a535a41ad6cf42218ce"></fiddle-embed></div> 2043 2044 ### See Also 2045 2046 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_lineTo'>lineTo</a> <a href='#SkPath_rMoveTo'>rMoveTo</a> <a href='#SkPath_quadTo'>quadTo</a> <a href='#SkPath_conicTo'>conicTo</a> <a href='#SkPath_cubicTo'>cubicTo</a> <a href='#SkPath_close'>close()</a> 2047 2048 <a name='SkPath_moveTo_2'></a> 2049 2050 --- 2051 2052 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2053 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_moveTo'>moveTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p) 2054 </pre> 2055 2056 Adds beginning of <a href='SkPath_Overview#Contour'>contour</a> at <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_moveTo_2_p'>p</a>. 2057 2058 ### Parameters 2059 2060 <table> <tr> <td><a name='SkPath_moveTo_2_p'><code><strong>p</strong></code></a></td> 2061 <td><a href='SkPath_Overview#Contour'>contour</a> start</td> 2062 </tr> 2063 </table> 2064 2065 ### Return Value 2066 2067 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2068 2069 ### Example 2070 2071 <div><fiddle-embed name="cb8d37990f6e7df3bcc85e7240c81274"></fiddle-embed></div> 2072 2073 ### See Also 2074 2075 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_lineTo'>lineTo</a> <a href='#SkPath_rMoveTo'>rMoveTo</a> <a href='#SkPath_quadTo'>quadTo</a> <a href='#SkPath_conicTo'>conicTo</a> <a href='#SkPath_cubicTo'>cubicTo</a> <a href='#SkPath_close'>close()</a> 2076 2077 <a name='SkPath_rMoveTo'></a> 2078 2079 --- 2080 2081 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2082 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rMoveTo'>rMoveTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) 2083 </pre> 2084 2085 Adds beginning of <a href='SkPath_Overview#Contour'>contour</a> relative to <a href='#Last_Point'>last point</a>. 2086 If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, starts <a href='SkPath_Overview#Contour'>contour</a> at (<a href='#SkPath_rMoveTo_dx'>dx</a>, <a href='#SkPath_rMoveTo_dy'>dy</a>). 2087 Otherwise, start <a href='SkPath_Overview#Contour'>contour</a> at <a href='#Last_Point'>last point</a> offset by (<a href='#SkPath_rMoveTo_dx'>dx</a>, <a href='#SkPath_rMoveTo_dy'>dy</a>). 2088 Function name stands for "relative move to". 2089 2090 ### Parameters 2091 2092 <table> <tr> <td><a name='SkPath_rMoveTo_dx'><code><strong>dx</strong></code></a></td> 2093 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Overview#Contour'>contour</a> start on x-axis</td> 2094 </tr> 2095 <tr> <td><a name='SkPath_rMoveTo_dy'><code><strong>dy</strong></code></a></td> 2096 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Overview#Contour'>contour</a> start on y-axis</td> 2097 </tr> 2098 </table> 2099 2100 ### Return Value 2101 2102 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2103 2104 ### Example 2105 2106 <div><fiddle-embed name="63e32dec4b2d8440b427f368bf8313a4"></fiddle-embed></div> 2107 2108 ### See Also 2109 2110 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_lineTo'>lineTo</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_quadTo'>quadTo</a> <a href='#SkPath_conicTo'>conicTo</a> <a href='#SkPath_cubicTo'>cubicTo</a> <a href='#SkPath_close'>close()</a> 2111 2112 <a name='SkPath_lineTo'></a> 2113 2114 --- 2115 2116 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2117 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_lineTo'>lineTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) 2118 </pre> 2119 2120 Adds <a href='undocumented#Line'>line</a> from <a href='#Last_Point'>last point</a> to (<a href='#SkPath_lineTo_x'>x</a>, <a href='#SkPath_lineTo_y'>y</a>). If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is 2121 <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) before adding <a href='undocumented#Line'>line</a>. 2122 2123 <a href='#SkPath_lineTo'>lineTo</a>() appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed. 2124 <a href='#SkPath_lineTo'>lineTo</a>() then appends <a href='#SkPath_kLine_Verb'>kLine_Verb</a> to <a href='#Verb_Array'>verb array</a> and (<a href='#SkPath_lineTo_x'>x</a>, <a href='#SkPath_lineTo_y'>y</a>) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2125 2126 ### Parameters 2127 2128 <table> <tr> <td><a name='SkPath_lineTo_x'><code><strong>x</strong></code></a></td> 2129 <td>end of added <a href='undocumented#Line'>line</a> on x-axis</td> 2130 </tr> 2131 <tr> <td><a name='SkPath_lineTo_y'><code><strong>y</strong></code></a></td> 2132 <td>end of added <a href='undocumented#Line'>line</a> on y-axis</td> 2133 </tr> 2134 </table> 2135 2136 ### Return Value 2137 2138 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2139 2140 ### Example 2141 2142 <div><fiddle-embed name="e311cdd451edacec33b50cc22a4dd5dc"></fiddle-embed></div> 2143 2144 ### See Also 2145 2146 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_rLineTo'>rLineTo</a> <a href='#SkPath_addRect'>addRect</a> 2147 2148 <a name='SkPath_lineTo_2'></a> 2149 2150 --- 2151 2152 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2153 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_lineTo'>lineTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p) 2154 </pre> 2155 2156 Adds <a href='undocumented#Line'>line</a> from <a href='#Last_Point'>last point</a> to <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_lineTo_2_p'>p</a>. If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is 2157 <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) before adding <a href='undocumented#Line'>line</a>. 2158 2159 <a href='#SkPath_lineTo'>lineTo</a>() first appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed. 2160 <a href='#SkPath_lineTo'>lineTo</a>() then appends <a href='#SkPath_kLine_Verb'>kLine_Verb</a> to <a href='#Verb_Array'>verb array</a> and <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_lineTo_2_p'>p</a> to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2161 2162 ### Parameters 2163 2164 <table> <tr> <td><a name='SkPath_lineTo_2_p'><code><strong>p</strong></code></a></td> 2165 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of added <a href='undocumented#Line'>line</a></td> 2166 </tr> 2167 </table> 2168 2169 ### Return Value 2170 2171 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2172 2173 ### Example 2174 2175 <div><fiddle-embed name="41001546a7f7927d08e5a818bcc304f5"></fiddle-embed></div> 2176 2177 ### See Also 2178 2179 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_rLineTo'>rLineTo</a> <a href='#SkPath_addRect'>addRect</a> 2180 2181 <a name='SkPath_rLineTo'></a> 2182 2183 --- 2184 2185 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2186 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rLineTo'>rLineTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) 2187 </pre> 2188 2189 Adds <a href='undocumented#Line'>line</a> from <a href='#Last_Point'>last point</a> to <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rLineTo_dx'>dx</a>, <a href='#SkPath_rLineTo_dy'>dy</a>). If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is 2190 <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) before adding <a href='undocumented#Line'>line</a>. 2191 2192 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed; 2193 then appends <a href='#SkPath_kLine_Verb'>kLine_Verb</a> to <a href='#Verb_Array'>verb array</a> and <a href='undocumented#Line'>line</a> end to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2194 <a href='undocumented#Line'>Line</a> end is <a href='#Last_Point'>last point</a> plus <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rLineTo_dx'>dx</a>, <a href='#SkPath_rLineTo_dy'>dy</a>). 2195 Function name stands for "relative <a href='undocumented#Line'>line</a> to". 2196 2197 ### Parameters 2198 2199 <table> <tr> <td><a name='SkPath_rLineTo_dx'><code><strong>dx</strong></code></a></td> 2200 <td>offset from <a href='#Last_Point'>last point</a> to <a href='undocumented#Line'>line</a> end on x-axis</td> 2201 </tr> 2202 <tr> <td><a name='SkPath_rLineTo_dy'><code><strong>dy</strong></code></a></td> 2203 <td>offset from <a href='#Last_Point'>last point</a> to <a href='undocumented#Line'>line</a> end on y-axis</td> 2204 </tr> 2205 </table> 2206 2207 ### Return Value 2208 2209 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2210 2211 ### Example 2212 2213 <div><fiddle-embed name="6e0be0766b8ca320da51640326e608b3"></fiddle-embed></div> 2214 2215 ### See Also 2216 2217 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_lineTo'>lineTo</a> <a href='#SkPath_addRect'>addRect</a> 2218 2219 <a name='Quad'></a> 2220 2221 --- 2222 2223 <a href='SkPath_Reference#Quad'>Quad</a> describes a <a href='#Path_Quad'>Quadratic_Bezier</a>, a second-order <a href='undocumented#Curve'>curve</a> identical to a section 2224 of a parabola. <a href='SkPath_Reference#Quad'>Quad</a> begins at a start <a href='SkPoint_Reference#Point'>Point</a>, <a href='undocumented#Curve'>curves</a> towards a control <a href='SkPoint_Reference#Point'>Point</a>, 2225 and then <a href='undocumented#Curve'>curves</a> to an end <a href='SkPoint_Reference#Point'>Point</a>. 2226 2227 ### Example 2228 2229 <div><fiddle-embed name="78ad51fa1cd33eb84a6f99061e56e067"></fiddle-embed></div> 2230 2231 <a href='SkPath_Reference#Quad'>Quad</a> is a special case of <a href='SkPath_Reference#Conic'>Conic</a> where <a href='#Path_Conic_Weight'>Conic_Weight</a> is set to one. 2232 2233 <a href='SkPath_Reference#Quad'>Quad</a> is always contained by the triangle connecting its three <a href='SkPoint_Reference#Point'>Points</a>. <a href='SkPath_Reference#Quad'>Quad</a> 2234 begins tangent to the <a href='undocumented#Line'>line</a> between start <a href='SkPoint_Reference#Point'>Point</a> and control <a href='SkPoint_Reference#Point'>Point</a>, and ends 2235 tangent to the <a href='undocumented#Line'>line</a> between control <a href='SkPoint_Reference#Point'>Point</a> and end <a href='SkPoint_Reference#Point'>Point</a>. 2236 2237 ### Example 2238 2239 <div><fiddle-embed name="4082f66a42df11bb20462b232b156bb6"></fiddle-embed></div> 2240 2241 <a name='SkPath_quadTo'></a> 2242 2243 --- 2244 2245 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2246 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_quadTo'>quadTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2) 2247 </pre> 2248 2249 Adds <a href='SkPath_Reference#Quad'>quad</a> from <a href='#Last_Point'>last point</a> towards (<a href='#SkPath_quadTo_x1'>x1</a>, <a href='#SkPath_quadTo_y1'>y1</a>), to (<a href='#SkPath_quadTo_x2'>x2</a>, <a href='#SkPath_quadTo_y2'>y2</a>). 2250 If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) 2251 before adding <a href='SkPath_Reference#Quad'>quad</a>. 2252 2253 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed; 2254 then appends <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a> to <a href='#Verb_Array'>verb array</a>; and (<a href='#SkPath_quadTo_x1'>x1</a>, <a href='#SkPath_quadTo_y1'>y1</a>), (<a href='#SkPath_quadTo_x2'>x2</a>, <a href='#SkPath_quadTo_y2'>y2</a>) 2255 to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2256 2257 ### Parameters 2258 2259 <table> <tr> <td><a name='SkPath_quadTo_x1'><code><strong>x1</strong></code></a></td> 2260 <td>control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Quad'>quad</a> on x-axis</td> 2261 </tr> 2262 <tr> <td><a name='SkPath_quadTo_y1'><code><strong>y1</strong></code></a></td> 2263 <td>control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Quad'>quad</a> on y-axis</td> 2264 </tr> 2265 <tr> <td><a name='SkPath_quadTo_x2'><code><strong>x2</strong></code></a></td> 2266 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Quad'>quad</a> on x-axis</td> 2267 </tr> 2268 <tr> <td><a name='SkPath_quadTo_y2'><code><strong>y2</strong></code></a></td> 2269 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Quad'>quad</a> on y-axis</td> 2270 </tr> 2271 </table> 2272 2273 ### Return Value 2274 2275 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2276 2277 ### Example 2278 2279 <div><fiddle-embed name="60ee3eb747474f5781b0f0dd3a17a866"></fiddle-embed></div> 2280 2281 ### See Also 2282 2283 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_conicTo'>conicTo</a> <a href='#SkPath_rQuadTo'>rQuadTo</a> 2284 2285 <a name='SkPath_quadTo_2'></a> 2286 2287 --- 2288 2289 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2290 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_quadTo'>quadTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2) 2291 </pre> 2292 2293 Adds <a href='SkPath_Reference#Quad'>quad</a> from <a href='#Last_Point'>last point</a> towards <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_quadTo_2_p1'>p1</a>, to <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_quadTo_2_p2'>p2</a>. 2294 If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) 2295 before adding <a href='SkPath_Reference#Quad'>quad</a>. 2296 2297 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed; 2298 then appends <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a> to <a href='#Verb_Array'>verb array</a>; and <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_quadTo_2_p1'>p1</a>, <a href='#SkPath_quadTo_2_p2'>p2</a> 2299 to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2300 2301 ### Parameters 2302 2303 <table> <tr> <td><a name='SkPath_quadTo_2_p1'><code><strong>p1</strong></code></a></td> 2304 <td>control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of added <a href='SkPath_Reference#Quad'>quad</a></td> 2305 </tr> 2306 <tr> <td><a name='SkPath_quadTo_2_p2'><code><strong>p2</strong></code></a></td> 2307 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of added <a href='SkPath_Reference#Quad'>quad</a></td> 2308 </tr> 2309 </table> 2310 2311 ### Return Value 2312 2313 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2314 2315 ### Example 2316 2317 <div><fiddle-embed name="82621c4df8da1e589d9e627494067826"></fiddle-embed></div> 2318 2319 ### See Also 2320 2321 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_conicTo'>conicTo</a> <a href='#SkPath_rQuadTo'>rQuadTo</a> 2322 2323 <a name='SkPath_rQuadTo'></a> 2324 2325 --- 2326 2327 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2328 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rQuadTo'>rQuadTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2) 2329 </pre> 2330 2331 Adds <a href='SkPath_Reference#Quad'>quad</a> from <a href='#Last_Point'>last point</a> towards <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rQuadTo_dx1'>dx1</a>, <a href='#SkPath_rQuadTo_dy1'>dy1</a>), to <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rQuadTo_dx2'>dx2</a>, <a href='#SkPath_rQuadTo_dy2'>dy2</a>). 2332 If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> 2333 is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) before adding <a href='SkPath_Reference#Quad'>quad</a>. 2334 2335 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, 2336 if needed; then appends <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a> to <a href='#Verb_Array'>verb array</a>; and appends <a href='SkPath_Reference#Quad'>quad</a> 2337 control and <a href='SkPath_Reference#Quad'>quad</a> end to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2338 <a href='SkPath_Reference#Quad'>Quad</a> control is <a href='#Last_Point'>last point</a> plus <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rQuadTo_dx1'>dx1</a>, <a href='#SkPath_rQuadTo_dy1'>dy1</a>). 2339 <a href='SkPath_Reference#Quad'>Quad</a> end is <a href='#Last_Point'>last point</a> plus <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rQuadTo_dx2'>dx2</a>, <a href='#SkPath_rQuadTo_dy2'>dy2</a>). 2340 Function name stands for "relative <a href='SkPath_Reference#Quad'>quad</a> to". 2341 2342 ### Parameters 2343 2344 <table> <tr> <td><a name='SkPath_rQuadTo_dx1'><code><strong>dx1</strong></code></a></td> 2345 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Quad'>quad</a> control on x-axis</td> 2346 </tr> 2347 <tr> <td><a name='SkPath_rQuadTo_dy1'><code><strong>dy1</strong></code></a></td> 2348 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Quad'>quad</a> control on y-axis</td> 2349 </tr> 2350 <tr> <td><a name='SkPath_rQuadTo_dx2'><code><strong>dx2</strong></code></a></td> 2351 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Quad'>quad</a> end on x-axis</td> 2352 </tr> 2353 <tr> <td><a name='SkPath_rQuadTo_dy2'><code><strong>dy2</strong></code></a></td> 2354 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Quad'>quad</a> end on y-axis</td> 2355 </tr> 2356 </table> 2357 2358 ### Return Value 2359 2360 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2361 2362 ### Example 2363 2364 <div><fiddle-embed name="1c1f4cdef1c572c9aa8fdf3e461191d0"></fiddle-embed></div> 2365 2366 ### See Also 2367 2368 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_conicTo'>conicTo</a> <a href='#SkPath_quadTo'>quadTo</a> 2369 2370 <a name='Conic'></a> 2371 2372 <a href='SkPath_Reference#Conic'>Conic</a> describes a conical section: a piece of an ellipse, or a piece of a 2373 parabola, or a piece of a hyperbola. <a href='SkPath_Reference#Conic'>Conic</a> begins at a start <a href='SkPoint_Reference#Point'>Point</a>, 2374 <a href='undocumented#Curve'>curves</a> towards a control <a href='SkPoint_Reference#Point'>Point</a>, and then <a href='undocumented#Curve'>curves</a> to an end <a href='SkPoint_Reference#Point'>Point</a>. The influence 2375 of the control <a href='SkPoint_Reference#Point'>Point</a> is determined by <a href='#Path_Conic_Weight'>Conic_Weight</a>. 2376 2377 Each <a href='SkPath_Reference#Conic'>Conic</a> in <a href='SkPath_Reference#Path'>Path</a> adds two <a href='SkPoint_Reference#Point'>Points</a> and one <a href='#Path_Conic_Weight'>Conic_Weight</a>. <a href='#Path_Conic_Weight'>Conic_Weights</a> in <a href='SkPath_Reference#Path'>Path</a> 2378 may be inspected with <a href='#SkPath_Iter'>Iter</a>, or with <a href='#SkPath_RawIter'>RawIter</a>. 2379 2380 <a name='Conic_Weight'></a> 2381 2382 --- 2383 2384 Weight determines both the strength of the control <a href='SkPoint_Reference#Point'>Point</a> and the type of <a href='SkPath_Reference#Conic'>Conic</a>. 2385 Weight varies from zero to infinity. At zero, Weight causes the control <a href='SkPoint_Reference#Point'>Point</a> to 2386 have no effect; <a href='SkPath_Reference#Conic'>Conic</a> is identical to a <a href='undocumented#Line'>line</a> segment from start <a href='SkPoint_Reference#Point'>Point</a> to end 2387 <a href='SkPoint_Reference#Point'>point</a>. If Weight is less than one, <a href='SkPath_Reference#Conic'>Conic</a> follows an elliptical <a href='undocumented#Arc'>arc</a>. 2388 If Weight is exactly one, then <a href='SkPath_Reference#Conic'>Conic</a> is identical to <a href='SkPath_Reference#Quad'>Quad</a>; <a href='SkPath_Reference#Conic'>Conic</a> follows a 2389 parabolic <a href='undocumented#Arc'>arc</a>. If Weight is greater than one, <a href='SkPath_Reference#Conic'>Conic</a> follows a hyperbolic 2390 <a href='undocumented#Arc'>arc</a>. If Weight is infinity, <a href='SkPath_Reference#Conic'>Conic</a> is identical to two <a href='undocumented#Line'>line</a> segments, connecting 2391 start <a href='SkPoint_Reference#Point'>Point</a> to control <a href='SkPoint_Reference#Point'>Point</a>, and control <a href='SkPoint_Reference#Point'>Point</a> to end <a href='SkPoint_Reference#Point'>Point</a>. 2392 2393 ### Example 2394 2395 <div><fiddle-embed name="2aadded3d20dfef34d1c8abe28c7bc8d"><div>When <a href='#Path_Conic_Weight'>Conic_Weight</a> is one, <a href='SkPath_Reference#Quad'>Quad</a> is added to <a href='SkPath_Reference#Path'>path</a>; the two are identical. 2396 </div> 2397 2398 #### Example Output 2399 2400 ~~~~ 2401 move {0, 0}, 2402 quad {0, 0}, {20, 30}, {50, 60}, 2403 done 2404 ~~~~ 2405 2406 </fiddle-embed></div> 2407 2408 If weight is less than one, <a href='SkPath_Reference#Conic'>Conic</a> is an elliptical segment. 2409 2410 ### Example 2411 2412 <div><fiddle-embed name="e88f554efacfa9f75f270fb1c0add5b4"><div>A 90 degree circular <a href='undocumented#Arc'>arc</a> has the weight <code>1 / <a href='undocumented#sqrt()'>sqrt</a>(2)</code>. 2413 </div> 2414 2415 #### Example Output 2416 2417 ~~~~ 2418 move {0, 0}, 2419 conic {0, 0}, {20, 0}, {20, 20}, weight = 0.707107 2420 done 2421 ~~~~ 2422 2423 </fiddle-embed></div> 2424 2425 If weight is greater than one, <a href='SkPath_Reference#Conic'>Conic</a> is a hyperbolic segment. As weight gets large, 2426 a hyperbolic segment can be approximated by straight <a href='undocumented#Line'>lines</a> connecting the 2427 control <a href='SkPoint_Reference#Point'>Point</a> with the end <a href='SkPoint_Reference#Point'>Points</a>. 2428 2429 ### Example 2430 2431 <div><fiddle-embed name="6fb11419e99297fe2fe666c296117fb9"> 2432 2433 #### Example Output 2434 2435 ~~~~ 2436 move {0, 0}, 2437 line {0, 0}, {20, 0}, 2438 line {20, 0}, {20, 20}, 2439 done 2440 ~~~~ 2441 2442 </fiddle-embed></div> 2443 2444 <a name='SkPath_conicTo'></a> 2445 2446 --- 2447 2448 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2449 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_conicTo'>conicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> w) 2450 </pre> 2451 2452 Adds <a href='SkPath_Reference#Conic'>conic</a> from <a href='#Last_Point'>last point</a> towards (<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), to (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>), weighted by <a href='#SkPath_conicTo_w'>w</a>. 2453 If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) 2454 before adding <a href='SkPath_Reference#Conic'>conic</a>. 2455 2456 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed. 2457 2458 If <a href='#SkPath_conicTo_w'>w</a> is finite and not one, appends <a href='#SkPath_kConic_Verb'>kConic_Verb</a> to <a href='#Verb_Array'>verb array</a>; 2459 and (<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>; and <a href='#SkPath_conicTo_w'>w</a> to <a href='SkPath_Reference#Conic_Weight'>conic weights</a>. 2460 2461 If <a href='#SkPath_conicTo_w'>w</a> is one, appends <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a> to <a href='#Verb_Array'>verb array</a>, and 2462 (<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2463 2464 If <a href='#SkPath_conicTo_w'>w</a> is not finite, appends <a href='#SkPath_kLine_Verb'>kLine_Verb</a> twice to <a href='#Verb_Array'>verb array</a>, and 2465 (<a href='#SkPath_conicTo_x1'>x1</a>, <a href='#SkPath_conicTo_y1'>y1</a>), (<a href='#SkPath_conicTo_x2'>x2</a>, <a href='#SkPath_conicTo_y2'>y2</a>) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2466 2467 ### Parameters 2468 2469 <table> <tr> <td><a name='SkPath_conicTo_x1'><code><strong>x1</strong></code></a></td> 2470 <td>control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Conic'>conic</a> on x-axis</td> 2471 </tr> 2472 <tr> <td><a name='SkPath_conicTo_y1'><code><strong>y1</strong></code></a></td> 2473 <td>control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Conic'>conic</a> on y-axis</td> 2474 </tr> 2475 <tr> <td><a name='SkPath_conicTo_x2'><code><strong>x2</strong></code></a></td> 2476 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Conic'>conic</a> on x-axis</td> 2477 </tr> 2478 <tr> <td><a name='SkPath_conicTo_y2'><code><strong>y2</strong></code></a></td> 2479 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Conic'>conic</a> on y-axis</td> 2480 </tr> 2481 <tr> <td><a name='SkPath_conicTo_w'><code><strong>w</strong></code></a></td> 2482 <td>weight of added <a href='SkPath_Reference#Conic'>conic</a></td> 2483 </tr> 2484 </table> 2485 2486 ### Return Value 2487 2488 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2489 2490 ### Example 2491 2492 <div><fiddle-embed name="358d9b6060b528b0923c007420f09c13"><div>As weight increases, <a href='undocumented#Curve'>curve</a> is pulled towards control <a href='SkPoint_Reference#Point'>point</a>. 2493 The bottom two <a href='undocumented#Curve'>curves</a> are elliptical; the next is parabolic; the 2494 top <a href='undocumented#Curve'>curve</a> is hyperbolic. 2495 </div></fiddle-embed></div> 2496 2497 ### See Also 2498 2499 <a href='#SkPath_rConicTo'>rConicTo</a> <a href='#SkPath_arcTo'>arcTo</a> <a href='#SkPath_addArc'>addArc</a> <a href='#SkPath_quadTo'>quadTo</a> 2500 2501 <a name='SkPath_conicTo_2'></a> 2502 2503 --- 2504 2505 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2506 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_conicTo'>conicTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, <a href='undocumented#SkScalar'>SkScalar</a> w) 2507 </pre> 2508 2509 Adds <a href='SkPath_Reference#Conic'>conic</a> from <a href='#Last_Point'>last point</a> towards <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, to <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_conicTo_2_p2'>p2</a>, weighted by <a href='#SkPath_conicTo_2_w'>w</a>. 2510 If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) 2511 before adding <a href='SkPath_Reference#Conic'>conic</a>. 2512 2513 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed. 2514 2515 If <a href='#SkPath_conicTo_2_w'>w</a> is finite and not one, appends <a href='#SkPath_kConic_Verb'>kConic_Verb</a> to <a href='#Verb_Array'>verb array</a>; 2516 and <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, <a href='#SkPath_conicTo_2_p2'>p2</a> to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>; and <a href='#SkPath_conicTo_2_w'>w</a> to <a href='SkPath_Reference#Conic_Weight'>conic weights</a>. 2517 2518 If <a href='#SkPath_conicTo_2_w'>w</a> is one, appends <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a> to <a href='#Verb_Array'>verb array</a>, and <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, <a href='#SkPath_conicTo_2_p2'>p2</a> 2519 to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2520 2521 If <a href='#SkPath_conicTo_2_w'>w</a> is not finite, appends <a href='#SkPath_kLine_Verb'>kLine_Verb</a> twice to <a href='#Verb_Array'>verb array</a>, and 2522 <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_conicTo_2_p1'>p1</a>, <a href='#SkPath_conicTo_2_p2'>p2</a> to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2523 2524 ### Parameters 2525 2526 <table> <tr> <td><a name='SkPath_conicTo_2_p1'><code><strong>p1</strong></code></a></td> 2527 <td>control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of added <a href='SkPath_Reference#Conic'>conic</a></td> 2528 </tr> 2529 <tr> <td><a name='SkPath_conicTo_2_p2'><code><strong>p2</strong></code></a></td> 2530 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of added <a href='SkPath_Reference#Conic'>conic</a></td> 2531 </tr> 2532 <tr> <td><a name='SkPath_conicTo_2_w'><code><strong>w</strong></code></a></td> 2533 <td>weight of added <a href='SkPath_Reference#Conic'>conic</a></td> 2534 </tr> 2535 </table> 2536 2537 ### Return Value 2538 2539 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2540 2541 ### Example 2542 2543 <div><fiddle-embed name="22d25e03b19d5bae92118877e462361b"><div><a href='SkPath_Reference#Conic'>Conics</a> and <a href='undocumented#Arc'>arcs</a> use identical representations. As the <a href='undocumented#Arc'>arc</a> sweep increases 2544 the <a href='#Path_Conic_Weight'>Conic_Weight</a> also increases, but remains smaller than one. 2545 </div></fiddle-embed></div> 2546 2547 ### See Also 2548 2549 <a href='#SkPath_rConicTo'>rConicTo</a> <a href='#SkPath_arcTo'>arcTo</a> <a href='#SkPath_addArc'>addArc</a> <a href='#SkPath_quadTo'>quadTo</a> 2550 2551 <a name='SkPath_rConicTo'></a> 2552 2553 --- 2554 2555 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2556 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rConicTo'>rConicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2, <a href='undocumented#SkScalar'>SkScalar</a> w) 2557 </pre> 2558 2559 Adds <a href='SkPath_Reference#Conic'>conic</a> from <a href='#Last_Point'>last point</a> towards <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rConicTo_dx1'>dx1</a>, <a href='#SkPath_rConicTo_dy1'>dy1</a>), to <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rConicTo_dx2'>dx2</a>, <a href='#SkPath_rConicTo_dy2'>dy2</a>), 2560 weighted by <a href='#SkPath_rConicTo_w'>w</a>. If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> 2561 is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) before adding <a href='SkPath_Reference#Conic'>conic</a>. 2562 2563 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, 2564 if needed. 2565 2566 If <a href='#SkPath_rConicTo_w'>w</a> is finite and not one, next appends <a href='#SkPath_kConic_Verb'>kConic_Verb</a> to <a href='#Verb_Array'>verb array</a>, 2567 and <a href='#SkPath_rConicTo_w'>w</a> is recorded as <a href='#Conic_Weight'>conic weight</a>; otherwise, if <a href='#SkPath_rConicTo_w'>w</a> is one, appends 2568 <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a> to <a href='#Verb_Array'>verb array</a>; or if <a href='#SkPath_rConicTo_w'>w</a> is not finite, appends <a href='#SkPath_kLine_Verb'>kLine_Verb</a> 2569 twice to <a href='#Verb_Array'>verb array</a>. 2570 2571 In all cases appends <a href='SkPoint_Reference#SkPoint'>SkPoint</a> control and end to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2572 control is <a href='#Last_Point'>last point</a> plus <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rConicTo_dx1'>dx1</a>, <a href='#SkPath_rConicTo_dy1'>dy1</a>). 2573 end is <a href='#Last_Point'>last point</a> plus <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rConicTo_dx2'>dx2</a>, <a href='#SkPath_rConicTo_dy2'>dy2</a>). 2574 2575 Function name stands for "relative <a href='SkPath_Reference#Conic'>conic</a> to". 2576 2577 ### Parameters 2578 2579 <table> <tr> <td><a name='SkPath_rConicTo_dx1'><code><strong>dx1</strong></code></a></td> 2580 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Conic'>conic</a> control on x-axis</td> 2581 </tr> 2582 <tr> <td><a name='SkPath_rConicTo_dy1'><code><strong>dy1</strong></code></a></td> 2583 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Conic'>conic</a> control on y-axis</td> 2584 </tr> 2585 <tr> <td><a name='SkPath_rConicTo_dx2'><code><strong>dx2</strong></code></a></td> 2586 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Conic'>conic</a> end on x-axis</td> 2587 </tr> 2588 <tr> <td><a name='SkPath_rConicTo_dy2'><code><strong>dy2</strong></code></a></td> 2589 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Conic'>conic</a> end on y-axis</td> 2590 </tr> 2591 <tr> <td><a name='SkPath_rConicTo_w'><code><strong>w</strong></code></a></td> 2592 <td>weight of added <a href='SkPath_Reference#Conic'>conic</a></td> 2593 </tr> 2594 </table> 2595 2596 ### Return Value 2597 2598 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2599 2600 ### Example 2601 2602 <div><fiddle-embed name="3d52763e7c0e20c0b1d484a0afa622d2"></fiddle-embed></div> 2603 2604 ### See Also 2605 2606 <a href='#SkPath_conicTo'>conicTo</a> <a href='#SkPath_arcTo'>arcTo</a> <a href='#SkPath_addArc'>addArc</a> <a href='#SkPath_quadTo'>quadTo</a> 2607 2608 <a name='Cubic'></a> 2609 2610 --- 2611 2612 <a href='SkPath_Reference#Cubic'>Cubic</a> describes a <a href='#Bezier_Curve'>Bezier_Curve</a> segment described by a third-order polynomial. 2613 <a href='SkPath_Reference#Cubic'>Cubic</a> begins at a start <a href='SkPoint_Reference#Point'>Point</a>, curving towards the first control <a href='SkPoint_Reference#Point'>Point</a>; 2614 and <a href='undocumented#Curve'>curves</a> from the end <a href='SkPoint_Reference#Point'>Point</a> towards the second control <a href='SkPoint_Reference#Point'>Point</a>. 2615 2616 ### Example 2617 2618 <div><fiddle-embed name="466445ed991d86de08587066392d654a"></fiddle-embed></div> 2619 2620 <a name='SkPath_cubicTo'></a> 2621 2622 --- 2623 2624 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2625 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_cubicTo'>cubicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> x3, <a href='undocumented#SkScalar'>SkScalar</a> y3) 2626 </pre> 2627 2628 Adds <a href='SkPath_Reference#Cubic'>cubic</a> from <a href='#Last_Point'>last point</a> towards (<a href='#SkPath_cubicTo_x1'>x1</a>, <a href='#SkPath_cubicTo_y1'>y1</a>), then towards (<a href='#SkPath_cubicTo_x2'>x2</a>, <a href='#SkPath_cubicTo_y2'>y2</a>), ending at 2629 (<a href='#SkPath_cubicTo_x3'>x3</a>, <a href='#SkPath_cubicTo_y3'>y3</a>). If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to 2630 (0, 0) before adding <a href='SkPath_Reference#Cubic'>cubic</a>. 2631 2632 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed; 2633 then appends <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a> to <a href='#Verb_Array'>verb array</a>; and (<a href='#SkPath_cubicTo_x1'>x1</a>, <a href='#SkPath_cubicTo_y1'>y1</a>), (<a href='#SkPath_cubicTo_x2'>x2</a>, <a href='#SkPath_cubicTo_y2'>y2</a>), (<a href='#SkPath_cubicTo_x3'>x3</a>, <a href='#SkPath_cubicTo_y3'>y3</a>) 2634 to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2635 2636 ### Parameters 2637 2638 <table> <tr> <td><a name='SkPath_cubicTo_x1'><code><strong>x1</strong></code></a></td> 2639 <td>first control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a> on x-axis</td> 2640 </tr> 2641 <tr> <td><a name='SkPath_cubicTo_y1'><code><strong>y1</strong></code></a></td> 2642 <td>first control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a> on y-axis</td> 2643 </tr> 2644 <tr> <td><a name='SkPath_cubicTo_x2'><code><strong>x2</strong></code></a></td> 2645 <td>second control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a> on x-axis</td> 2646 </tr> 2647 <tr> <td><a name='SkPath_cubicTo_y2'><code><strong>y2</strong></code></a></td> 2648 <td>second control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a> on y-axis</td> 2649 </tr> 2650 <tr> <td><a name='SkPath_cubicTo_x3'><code><strong>x3</strong></code></a></td> 2651 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a> on x-axis</td> 2652 </tr> 2653 <tr> <td><a name='SkPath_cubicTo_y3'><code><strong>y3</strong></code></a></td> 2654 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a> on y-axis</td> 2655 </tr> 2656 </table> 2657 2658 ### Return Value 2659 2660 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2661 2662 ### Example 2663 2664 <div><fiddle-embed name="3e476378e3e0550ab134bbaf61112d98"></fiddle-embed></div> 2665 2666 ### See Also 2667 2668 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_rCubicTo'>rCubicTo</a> <a href='#SkPath_quadTo'>quadTo</a> 2669 2670 <a name='SkPath_cubicTo_2'></a> 2671 2672 --- 2673 2674 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2675 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_cubicTo'>cubicTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p3) 2676 </pre> 2677 2678 Adds <a href='SkPath_Reference#Cubic'>cubic</a> from <a href='#Last_Point'>last point</a> towards <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_cubicTo_2_p1'>p1</a>, then towards <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_cubicTo_2_p2'>p2</a>, ending at 2679 <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_cubicTo_2_p3'>p3</a>. If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to 2680 (0, 0) before adding <a href='SkPath_Reference#Cubic'>cubic</a>. 2681 2682 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, if needed; 2683 then appends <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a> to <a href='#Verb_Array'>verb array</a>; and <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkPath_cubicTo_2_p1'>p1</a>, <a href='#SkPath_cubicTo_2_p2'>p2</a>, <a href='#SkPath_cubicTo_2_p3'>p3</a> 2684 to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2685 2686 ### Parameters 2687 2688 <table> <tr> <td><a name='SkPath_cubicTo_2_p1'><code><strong>p1</strong></code></a></td> 2689 <td>first control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a></td> 2690 </tr> 2691 <tr> <td><a name='SkPath_cubicTo_2_p2'><code><strong>p2</strong></code></a></td> 2692 <td>second control <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a></td> 2693 </tr> 2694 <tr> <td><a name='SkPath_cubicTo_2_p3'><code><strong>p3</strong></code></a></td> 2695 <td>end <a href='SkPoint_Reference#SkPoint'>SkPoint</a> of <a href='SkPath_Reference#Cubic'>cubic</a></td> 2696 </tr> 2697 </table> 2698 2699 ### Return Value 2700 2701 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2702 2703 ### Example 2704 2705 <div><fiddle-embed name="d38aaf12c6ff5b8d901a2201bcee5476"></fiddle-embed></div> 2706 2707 ### See Also 2708 2709 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_rCubicTo'>rCubicTo</a> <a href='#SkPath_quadTo'>quadTo</a> 2710 2711 <a name='SkPath_rCubicTo'></a> 2712 2713 --- 2714 2715 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2716 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rCubicTo'>rCubicTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx1, <a href='undocumented#SkScalar'>SkScalar</a> dy1, <a href='undocumented#SkScalar'>SkScalar</a> dx2, <a href='undocumented#SkScalar'>SkScalar</a> dy2, <a href='undocumented#SkScalar'>SkScalar</a> dx3, <a href='undocumented#SkScalar'>SkScalar</a> dy3) 2717 </pre> 2718 2719 Adds <a href='SkPath_Reference#Cubic'>cubic</a> from <a href='#Last_Point'>last point</a> towards <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rCubicTo_dx1'>dx1</a>, <a href='#SkPath_rCubicTo_dy1'>dy1</a>), then towards 2720 <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rCubicTo_dx2'>dx2</a>, <a href='#SkPath_rCubicTo_dy2'>dy2</a>), to <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rCubicTo_dx3'>dx3</a>, <a href='#SkPath_rCubicTo_dy3'>dy3</a>). 2721 If <a href='SkPath_Reference#SkPath'>SkPath</a> is empty, or last <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> 2722 is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, <a href='#Last_Point'>last point</a> is set to (0, 0) before adding <a href='SkPath_Reference#Cubic'>cubic</a>. 2723 2724 Appends <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='#Verb_Array'>verb array</a> and (0, 0) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, 2725 if needed; then appends <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a> to <a href='#Verb_Array'>verb array</a>; and appends <a href='SkPath_Reference#Cubic'>cubic</a> 2726 control and <a href='SkPath_Reference#Cubic'>cubic</a> end to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 2727 <a href='SkPath_Reference#Cubic'>Cubic</a> control is <a href='#Last_Point'>last point</a> plus <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rCubicTo_dx1'>dx1</a>, <a href='#SkPath_rCubicTo_dy1'>dy1</a>). 2728 <a href='SkPath_Reference#Cubic'>Cubic</a> end is <a href='#Last_Point'>last point</a> plus <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkPath_rCubicTo_dx2'>dx2</a>, <a href='#SkPath_rCubicTo_dy2'>dy2</a>). 2729 Function name stands for "relative <a href='SkPath_Reference#Cubic'>cubic</a> to". 2730 2731 ### Parameters 2732 2733 <table> <tr> <td><a name='SkPath_rCubicTo_dx1'><code><strong>dx1</strong></code></a></td> 2734 <td>offset from <a href='#Last_Point'>last point</a> to first <a href='SkPath_Reference#Cubic'>cubic</a> control on x-axis</td> 2735 </tr> 2736 <tr> <td><a name='SkPath_rCubicTo_dy1'><code><strong>dy1</strong></code></a></td> 2737 <td>offset from <a href='#Last_Point'>last point</a> to first <a href='SkPath_Reference#Cubic'>cubic</a> control on y-axis</td> 2738 </tr> 2739 <tr> <td><a name='SkPath_rCubicTo_dx2'><code><strong>dx2</strong></code></a></td> 2740 <td>offset from <a href='#Last_Point'>last point</a> to second <a href='SkPath_Reference#Cubic'>cubic</a> control on x-axis</td> 2741 </tr> 2742 <tr> <td><a name='SkPath_rCubicTo_dy2'><code><strong>dy2</strong></code></a></td> 2743 <td>offset from <a href='#Last_Point'>last point</a> to second <a href='SkPath_Reference#Cubic'>cubic</a> control on y-axis</td> 2744 </tr> 2745 <tr> <td><a name='SkPath_rCubicTo_dx3'><code><strong>dx3</strong></code></a></td> 2746 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Cubic'>cubic</a> end on x-axis</td> 2747 </tr> 2748 <tr> <td><a name='SkPath_rCubicTo_dy3'><code><strong>dy3</strong></code></a></td> 2749 <td>offset from <a href='#Last_Point'>last point</a> to <a href='SkPath_Reference#Cubic'>cubic</a> end on y-axis</td> 2750 </tr> 2751 </table> 2752 2753 ### Return Value 2754 2755 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2756 2757 ### Example 2758 2759 <div><fiddle-embed name="19f0cfc7eeba8937fe19446ec0b5f932"></fiddle-embed></div> 2760 2761 ### See Also 2762 2763 <a href='SkPath_Overview#Contour'>Contour</a> <a href='#SkPath_moveTo'>moveTo</a> <a href='#SkPath_cubicTo'>cubicTo</a> <a href='#SkPath_quadTo'>quadTo</a> 2764 2765 <a name='Arc'></a> 2766 2767 --- 2768 2769 <a href='undocumented#Arc'>Arc</a> can be constructed in a number of ways. <a href='undocumented#Arc'>Arc</a> may be described by part of <a href='undocumented#Oval'>Oval</a> and angles, 2770 by start <a href='SkPoint_Reference#Point'>point</a> and end <a href='SkPoint_Reference#Point'>point</a>, and by radius and tangent <a href='undocumented#Line'>lines</a>. Each construction has advantages, 2771 and some constructions correspond to <a href='undocumented#Arc'>Arc</a> drawing in graphics standards. 2772 2773 All <a href='undocumented#Arc'>Arc</a> draws are implemented by one or more <a href='SkPath_Reference#Conic'>Conic</a> draws. When <a href='#Path_Conic_Weight'>Conic_Weight</a> is less than one, 2774 <a href='SkPath_Reference#Conic'>Conic</a> describes an <a href='undocumented#Arc'>Arc</a> of some <a href='undocumented#Oval'>Oval</a> or <a href='undocumented#Circle'>Circle</a>. 2775 2776 Circle<a href='#SkPath_arcTo'>arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a> 2777 describes <a href='undocumented#Arc'>Arc</a> as a piece of <a href='undocumented#Oval'>Oval</a>, beginning at start angle, sweeping clockwise or counterclockwise, 2778 which may continue <a href='SkPath_Overview#Contour'>Contour</a> or start a new one. This construction is similar to <a href='undocumented#PostScript'>PostScript</a> and 2779 <a href='#HTML_Canvas'>HTML_Canvas</a> <a href='undocumented#Arc'>arcs</a>. Variation <a href='#SkPath_addArc'>addArc</a> always starts new <a href='SkPath_Overview#Contour'>Contour</a>. <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawArc'>drawArc</a> draws without 2780 requiring <a href='SkPath_Reference#Path'>Path</a>. 2781 2782 Path<a href='#SkPath_arcTo_2'>arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a> 2783 describes <a href='undocumented#Arc'>Arc</a> as tangent to the <a href='undocumented#Line'>line</a> segment from last <a href='SkPoint_Reference#Point'>Point</a> added to <a href='SkPath_Reference#Path'>Path</a> to (x1, y1); and tangent 2784 to the <a href='undocumented#Line'>line</a> segment from (x1, y1) to (x2, y2). This construction is similar to <a href='undocumented#PostScript'>PostScript</a> and 2785 <a href='#HTML_Canvas'>HTML_Canvas</a> <a href='undocumented#Arc'>arcs</a>. 2786 2787 arcs<a href='#SkPath_arcTo_4'>arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y)</a> 2788 describes <a href='undocumented#Arc'>Arc</a> as part of <a href='undocumented#Oval'>Oval</a> with radii (rx, ry), beginning at 2789 last <a href='SkPoint_Reference#Point'>Point</a> added to <a href='SkPath_Reference#Path'>Path</a> and ending at (x, y). More than one <a href='undocumented#Arc'>Arc</a> satisfies this criteria, 2790 so additional values choose a single solution. This construction is similar to <a href='undocumented#SVG'>SVG</a> <a href='undocumented#Arc'>arcs</a>. 2791 2792 <a href='#SkPath_conicTo'>conicTo</a> describes <a href='undocumented#Arc'>Arc</a> of less than 180 degrees as a pair of tangent <a href='undocumented#Line'>lines</a> and <a href='#Path_Conic_Weight'>Conic_Weight</a>. 2793 <a href='#SkPath_conicTo'>conicTo</a> can represent any <a href='undocumented#Arc'>Arc</a> with a sweep less than 180 degrees at any rotation. All <a href='#SkPath_arcTo'>arcTo</a> 2794 constructions are converted to <a href='SkPath_Reference#Conic'>Conic</a> <a href='undocumented#Data'>data</a> when added to <a href='SkPath_Reference#Path'>Path</a>. 2795 2796  2797 2798 <table> <tr> 2799 <td><sup>1</sup> sup<a href='#SkPath_arcTo'>arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a></td> 2800 </tr> <tr> 2801 <td><sup>2</sup> parameter adds move to first <a href='SkPoint_Reference#Point'>point</a></td> 2802 </tr> <tr> 2803 <td><sup>3</sup> start angle must be multiple of 90 degrees</td> 2804 </tr> <tr> 2805 <td><sup>4</sup> sup<a href='#SkPath_arcTo_2'>arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a></td> 2806 </tr> <tr> 2807 <td><sup>5</sup> sup<a href='#SkPath_arcTo_4'>arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y)</a></td> 2808 </tr> 2809 </table> 2810 2811 ### Example 2812 2813 <div><fiddle-embed name="5acc77eba0cb4d00bbf3a8f4db0c0aee"></fiddle-embed></div> 2814 2815 In the example above: 2816 2817 <table> <tr> 2818 <td>1 describes an <a href='undocumented#Arc'>arc</a> from an <a href='undocumented#Oval'>oval</a>, a starting angle, and a sweep angle.</td> 2819 </tr> <tr> 2820 <td>2 is similar to 1, but does not require building a <a href='SkPath_Reference#Path'>path</a> to draw.</td> 2821 </tr> <tr> 2822 <td>3 is similar to 1, but always begins new <a href='SkPath_Overview#Contour'>Contour</a>.</td> 2823 </tr> <tr> 2824 <td>4 describes an <a href='undocumented#Arc'>arc</a> from a pair of tangent <a href='undocumented#Line'>lines</a> and a radius.</td> 2825 </tr> <tr> 2826 <td>5 describes an <a href='undocumented#Arc'>arc</a> from <a href='undocumented#Oval'>Oval</a> center, <a href='undocumented#Arc'>arc</a> start <a href='SkPoint_Reference#Point'>Point</a> and <a href='undocumented#Arc'>arc</a> end <a href='SkPoint_Reference#Point'>Point</a>.</td> 2827 </tr> <tr> 2828 <td>6 describes an <a href='undocumented#Arc'>arc</a> from a pair of tangent <a href='undocumented#Line'>lines</a> and a <a href='#Path_Conic_Weight'>Conic_Weight</a>.</td> 2829 </tr> 2830 </table> 2831 2832 <a name='SkPath_arcTo'></a> 2833 2834 --- 2835 2836 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2837 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='undocumented#SkScalar'>SkScalar</a> startAngle, <a href='undocumented#SkScalar'>SkScalar</a> sweepAngle, bool forceMoveTo) 2838 </pre> 2839 2840 Appends <a href='undocumented#Arc'>arc</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. <a href='undocumented#Arc'>Arc</a> added is part of ellipse 2841 bounded by <a href='#SkPath_arcTo_oval'>oval</a>, from <a href='#SkPath_arcTo_startAngle'>startAngle</a> through <a href='#SkPath_arcTo_sweepAngle'>sweepAngle</a>. Both <a href='#SkPath_arcTo_startAngle'>startAngle</a> and 2842 <a href='#SkPath_arcTo_sweepAngle'>sweepAngle</a> are measured in degrees, where zero degrees is aligned with the 2843 positive x-axis, and positive sweeps extends <a href='undocumented#Arc'>arc</a> clockwise. 2844 2845 <a href='#SkPath_arcTo'>arcTo</a>() adds <a href='undocumented#Line'>line</a> connecting <a href='SkPath_Reference#SkPath'>SkPath</a> last <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to initial <a href='undocumented#Arc'>arc</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> if <a href='#SkPath_arcTo_forceMoveTo'>forceMoveTo</a> 2846 is false and <a href='SkPath_Reference#SkPath'>SkPath</a> is not empty. Otherwise, added <a href='SkPath_Overview#Contour'>contour</a> begins with first <a href='SkPoint_Reference#Point'>point</a> 2847 of <a href='undocumented#Arc'>arc</a>. Angles greater than -360 and less than 360 are treated modulo 360. 2848 2849 ### Parameters 2850 2851 <table> <tr> <td><a name='SkPath_arcTo_oval'><code><strong>oval</strong></code></a></td> 2852 <td>bounds of ellipse containing <a href='undocumented#Arc'>arc</a></td> 2853 </tr> 2854 <tr> <td><a name='SkPath_arcTo_startAngle'><code><strong>startAngle</strong></code></a></td> 2855 <td>starting angle of <a href='undocumented#Arc'>arc</a> in degrees</td> 2856 </tr> 2857 <tr> <td><a name='SkPath_arcTo_sweepAngle'><code><strong>sweepAngle</strong></code></a></td> 2858 <td>sweep, in degrees. Positive is clockwise; treated modulo 360</td> 2859 </tr> 2860 <tr> <td><a name='SkPath_arcTo_forceMoveTo'><code><strong>forceMoveTo</strong></code></a></td> 2861 <td>true to start a new <a href='SkPath_Overview#Contour'>contour</a> with <a href='undocumented#Arc'>arc</a></td> 2862 </tr> 2863 </table> 2864 2865 ### Return Value 2866 2867 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2868 2869 ### Example 2870 2871 <div><fiddle-embed name="5f02890edaa10cb5e1a4243a82b6a382"><div><a href='#SkPath_arcTo'>arcTo</a> continues a previous <a href='SkPath_Overview#Contour'>contour</a> when <a href='#SkPath_arcTo_forceMoveTo'>forceMoveTo</a> is false and when <a href='SkPath_Reference#Path'>Path</a> 2872 is not empty. 2873 </div></fiddle-embed></div> 2874 2875 ### See Also 2876 2877 <a href='#SkPath_addArc'>addArc</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawArc'>drawArc</a> <a href='#SkPath_conicTo'>conicTo</a> 2878 2879 <a name='SkPath_arcTo_2'></a> 2880 2881 --- 2882 2883 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2884 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> x1, <a href='undocumented#SkScalar'>SkScalar</a> y1, <a href='undocumented#SkScalar'>SkScalar</a> x2, <a href='undocumented#SkScalar'>SkScalar</a> y2, <a href='undocumented#SkScalar'>SkScalar</a> radius) 2885 </pre> 2886 2887 Appends <a href='undocumented#Arc'>arc</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, after appending <a href='undocumented#Line'>line</a> if needed. <a href='undocumented#Arc'>Arc</a> is implemented by <a href='SkPath_Reference#Conic'>conic</a> 2888 weighted to describe part of <a href='undocumented#Circle'>circle</a>. <a href='undocumented#Arc'>Arc</a> is contained by tangent from 2889 last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#Point'>point</a> to (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>), and tangent from (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>) to (<a href='#SkPath_arcTo_2_x2'>x2</a>, <a href='#SkPath_arcTo_2_y2'>y2</a>). <a href='undocumented#Arc'>Arc</a> 2890 is part of <a href='undocumented#Circle'>circle</a> sized to <a href='#SkPath_arcTo_2_radius'>radius</a>, positioned so it touches both tangent <a href='undocumented#Line'>lines</a>. 2891 2892 If last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> does not start <a href='undocumented#Arc'>Arc</a>, <a href='#SkPath_arcTo'>arcTo</a> appends connecting <a href='undocumented#Line'>Line</a> to <a href='SkPath_Reference#Path'>Path</a>. 2893 The length of <a href='SkPoint_Reference#Vector'>Vector</a> from (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>) to (<a href='#SkPath_arcTo_2_x2'>x2</a>, <a href='#SkPath_arcTo_2_y2'>y2</a>) does not affect <a href='undocumented#Arc'>Arc</a>. 2894 2895 <a href='undocumented#Arc'>Arc</a> sweep is always less than 180 degrees. If <a href='#SkPath_arcTo_2_radius'>radius</a> is zero, or if 2896 tangents are nearly parallel, <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>Line</a> from last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to (<a href='#SkPath_arcTo_2_x1'>x1</a>, <a href='#SkPath_arcTo_2_y1'>y1</a>). 2897 2898 <a href='#SkPath_arcTo'>arcTo</a> appends at most one <a href='undocumented#Line'>Line</a> and one <a href='SkPath_Reference#Conic'>conic</a>. 2899 <a href='#SkPath_arcTo'>arcTo</a> implements the functionality of <a href='undocumented#Arct'>PostScript arct</a> and <a href='undocumented#ArcTo'>HTML Canvas arcTo</a>. 2900 2901 ### Parameters 2902 2903 <table> <tr> <td><a name='SkPath_arcTo_2_x1'><code><strong>x1</strong></code></a></td> 2904 <td>x-axis value common to pair of tangents</td> 2905 </tr> 2906 <tr> <td><a name='SkPath_arcTo_2_y1'><code><strong>y1</strong></code></a></td> 2907 <td>y-axis value common to pair of tangents</td> 2908 </tr> 2909 <tr> <td><a name='SkPath_arcTo_2_x2'><code><strong>x2</strong></code></a></td> 2910 <td>x-axis value end of second tangent</td> 2911 </tr> 2912 <tr> <td><a name='SkPath_arcTo_2_y2'><code><strong>y2</strong></code></a></td> 2913 <td>y-axis value end of second tangent</td> 2914 </tr> 2915 <tr> <td><a name='SkPath_arcTo_2_radius'><code><strong>radius</strong></code></a></td> 2916 <td>distance from <a href='undocumented#Arc'>arc</a> to <a href='undocumented#Circle'>circle</a> center</td> 2917 </tr> 2918 </table> 2919 2920 ### Return Value 2921 2922 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2923 2924 ### Example 2925 2926 <div><fiddle-embed name="386000684073fccabc224d7d6dc81cd9"></fiddle-embed></div> 2927 2928 ### Example 2929 2930 <div><fiddle-embed name="78f3c65fa900610bb52518989b547095"></fiddle-embed></div> 2931 2932 ### Example 2933 2934 <div><fiddle-embed name="498360fa0a201cc5db04b1c27256358f"><div><a href='#SkPath_arcTo'>arcTo</a> is represented by <a href='undocumented#Line'>Line</a> and circular <a href='SkPath_Reference#Conic'>Conic</a> in <a href='SkPath_Reference#Path'>Path</a>. 2935 </div> 2936 2937 #### Example Output 2938 2939 ~~~~ 2940 move to (156,20) 2941 line (156,20),(79.2893,20) 2942 conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683 2943 ~~~~ 2944 2945 </fiddle-embed></div> 2946 2947 ### See Also 2948 2949 <a href='#SkPath_conicTo'>conicTo</a> 2950 2951 <a name='SkPath_arcTo_3'></a> 2952 2953 --- 2954 2955 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 2956 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> p2, <a href='undocumented#SkScalar'>SkScalar</a> radius) 2957 </pre> 2958 2959 Appends <a href='undocumented#Arc'>arc</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, after appending <a href='undocumented#Line'>line</a> if needed. <a href='undocumented#Arc'>Arc</a> is implemented by <a href='SkPath_Reference#Conic'>conic</a> 2960 weighted to describe part of <a href='undocumented#Circle'>circle</a>. <a href='undocumented#Arc'>Arc</a> is contained by tangent from 2961 last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#Point'>point</a> to <a href='#SkPath_arcTo_3_p1'>p1</a>, and tangent from <a href='#SkPath_arcTo_3_p1'>p1</a> to <a href='#SkPath_arcTo_3_p2'>p2</a>. <a href='undocumented#Arc'>Arc</a> 2962 is part of <a href='undocumented#Circle'>circle</a> sized to <a href='#SkPath_arcTo_3_radius'>radius</a>, positioned so it touches both tangent <a href='undocumented#Line'>lines</a>. 2963 2964 If last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> does not start <a href='undocumented#Arc'>arc</a>, <a href='#SkPath_arcTo'>arcTo</a>() appends connecting <a href='undocumented#Line'>line</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. 2965 The length of <a href='SkPoint_Reference#Vector'>vector</a> from <a href='#SkPath_arcTo_3_p1'>p1</a> to <a href='#SkPath_arcTo_3_p2'>p2</a> does not affect <a href='undocumented#Arc'>arc</a>. 2966 2967 <a href='undocumented#Arc'>Arc</a> sweep is always less than 180 degrees. If <a href='#SkPath_arcTo_3_radius'>radius</a> is zero, or if 2968 tangents are nearly parallel, <a href='#SkPath_arcTo'>arcTo</a>() appends <a href='undocumented#Line'>line</a> from last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to <a href='#SkPath_arcTo_3_p1'>p1</a>. 2969 2970 <a href='#SkPath_arcTo'>arcTo</a>() appends at most one <a href='undocumented#Line'>line</a> and one <a href='SkPath_Reference#Conic'>conic</a>. 2971 <a href='#SkPath_arcTo'>arcTo</a>() implements the functionality of <a href='undocumented#Arct'>PostScript arct</a> and <a href='undocumented#ArcTo'>HTML Canvas arcTo</a>. 2972 2973 ### Parameters 2974 2975 <table> <tr> <td><a name='SkPath_arcTo_3_p1'><code><strong>p1</strong></code></a></td> 2976 <td><a href='SkPoint_Reference#SkPoint'>SkPoint</a> common to pair of tangents</td> 2977 </tr> 2978 <tr> <td><a name='SkPath_arcTo_3_p2'><code><strong>p2</strong></code></a></td> 2979 <td>end of second tangent</td> 2980 </tr> 2981 <tr> <td><a name='SkPath_arcTo_3_radius'><code><strong>radius</strong></code></a></td> 2982 <td>distance from <a href='undocumented#Arc'>arc</a> to <a href='undocumented#Circle'>circle</a> center</td> 2983 </tr> 2984 </table> 2985 2986 ### Return Value 2987 2988 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 2989 2990 ### Example 2991 2992 <div><fiddle-embed name="0c056264a361579c18e5d02d3172d4d4"><div>Because tangent <a href='undocumented#Line'>lines</a> are parallel, <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>line</a> from last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to 2993 <a href='#SkPath_arcTo_3_p1'>p1</a>, but does not append a circular <a href='SkPath_Reference#Conic'>Conic</a>. 2994 </div> 2995 2996 #### Example Output 2997 2998 ~~~~ 2999 move to (156,20) 3000 line (156,20),(200,20) 3001 ~~~~ 3002 3003 </fiddle-embed></div> 3004 3005 ### See Also 3006 3007 <a href='#SkPath_conicTo'>conicTo</a> 3008 3009 <a name='SkPath_ArcSize'></a> 3010 3011 --- 3012 3013 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3014 enum <a href='#SkPath_ArcSize'>ArcSize</a> { 3015 <a href='#SkPath_kSmall_ArcSize'>kSmall_ArcSize</a>, 3016 <a href='#SkPath_kLarge_ArcSize'>kLarge_ArcSize</a>, 3017 }; 3018 </pre> 3019 3020 Four axis-aligned <a href='undocumented#Oval'>Ovals</a> with the same height and width intersect a pair of <a href='SkPoint_Reference#Point'>Points</a>. 3021 <a href='#SkPath_ArcSize'>ArcSize</a> and <a href='#SkPath_Direction'>Direction</a> select one of the four <a href='undocumented#Oval'>Ovals</a>, by choosing the larger or smaller 3022 <a href='undocumented#Arc'>arc</a> between the <a href='SkPoint_Reference#Point'>Points</a>; and by choosing the <a href='undocumented#Arc'>arc</a> <a href='#SkPath_Direction'>Direction</a>, clockwise 3023 or counterclockwise. 3024 3025 ### Constants 3026 3027 <table style='border-collapse: collapse; width: 62.5em'> 3028 <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> 3029 <th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> 3030 <th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> 3031 <tr style='background-color: #f0f0f0; '> 3032 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kSmall_ArcSize'><code>SkPath::kSmall_ArcSize</code></a></td> 3033 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> 3034 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 3035 smaller of Arc pair</td> 3036 </tr> 3037 <tr> 3038 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kLarge_ArcSize'><code>SkPath::kLarge_ArcSize</code></a></td> 3039 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> 3040 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 3041 larger of Arc pair</td> 3042 </tr> 3043 </table> 3044 3045 ### Example 3046 3047 <div><fiddle-embed name="8e40c546eecd9cc213200717240898ba"><div><a href='undocumented#Arc'>Arc</a> begins at top of <a href='undocumented#Oval'>Oval</a> pair and ends at bottom. <a href='undocumented#Arc'>Arc</a> can take four routes to get there. 3048 Two routes are large, and two routes are counterclockwise. The one route both large 3049 and counterclockwise is blue. 3050 </div></fiddle-embed></div> 3051 3052 ### See Also 3053 3054 <a href='#SkPath_arcTo'>arcTo</a> <a href='#SkPath_Direction'>Direction</a> 3055 3056 <a name='SkPath_arcTo_4'></a> 3057 3058 --- 3059 3060 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3061 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, <a href='#SkPath_Direction'>Direction</a> sweep, 3062 <a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) 3063 </pre> 3064 3065 Appends <a href='undocumented#Arc'>arc</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. <a href='undocumented#Arc'>Arc</a> is implemented by one or more <a href='SkPath_Reference#Conic'>conics</a> weighted to 3066 describe part of <a href='undocumented#Oval'>oval</a> with radii (<a href='#SkPath_arcTo_4_rx'>rx</a>, <a href='#SkPath_arcTo_4_ry'>ry</a>) rotated by <a href='#SkPath_arcTo_4_xAxisRotate'>xAxisRotate</a> degrees. <a href='undocumented#Arc'>Arc</a> 3067 <a href='undocumented#Curve'>curves</a> from last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>), choosing one of four possible routes: 3068 clockwise or counterclockwise, and smaller or larger. 3069 3070 <a href='undocumented#Arc'>Arc</a> <a href='#SkPath_arcTo_4_sweep'>sweep</a> is always less than 360 degrees. <a href='#SkPath_arcTo'>arcTo</a>() appends <a href='undocumented#Line'>line</a> to (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>) if 3071 either radii are zero, or if last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> equals (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>). <a href='#SkPath_arcTo'>arcTo</a>() scales radii 3072 (<a href='#SkPath_arcTo_4_rx'>rx</a>, <a href='#SkPath_arcTo_4_ry'>ry</a>) to fit last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> and (<a href='#SkPath_arcTo_4_x'>x</a>, <a href='#SkPath_arcTo_4_y'>y</a>) if both are greater than zero but 3073 too small. 3074 3075 <a href='#SkPath_arcTo'>arcTo</a>() appends up to four <a href='SkPath_Reference#Conic'>conic</a> <a href='undocumented#Curve'>curves</a>. 3076 <a href='#SkPath_arcTo'>arcTo</a>() implements the functionality of <a href='undocumented#SVG_Arc'>SVG arc</a>, although <a href='undocumented#Sweep_Flag'>SVG sweep-flag</a> value 3077 is opposite the integer value of <a href='#SkPath_arcTo_4_sweep'>sweep</a>; <a href='undocumented#Sweep_Flag'>SVG sweep-flag</a> uses 1 for clockwise, 3078 while <a href='#SkPath_kCW_Direction'>kCW_Direction</a> cast to int is zero. 3079 3080 ### Parameters 3081 3082 <table> <tr> <td><a name='SkPath_arcTo_4_rx'><code><strong>rx</strong></code></a></td> 3083 <td>radius on x-axis before x-axis rotation</td> 3084 </tr> 3085 <tr> <td><a name='SkPath_arcTo_4_ry'><code><strong>ry</strong></code></a></td> 3086 <td>radius on y-axis before x-axis rotation</td> 3087 </tr> 3088 <tr> <td><a name='SkPath_arcTo_4_xAxisRotate'><code><strong>xAxisRotate</strong></code></a></td> 3089 <td>x-axis rotation in degrees; positive values are clockwise</td> 3090 </tr> 3091 <tr> <td><a name='SkPath_arcTo_4_largeArc'><code><strong>largeArc</strong></code></a></td> 3092 <td>chooses smaller or larger <a href='undocumented#Arc'>arc</a></td> 3093 </tr> 3094 <tr> <td><a name='SkPath_arcTo_4_sweep'><code><strong>sweep</strong></code></a></td> 3095 <td>chooses clockwise or counterclockwise <a href='undocumented#Arc'>arc</a></td> 3096 </tr> 3097 <tr> <td><a name='SkPath_arcTo_4_x'><code><strong>x</strong></code></a></td> 3098 <td>end of <a href='undocumented#Arc'>arc</a></td> 3099 </tr> 3100 <tr> <td><a name='SkPath_arcTo_4_y'><code><strong>y</strong></code></a></td> 3101 <td>end of <a href='undocumented#Arc'>arc</a></td> 3102 </tr> 3103 </table> 3104 3105 ### Return Value 3106 3107 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3108 3109 ### Example 3110 3111 <div><fiddle-embed name="6b6ea44f659b27918f3a6fa621bf6173"></fiddle-embed></div> 3112 3113 ### See Also 3114 3115 <a href='#SkPath_rArcTo'>rArcTo</a> <a href='#SkPath_ArcSize'>ArcSize</a> <a href='#SkPath_Direction'>Direction</a> 3116 3117 <a name='SkPath_arcTo_5'></a> 3118 3119 --- 3120 3121 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3122 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_arcTo'>arcTo</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> r, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, <a href='#SkPath_Direction'>Direction</a> sweep, 3123 const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> xy) 3124 </pre> 3125 3126 Appends <a href='undocumented#Arc'>arc</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. <a href='undocumented#Arc'>Arc</a> is implemented by one or more <a href='SkPath_Reference#Conic'>conic</a> weighted to describe 3127 part of <a href='undocumented#Oval'>oval</a> with radii (<a href='#SkPath_arcTo_5_r'>r</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkPath_arcTo_5_r'>r</a>.<a href='#SkPoint_fY'>fY</a>) rotated by <a href='#SkPath_arcTo_5_xAxisRotate'>xAxisRotate</a> degrees. <a href='undocumented#Arc'>Arc</a> <a href='undocumented#Curve'>curves</a> 3128 from last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to (<a href='#SkPath_arcTo_5_xy'>xy</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkPath_arcTo_5_xy'>xy</a>.<a href='#SkPoint_fY'>fY</a>), choosing one of four possible routes: 3129 clockwise or counterclockwise, 3130 and smaller or larger. 3131 3132 <a href='undocumented#Arc'>Arc</a> <a href='#SkPath_arcTo_5_sweep'>sweep</a> is always less than 360 degrees. <a href='#SkPath_arcTo'>arcTo</a>() appends <a href='undocumented#Line'>line</a> to <a href='#SkPath_arcTo_5_xy'>xy</a> if either 3133 radii are zero, or if last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> equals (<a href='#SkPath_arcTo_5_xy'>xy</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkPath_arcTo_5_xy'>xy</a>.<a href='#SkPoint_fY'>fY</a>). <a href='#SkPath_arcTo'>arcTo</a>() scales radii <a href='#SkPath_arcTo_5_r'>r</a> to 3134 fit last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> and <a href='#SkPath_arcTo_5_xy'>xy</a> if both are greater than zero but too small to describe 3135 an <a href='undocumented#Arc'>arc</a>. 3136 3137 <a href='#SkPath_arcTo'>arcTo</a>() appends up to four <a href='SkPath_Reference#Conic'>conic</a> <a href='undocumented#Curve'>curves</a>. 3138 <a href='#SkPath_arcTo'>arcTo</a>() implements the functionality of <a href='undocumented#SVG_Arc'>SVG arc</a>, although <a href='undocumented#Sweep_Flag'>SVG sweep-flag</a> value is 3139 opposite the integer value of <a href='#SkPath_arcTo_5_sweep'>sweep</a>; <a href='undocumented#Sweep_Flag'>SVG sweep-flag</a> uses 1 for clockwise, while 3140 <a href='#SkPath_kCW_Direction'>kCW_Direction</a> cast to int is zero. 3141 3142 ### Parameters 3143 3144 <table> <tr> <td><a name='SkPath_arcTo_5_r'><code><strong>r</strong></code></a></td> 3145 <td>radii on axes before x-axis rotation</td> 3146 </tr> 3147 <tr> <td><a name='SkPath_arcTo_5_xAxisRotate'><code><strong>xAxisRotate</strong></code></a></td> 3148 <td>x-axis rotation in degrees; positive values are clockwise</td> 3149 </tr> 3150 <tr> <td><a name='SkPath_arcTo_5_largeArc'><code><strong>largeArc</strong></code></a></td> 3151 <td>chooses smaller or larger <a href='undocumented#Arc'>arc</a></td> 3152 </tr> 3153 <tr> <td><a name='SkPath_arcTo_5_sweep'><code><strong>sweep</strong></code></a></td> 3154 <td>chooses clockwise or counterclockwise <a href='undocumented#Arc'>arc</a></td> 3155 </tr> 3156 <tr> <td><a name='SkPath_arcTo_5_xy'><code><strong>xy</strong></code></a></td> 3157 <td>end of <a href='undocumented#Arc'>arc</a></td> 3158 </tr> 3159 </table> 3160 3161 ### Return Value 3162 3163 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3164 3165 ### Example 3166 3167 <div><fiddle-embed name="3f76a1007416181a4848c1a87fc81dbd"></fiddle-embed></div> 3168 3169 ### See Also 3170 3171 <a href='#SkPath_rArcTo'>rArcTo</a> <a href='#SkPath_ArcSize'>ArcSize</a> <a href='#SkPath_Direction'>Direction</a> 3172 3173 <a name='SkPath_rArcTo'></a> 3174 3175 --- 3176 3177 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3178 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_rArcTo'>rArcTo</a>(<a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='undocumented#SkScalar'>SkScalar</a> xAxisRotate, <a href='#SkPath_ArcSize'>ArcSize</a> largeArc, <a href='#SkPath_Direction'>Direction</a> sweep, 3179 <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) 3180 </pre> 3181 3182 Appends <a href='undocumented#Arc'>Arc</a> to <a href='SkPath_Reference#Path'>Path</a>, relative to last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a>. <a href='undocumented#Arc'>Arc</a> is implemented by one or 3183 more <a href='SkPath_Reference#Conic'>Conic</a>, weighted to describe part of <a href='undocumented#Oval'>Oval</a> with radii (<a href='#SkPath_rArcTo_rx'>rx</a>, <a href='#SkPath_rArcTo_ry'>ry</a>) rotated by 3184 <a href='#SkPath_rArcTo_xAxisRotate'>xAxisRotate</a> degrees. <a href='undocumented#Arc'>Arc</a> <a href='undocumented#Curve'>curves</a> from last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> to relative end <a href='SkPoint_Reference#Point'>Point</a> 3185 (<a href='#SkPath_rArcTo_dx'>dx</a>, <a href='#SkPath_rArcTo_dy'>dy</a>), choosing one of four possible routes: clockwise or 3186 counterclockwise, and smaller or larger. If <a href='SkPath_Reference#Path'>Path</a> is empty, the start <a href='undocumented#Arc'>Arc</a> <a href='SkPoint_Reference#Point'>Point</a> 3187 is (0, 0). 3188 3189 <a href='undocumented#Arc'>Arc</a> <a href='#SkPath_rArcTo_sweep'>sweep</a> is always less than 360 degrees. <a href='#SkPath_arcTo'>arcTo</a> appends <a href='undocumented#Line'>Line</a> to end <a href='SkPoint_Reference#Point'>Point</a> 3190 if either radii are zero, or if last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> equals end <a href='SkPoint_Reference#Point'>Point</a>. 3191 <a href='#SkPath_arcTo'>arcTo</a> scales radii (<a href='#SkPath_rArcTo_rx'>rx</a>, <a href='#SkPath_rArcTo_ry'>ry</a>) to fit last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a> and end <a href='SkPoint_Reference#Point'>Point</a> if both are 3192 greater than zero but too small to describe an <a href='undocumented#Arc'>arc</a>. 3193 3194 <a href='#SkPath_arcTo'>arcTo</a> appends up to four <a href='SkPath_Reference#Conic'>Conic</a> <a href='undocumented#Curve'>curves</a>. 3195 <a href='#SkPath_arcTo'>arcTo</a> implements the functionality of <a href='#SVG_Arc'>SVG_Arc</a>, although <a href='undocumented#SVG'>SVG</a> "sweep-flag" value is 3196 opposite the integer value of <a href='#SkPath_rArcTo_sweep'>sweep</a>; <a href='undocumented#SVG'>SVG</a> "sweep-flag" uses 1 for clockwise, while 3197 <a href='#SkPath_kCW_Direction'>kCW_Direction</a> cast to int is zero. 3198 3199 ### Parameters 3200 3201 <table> <tr> <td><a name='SkPath_rArcTo_rx'><code><strong>rx</strong></code></a></td> 3202 <td>radius before x-axis rotation</td> 3203 </tr> 3204 <tr> <td><a name='SkPath_rArcTo_ry'><code><strong>ry</strong></code></a></td> 3205 <td>radius before x-axis rotation</td> 3206 </tr> 3207 <tr> <td><a name='SkPath_rArcTo_xAxisRotate'><code><strong>xAxisRotate</strong></code></a></td> 3208 <td>x-axis rotation in degrees; positive values are clockwise</td> 3209 </tr> 3210 <tr> <td><a name='SkPath_rArcTo_largeArc'><code><strong>largeArc</strong></code></a></td> 3211 <td>chooses smaller or larger <a href='undocumented#Arc'>Arc</a></td> 3212 </tr> 3213 <tr> <td><a name='SkPath_rArcTo_sweep'><code><strong>sweep</strong></code></a></td> 3214 <td>chooses clockwise or counterclockwise <a href='undocumented#Arc'>Arc</a></td> 3215 </tr> 3216 <tr> <td><a name='SkPath_rArcTo_dx'><code><strong>dx</strong></code></a></td> 3217 <td>x-axis offset end of <a href='undocumented#Arc'>Arc</a> from last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a></td> 3218 </tr> 3219 <tr> <td><a name='SkPath_rArcTo_dy'><code><strong>dy</strong></code></a></td> 3220 <td>y-axis offset end of <a href='undocumented#Arc'>Arc</a> from last <a href='SkPath_Reference#Path'>Path</a> <a href='SkPoint_Reference#Point'>Point</a></td> 3221 </tr> 3222 </table> 3223 3224 ### Return Value 3225 3226 reference to <a href='SkPath_Reference#Path'>Path</a> 3227 3228 ### Example 3229 3230 <div><fiddle-embed name="3f76a1007416181a4848c1a87fc81dbd"></fiddle-embed></div> 3231 3232 ### See Also 3233 3234 <a href='#SkPath_arcTo'>arcTo</a> <a href='#SkPath_ArcSize'>ArcSize</a> <a href='#SkPath_Direction'>Direction</a> 3235 3236 <a name='SkPath_close'></a> 3237 3238 --- 3239 3240 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3241 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_close'>close()</a> 3242 </pre> 3243 3244 Appends <a href='#SkPath_kClose_Verb'>kClose_Verb</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. A closed <a href='SkPath_Overview#Contour'>contour</a> connects the first and last <a href='SkPoint_Reference#SkPoint'>SkPoint</a> 3245 with <a href='undocumented#Line'>line</a>, forming a continuous loop. Open and closed <a href='SkPath_Overview#Contour'>contour</a> draw the same 3246 with <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_kFill_Style'>kFill_Style</a>. With <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_kStroke_Style'>kStroke_Style</a>, open <a href='SkPath_Overview#Contour'>contour</a> draws 3247 <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_Cap'>Cap</a> at <a href='SkPath_Overview#Contour'>contour</a> start and end; closed <a href='SkPath_Overview#Contour'>contour</a> draws 3248 <a href='SkPaint_Reference#SkPaint'>SkPaint</a>::<a href='#SkPaint_Join'>Join</a> at <a href='SkPath_Overview#Contour'>contour</a> start and end. 3249 3250 <a href='#SkPath_close'>close()</a> has no effect if <a href='SkPath_Reference#SkPath'>SkPath</a> is empty or last <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> is <a href='#SkPath_kClose_Verb'>kClose_Verb</a>. 3251 3252 ### Return Value 3253 3254 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3255 3256 ### Example 3257 3258 <div><fiddle-embed name="9235f6309271d6420fa5c45dc28664c5"></fiddle-embed></div> 3259 3260 ### See Also 3261 3262 <a name='SkPath_IsInverseFillType'></a> 3263 3264 --- 3265 3266 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3267 static bool <a href='#SkPath_IsInverseFillType'>IsInverseFillType</a>(<a href='#SkPath_FillType'>FillType</a> fill) 3268 </pre> 3269 3270 Returns true if <a href='#SkPath_IsInverseFillType_fill'>fill</a> is inverted and <a href='SkPath_Reference#Path'>Path</a> with <a href='#SkPath_IsInverseFillType_fill'>fill</a> represents area outside 3271 of its geometric bounds. 3272 3273 | <a href='#SkPath_FillType'>FillType</a> | is inverse | 3274 | --- | --- | 3275 | <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> | false | 3276 | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> | false | 3277 | <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a> | true | 3278 | <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> | true | 3279 3280 ### Parameters 3281 3282 <table> <tr> <td><a name='SkPath_IsInverseFillType_fill'><code><strong>fill</strong></code></a></td> 3283 <td>one of: <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a>, 3284 <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a>, <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> 3285 </td> 3286 </tr> 3287 </table> 3288 3289 ### Return Value 3290 3291 true if <a href='SkPath_Reference#Path'>Path</a> fills outside its bounds 3292 3293 ### Example 3294 3295 <div><fiddle-embed name="1453856a9d0c73e8192bf298c4143563"> 3296 3297 #### Example Output 3298 3299 ~~~~ 3300 IsInverseFillType(kWinding_FillType) == false 3301 IsInverseFillType(kEvenOdd_FillType) == false 3302 IsInverseFillType(kInverseWinding_FillType) == true 3303 IsInverseFillType(kInverseEvenOdd_FillType) == true 3304 ~~~~ 3305 3306 </fiddle-embed></div> 3307 3308 ### See Also 3309 3310 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_ConvertToNonInverseFillType'>ConvertToNonInverseFillType</a> 3311 3312 <a name='SkPath_ConvertToNonInverseFillType'></a> 3313 3314 --- 3315 3316 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3317 static <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_ConvertToNonInverseFillType'>ConvertToNonInverseFillType</a>(<a href='#SkPath_FillType'>FillType</a> fill) 3318 </pre> 3319 3320 Returns equivalent <a href='#Path_Fill_Type'>Fill_Type</a> representing <a href='SkPath_Reference#Path'>Path</a> <a href='#SkPath_ConvertToNonInverseFillType_fill'>fill</a> inside its bounds. 3321 3322 | <a href='#SkPath_FillType'>FillType</a> | inside <a href='#SkPath_FillType'>FillType</a> | 3323 | --- | --- | 3324 | <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> | <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> | 3325 | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> | 3326 | <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a> | <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> | 3327 | <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> | 3328 3329 ### Parameters 3330 3331 <table> <tr> <td><a name='SkPath_ConvertToNonInverseFillType_fill'><code><strong>fill</strong></code></a></td> 3332 <td>one of: <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a>, <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a>, 3333 <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a>, <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> 3334 </td> 3335 </tr> 3336 </table> 3337 3338 ### Return Value 3339 3340 <a href='#SkPath_ConvertToNonInverseFillType_fill'>fill</a>, or <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> or <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> if <a href='#SkPath_ConvertToNonInverseFillType_fill'>fill</a> is inverted 3341 3342 ### Example 3343 3344 <div><fiddle-embed name="319f6b124458dcc0f9ce4d7bbde65810"> 3345 3346 #### Example Output 3347 3348 ~~~~ 3349 ConvertToNonInverseFillType(kWinding_FillType) == kWinding_FillType 3350 ConvertToNonInverseFillType(kEvenOdd_FillType) == kEvenOdd_FillType 3351 ConvertToNonInverseFillType(kInverseWinding_FillType) == kWinding_FillType 3352 ConvertToNonInverseFillType(kInverseEvenOdd_FillType) == kEvenOdd_FillType 3353 ~~~~ 3354 3355 </fiddle-embed></div> 3356 3357 ### See Also 3358 3359 <a href='#SkPath_FillType'>FillType</a> <a href='#SkPath_getFillType'>getFillType</a> <a href='#SkPath_setFillType'>setFillType</a> <a href='#SkPath_IsInverseFillType'>IsInverseFillType</a> 3360 3361 <a name='SkPath_ConvertConicToQuads'></a> 3362 3363 --- 3364 3365 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3366 static int <a href='#SkPath_ConvertConicToQuads'>ConvertConicToQuads</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p0, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p1, const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p2, <a href='undocumented#SkScalar'>SkScalar</a> w, 3367 <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int pow2) 3368 </pre> 3369 3370 Approximates <a href='SkPath_Reference#Conic'>Conic</a> with <a href='SkPath_Reference#Quad'>Quad</a> array. <a href='SkPath_Reference#Conic'>Conic</a> is constructed from start <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_ConvertConicToQuads_p0'>p0</a>, 3371 control <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_ConvertConicToQuads_p1'>p1</a>, end <a href='SkPoint_Reference#Point'>Point</a> <a href='#SkPath_ConvertConicToQuads_p2'>p2</a>, and weight <a href='#SkPath_ConvertConicToQuads_w'>w</a>. 3372 <a href='SkPath_Reference#Quad'>Quad</a> array is stored in <a href='#SkPath_ConvertConicToQuads_pts'>pts</a>; this storage is supplied by caller. 3373 Maximum <a href='SkPath_Reference#Quad'>Quad</a> count is 2 to the <a href='#SkPath_ConvertConicToQuads_pow2'>pow2</a>. 3374 Every third <a href='SkPoint_Reference#Point'>point</a> in array shares last <a href='SkPoint_Reference#Point'>Point</a> of previous <a href='SkPath_Reference#Quad'>Quad</a> and first <a href='SkPoint_Reference#Point'>Point</a> of 3375 next <a href='SkPath_Reference#Quad'>Quad</a>. Maximum <a href='#SkPath_ConvertConicToQuads_pts'>pts</a> storage <a href='undocumented#Size'>size</a> is given by: 3376 <code>(1 + 2 * (1 << <a href='#SkPath_ConvertConicToQuads_pow2'>pow2</a>)) * <a href='undocumented#sizeof()'>sizeof</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a>)</code>. 3377 3378 Returns <a href='SkPath_Reference#Quad'>Quad</a> count used the approximation, which may be smaller 3379 than the number requested. 3380 3381 <a href='#Path_Conic_Weight'>Conic_Weight</a> determines the amount of influence <a href='SkPath_Reference#Conic'>Conic</a> control <a href='SkPoint_Reference#Point'>point</a> has on the <a href='undocumented#Curve'>curve</a>. 3382 <a href='#SkPath_ConvertConicToQuads_w'>w</a> less than one represents an elliptical section. <a href='#SkPath_ConvertConicToQuads_w'>w</a> greater than one represents 3383 a hyperbolic section. <a href='#SkPath_ConvertConicToQuads_w'>w</a> equal to one represents a parabolic section. 3384 3385 Two <a href='SkPath_Reference#Quad'>Quad</a> <a href='undocumented#Curve'>curves</a> are sufficient to approximate an elliptical <a href='SkPath_Reference#Conic'>Conic</a> with a sweep 3386 of up to 90 degrees; in this case, set <a href='#SkPath_ConvertConicToQuads_pow2'>pow2</a> to one. 3387 3388 ### Parameters 3389 3390 <table> <tr> <td><a name='SkPath_ConvertConicToQuads_p0'><code><strong>p0</strong></code></a></td> 3391 <td><a href='SkPath_Reference#Conic'>Conic</a> start <a href='SkPoint_Reference#Point'>Point</a></td> 3392 </tr> 3393 <tr> <td><a name='SkPath_ConvertConicToQuads_p1'><code><strong>p1</strong></code></a></td> 3394 <td><a href='SkPath_Reference#Conic'>Conic</a> control <a href='SkPoint_Reference#Point'>Point</a></td> 3395 </tr> 3396 <tr> <td><a name='SkPath_ConvertConicToQuads_p2'><code><strong>p2</strong></code></a></td> 3397 <td><a href='SkPath_Reference#Conic'>Conic</a> end <a href='SkPoint_Reference#Point'>Point</a></td> 3398 </tr> 3399 <tr> <td><a name='SkPath_ConvertConicToQuads_w'><code><strong>w</strong></code></a></td> 3400 <td><a href='SkPath_Reference#Conic'>Conic</a> weight</td> 3401 </tr> 3402 <tr> <td><a name='SkPath_ConvertConicToQuads_pts'><code><strong>pts</strong></code></a></td> 3403 <td>storage for <a href='SkPath_Reference#Quad'>Quad</a> array</td> 3404 </tr> 3405 <tr> <td><a name='SkPath_ConvertConicToQuads_pow2'><code><strong>pow2</strong></code></a></td> 3406 <td><a href='SkPath_Reference#Quad'>Quad</a> count, as power of two, normally 0 to 5 (1 to 32 <a href='SkPath_Reference#Quad'>Quad</a> <a href='undocumented#Curve'>curves</a>)</td> 3407 </tr> 3408 </table> 3409 3410 ### Return Value 3411 3412 number of <a href='SkPath_Reference#Quad'>Quad</a> <a href='undocumented#Curve'>curves</a> written to <a href='#SkPath_ConvertConicToQuads_pts'>pts</a> 3413 3414 ### Example 3415 3416 <div><fiddle-embed name="3ba94448a4ba48f926e643baeb5b1016"><div>A pair of <a href='SkPath_Reference#Quad'>Quad</a> <a href='undocumented#Curve'>curves</a> are drawn in red on top of the elliptical <a href='SkPath_Reference#Conic'>Conic</a> <a href='undocumented#Curve'>curve</a> in black. 3417 The middle <a href='undocumented#Curve'>curve</a> is nearly circular. The top-right <a href='undocumented#Curve'>curve</a> is parabolic, which can 3418 be drawn exactly with a single <a href='SkPath_Reference#Quad'>Quad</a>. 3419 </div></fiddle-embed></div> 3420 3421 ### See Also 3422 3423 <a href='SkPath_Reference#Conic'>Conic</a> <a href='SkPath_Reference#Quad'>Quad</a> 3424 3425 <a name='SkPath_isRect'></a> 3426 3427 --- 3428 3429 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3430 bool <a href='#SkPath_isRect'>isRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* <a href='SkRect_Reference#Rect'>rect</a>, bool* isClosed = nullptr, <a href='#SkPath_Direction'>Direction</a>* direction = nullptr)const 3431 </pre> 3432 3433 Returns true if <a href='SkPath_Reference#SkPath'>SkPath</a> is equivalent to <a href='SkRect_Reference#SkRect'>SkRect</a> when filled. 3434 If false: <a href='#SkPath_isRect_rect'>rect</a>, <a href='#SkPath_isRect_isClosed'>isClosed</a>, and <a href='#SkPath_isRect_direction'>direction</a> are unchanged. 3435 If true: <a href='#SkPath_isRect_rect'>rect</a>, <a href='#SkPath_isRect_isClosed'>isClosed</a>, and <a href='#SkPath_isRect_direction'>direction</a> are written to if not nullptr. 3436 3437 <a href='#SkPath_isRect_rect'>rect</a> may be smaller than the <a href='SkPath_Reference#SkPath'>SkPath</a> bounds. <a href='SkPath_Reference#SkPath'>SkPath</a> bounds may include <a href='#SkPath_kMove_Verb'>kMove_Verb</a> <a href='SkPoint_Reference#Point'>points</a> 3438 that do not alter the area drawn by the returned <a href='#SkPath_isRect_rect'>rect</a>. 3439 3440 ### Parameters 3441 3442 <table> <tr> <td><a name='SkPath_isRect_rect'><code><strong>rect</strong></code></a></td> 3443 <td>storage for bounds of <a href='SkRect_Reference#SkRect'>SkRect</a>; may be nullptr</td> 3444 </tr> 3445 <tr> <td><a name='SkPath_isRect_isClosed'><code><strong>isClosed</strong></code></a></td> 3446 <td>storage set to true if <a href='SkPath_Reference#SkPath'>SkPath</a> is closed; may be nullptr</td> 3447 </tr> 3448 <tr> <td><a name='SkPath_isRect_direction'><code><strong>direction</strong></code></a></td> 3449 <td>storage set to <a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPath_isRect_direction'>direction</a>; may be nullptr</td> 3450 </tr> 3451 </table> 3452 3453 ### Return Value 3454 3455 true if <a href='SkPath_Reference#SkPath'>SkPath</a> contains <a href='SkRect_Reference#SkRect'>SkRect</a> 3456 3457 ### Example 3458 3459 <div><fiddle-embed name="81a2aac1b8f0ff3d4c8d35ccb9149b16"><div>After <a href='#SkPath_addRect'>addRect</a>, <a href='#SkPath_isRect'>isRect</a> returns true. Following <a href='#SkPath_moveTo'>moveTo</a> permits <a href='#SkPath_isRect'>isRect</a> to return true, but 3460 following <a href='#SkPath_lineTo'>lineTo</a> does not. <a href='#SkPath_addPoly'>addPoly</a> returns true even though <a href='#SkPath_isRect_rect'>rect</a> is not closed, and one 3461 side of <a href='#SkPath_isRect_rect'>rect</a> is made up of consecutive <a href='undocumented#Line'>line</a> segments. 3462 </div> 3463 3464 #### Example Output 3465 3466 ~~~~ 3467 empty is not rect 3468 addRect is rect (10, 20, 30, 40); is closed; direction CW 3469 moveTo is rect (10, 20, 30, 40); is closed; direction CW 3470 lineTo is not rect 3471 addPoly is rect (0, 0, 80, 80); is not closed; direction CCW 3472 ~~~~ 3473 3474 </fiddle-embed></div> 3475 3476 ### See Also 3477 3478 <a href='#SkPath_computeTightBounds'>computeTightBounds</a> <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a> <a href='#SkPath_getBounds'>getBounds</a> <a href='#SkPath_isConvex'>isConvex</a> <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a> <a href='#SkPath_isNestedFillRects'>isNestedFillRects</a> 3479 3480 <a name='SkPath_isNestedFillRects'></a> 3481 3482 --- 3483 3484 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3485 bool <a href='#SkPath_isNestedFillRects'>isNestedFillRects</a>(<a href='SkRect_Reference#SkRect'>SkRect</a> <a href='SkRect_Reference#Rect'>rect</a>[2], <a href='#SkPath_Direction'>Direction</a> dirs[2] = nullptr)const 3486 </pre> 3487 3488 Returns true if <a href='SkPath_Reference#SkPath'>SkPath</a> is equivalent to nested <a href='SkRect_Reference#SkRect'>SkRect</a> pair when filled. 3489 If false, <a href='#SkPath_isNestedFillRects_rect'>rect</a> and <a href='#SkPath_isNestedFillRects_dirs'>dirs</a> are unchanged. 3490 If true, <a href='#SkPath_isNestedFillRects_rect'>rect</a> and <a href='#SkPath_isNestedFillRects_dirs'>dirs</a> are written to if not nullptr: 3491 setting <a href='#SkPath_isNestedFillRects_rect'>rect</a>[0] to outer <a href='SkRect_Reference#SkRect'>SkRect</a>, and <a href='#SkPath_isNestedFillRects_rect'>rect</a>[1] to inner <a href='SkRect_Reference#SkRect'>SkRect</a>; 3492 setting <a href='#SkPath_isNestedFillRects_dirs'>dirs</a>[0] to <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> of outer <a href='SkRect_Reference#SkRect'>SkRect</a>, and <a href='#SkPath_isNestedFillRects_dirs'>dirs</a>[1] to <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> of 3493 inner <a href='SkRect_Reference#SkRect'>SkRect</a>. 3494 3495 ### Parameters 3496 3497 <table> <tr> <td><a name='SkPath_isNestedFillRects_rect'><code><strong>rect</strong></code></a></td> 3498 <td>storage for <a href='SkRect_Reference#SkRect'>SkRect</a> pair; may be nullptr</td> 3499 </tr> 3500 <tr> <td><a name='SkPath_isNestedFillRects_dirs'><code><strong>dirs</strong></code></a></td> 3501 <td>storage for <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> pair; may be nullptr</td> 3502 </tr> 3503 </table> 3504 3505 ### Return Value 3506 3507 true if <a href='SkPath_Reference#SkPath'>SkPath</a> contains nested <a href='SkRect_Reference#SkRect'>SkRect</a> pair 3508 3509 ### Example 3510 3511 <div><fiddle-embed name="77e4394caf9fa083c19c21c2462efe14"> 3512 3513 #### Example Output 3514 3515 ~~~~ 3516 outer (7.5, 17.5, 32.5, 42.5); direction CW 3517 inner (12.5, 22.5, 27.5, 37.5); direction CCW 3518 ~~~~ 3519 3520 </fiddle-embed></div> 3521 3522 ### See Also 3523 3524 <a href='#SkPath_computeTightBounds'>computeTightBounds</a> <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a> <a href='#SkPath_getBounds'>getBounds</a> <a href='#SkPath_isConvex'>isConvex</a> <a href='#SkPath_isLastContourClosed'>isLastContourClosed</a> <a href='#SkPath_isRect'>isRect</a> 3525 3526 <a name='SkPath_addRect'></a> 3527 3528 --- 3529 3530 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3531 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRect'>addRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>) 3532 </pre> 3533 3534 Adds <a href='SkRect_Reference#SkRect'>SkRect</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, appending <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, three <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, 3535 starting with top-left corner of <a href='SkRect_Reference#SkRect'>SkRect</a>; followed by top-right, bottom-right, 3536 and bottom-left if <a href='#SkPath_addRect_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>; or followed by bottom-left, 3537 bottom-right, and top-right if <a href='#SkPath_addRect_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>. 3538 3539 ### Parameters 3540 3541 <table> <tr> <td><a name='SkPath_addRect_rect'><code><strong>rect</strong></code></a></td> 3542 <td><a href='SkRect_Reference#SkRect'>SkRect</a> to add as a closed <a href='SkPath_Overview#Contour'>contour</a></td> 3543 </tr> 3544 <tr> <td><a name='SkPath_addRect_dir'><code><strong>dir</strong></code></a></td> 3545 <td><a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> to wind added <a href='SkPath_Overview#Contour'>contour</a></td> 3546 </tr> 3547 </table> 3548 3549 ### Return Value 3550 3551 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3552 3553 ### Example 3554 3555 <div><fiddle-embed name="0f841e4eaebb613b5069800567917c2d"><div>The left <a href='SkRect_Reference#Rect'>Rect</a> dashes starting at the top-left corner, to the right. 3556 The right <a href='SkRect_Reference#Rect'>Rect</a> dashes starting at the top-left corner, towards the bottom. 3557 </div></fiddle-embed></div> 3558 3559 ### See Also 3560 3561 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkPath_Direction'>Direction</a> 3562 3563 <a name='SkPath_addRect_2'></a> 3564 3565 --- 3566 3567 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3568 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRect'>addRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start) 3569 </pre> 3570 3571 Adds <a href='SkRect_Reference#Rect'>Rect</a> to <a href='SkPath_Reference#Path'>Path</a>, appending <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, three <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose_Verb</a>. 3572 If <a href='#SkPath_addRect_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, <a href='SkRect_Reference#Rect'>Rect</a> corners are added clockwise; if <a href='#SkPath_addRect_2_dir'>dir</a> is 3573 <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>, <a href='SkRect_Reference#Rect'>Rect</a> corners are added counterclockwise. 3574 <a href='#SkPath_addRect_2_start'>start</a> determines the first corner added. 3575 3576 | <a href='#SkPath_addRect_2_start'>start</a> | first corner | 3577 | --- | --- | 3578 | 0 | top-left | 3579 | 1 | top-right | 3580 | 2 | bottom-right | 3581 | 3 | bottom-left | 3582 3583 ### Parameters 3584 3585 <table> <tr> <td><a name='SkPath_addRect_2_rect'><code><strong>rect</strong></code></a></td> 3586 <td><a href='SkRect_Reference#Rect'>Rect</a> to add as a closed <a href='SkPath_Overview#Contour'>contour</a></td> 3587 </tr> 3588 <tr> <td><a name='SkPath_addRect_2_dir'><code><strong>dir</strong></code></a></td> 3589 <td><a href='#SkPath_Direction'>Direction</a> to wind added <a href='SkPath_Overview#Contour'>contour</a></td> 3590 </tr> 3591 <tr> <td><a name='SkPath_addRect_2_start'><code><strong>start</strong></code></a></td> 3592 <td>initial corner of <a href='SkRect_Reference#Rect'>Rect</a> to add</td> 3593 </tr> 3594 </table> 3595 3596 ### Return Value 3597 3598 reference to <a href='SkPath_Reference#Path'>Path</a> 3599 3600 ### Example 3601 3602 <div><fiddle-embed name="9202430b3f4f5275af8eec5cc9d7baa8"><div>The arrow is just after the initial corner and <a href='SkPoint_Reference#Point'>points</a> towards the next 3603 corner appended to <a href='SkPath_Reference#Path'>Path</a>. 3604 </div></fiddle-embed></div> 3605 3606 ### See Also 3607 3608 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkPath_Direction'>Direction</a> 3609 3610 <a name='SkPath_addRect_3'></a> 3611 3612 --- 3613 3614 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3615 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRect'>addRect</a>(<a href='undocumented#SkScalar'>SkScalar</a> left, <a href='undocumented#SkScalar'>SkScalar</a> top, <a href='undocumented#SkScalar'>SkScalar</a> right, <a href='undocumented#SkScalar'>SkScalar</a> bottom, 3616 <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>) 3617 </pre> 3618 3619 Adds <a href='SkRect_Reference#SkRect'>SkRect</a> (<a href='#SkPath_addRect_3_left'>left</a>, <a href='#SkPath_addRect_3_top'>top</a>, <a href='#SkPath_addRect_3_right'>right</a>, <a href='#SkPath_addRect_3_bottom'>bottom</a>) to <a href='SkPath_Reference#SkPath'>SkPath</a>, 3620 appending <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, three <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, 3621 starting with top-left corner of <a href='SkRect_Reference#SkRect'>SkRect</a>; followed by top-right, bottom-right, 3622 and bottom-left if <a href='#SkPath_addRect_3_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>; or followed by bottom-left, 3623 bottom-right, and top-right if <a href='#SkPath_addRect_3_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>. 3624 3625 ### Parameters 3626 3627 <table> <tr> <td><a name='SkPath_addRect_3_left'><code><strong>left</strong></code></a></td> 3628 <td>smaller x-axis value of <a href='SkRect_Reference#SkRect'>SkRect</a></td> 3629 </tr> 3630 <tr> <td><a name='SkPath_addRect_3_top'><code><strong>top</strong></code></a></td> 3631 <td>smaller y-axis value of <a href='SkRect_Reference#SkRect'>SkRect</a></td> 3632 </tr> 3633 <tr> <td><a name='SkPath_addRect_3_right'><code><strong>right</strong></code></a></td> 3634 <td>larger x-axis value of <a href='SkRect_Reference#SkRect'>SkRect</a></td> 3635 </tr> 3636 <tr> <td><a name='SkPath_addRect_3_bottom'><code><strong>bottom</strong></code></a></td> 3637 <td>larger y-axis value of <a href='SkRect_Reference#SkRect'>SkRect</a></td> 3638 </tr> 3639 <tr> <td><a name='SkPath_addRect_3_dir'><code><strong>dir</strong></code></a></td> 3640 <td><a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> to wind added <a href='SkPath_Overview#Contour'>contour</a></td> 3641 </tr> 3642 </table> 3643 3644 ### Return Value 3645 3646 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3647 3648 ### Example 3649 3650 <div><fiddle-embed name="3837827310e8b88b8c2e128ef9fbbd65"><div>The <a href='#SkPath_addRect_3_left'>left</a> <a href='SkRect_Reference#Rect'>Rect</a> dashes start at the top-left corner, and continue to the <a href='#SkPath_addRect_3_right'>right</a>. 3651 The <a href='#SkPath_addRect_3_right'>right</a> <a href='SkRect_Reference#Rect'>Rect</a> dashes start at the top-left corner, and continue down. 3652 </div></fiddle-embed></div> 3653 3654 ### See Also 3655 3656 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawRect'>drawRect</a> <a href='#SkPath_Direction'>Direction</a> 3657 3658 <a name='SkPath_addOval'></a> 3659 3660 --- 3661 3662 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3663 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addOval'>addOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>) 3664 </pre> 3665 3666 Adds <a href='#SkPath_addOval_oval'>oval</a> to <a href='SkPath_Reference#Path'>path</a>, appending <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, four <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose_Verb</a>. 3667 <a href='undocumented#Oval'>Oval</a> is upright ellipse bounded by <a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPath_addOval_oval'>oval</a> with radii equal to half <a href='#SkPath_addOval_oval'>oval</a> width 3668 and half <a href='#SkPath_addOval_oval'>oval</a> height. <a href='undocumented#Oval'>Oval</a> begins at (<a href='#SkPath_addOval_oval'>oval</a>.<a href='#SkRect_fRight'>fRight</a>, <a href='#SkPath_addOval_oval'>oval</a>.<a href='#SkRect_centerY'>centerY</a>()) and continues 3669 clockwise if <a href='#SkPath_addOval_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, counterclockwise if <a href='#SkPath_addOval_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>. 3670 3671 ### Parameters 3672 3673 <table> <tr> <td><a name='SkPath_addOval_oval'><code><strong>oval</strong></code></a></td> 3674 <td>bounds of ellipse added</td> 3675 </tr> 3676 <tr> <td><a name='SkPath_addOval_dir'><code><strong>dir</strong></code></a></td> 3677 <td><a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> to wind ellipse</td> 3678 </tr> 3679 </table> 3680 3681 ### Return Value 3682 3683 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3684 3685 ### Example 3686 3687 <div><fiddle-embed name="cac84cf68e63a453c2a8b64c91537704"></fiddle-embed></div> 3688 3689 ### See Also 3690 3691 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkPath_Direction'>Direction</a> <a href='undocumented#Oval'>Oval</a> 3692 3693 <a name='SkPath_addOval_2'></a> 3694 3695 --- 3696 3697 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3698 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addOval'>addOval</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start) 3699 </pre> 3700 3701 Adds <a href='undocumented#Oval'>Oval</a> to <a href='SkPath_Reference#Path'>Path</a>, appending <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, four <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose_Verb</a>. 3702 <a href='undocumented#Oval'>Oval</a> is upright ellipse bounded by <a href='SkRect_Reference#Rect'>Rect</a> <a href='#SkPath_addOval_2_oval'>oval</a> with radii equal to half <a href='#SkPath_addOval_2_oval'>oval</a> width 3703 and half <a href='#SkPath_addOval_2_oval'>oval</a> height. <a href='undocumented#Oval'>Oval</a> begins at <a href='#SkPath_addOval_2_start'>start</a> and continues 3704 clockwise if <a href='#SkPath_addOval_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, counterclockwise if <a href='#SkPath_addOval_2_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>. 3705 3706 | <a href='#SkPath_addOval_2_start'>start</a> | <a href='SkPoint_Reference#Point'>Point</a> | 3707 | --- | --- | 3708 | 0 | <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_centerX'>centerX</a>(), <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_fTop'>fTop</a> | 3709 | 1 | <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_fRight'>fRight</a>, <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_centerY'>centerY</a>() | 3710 | 2 | <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_centerX'>centerX</a>(), <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_fBottom'>fBottom</a> | 3711 | 3 | <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkPath_addOval_2_oval'>oval</a>.<a href='#SkRect_centerY'>centerY</a>() | 3712 3713 ### Parameters 3714 3715 <table> <tr> <td><a name='SkPath_addOval_2_oval'><code><strong>oval</strong></code></a></td> 3716 <td>bounds of ellipse added</td> 3717 </tr> 3718 <tr> <td><a name='SkPath_addOval_2_dir'><code><strong>dir</strong></code></a></td> 3719 <td><a href='#SkPath_Direction'>Direction</a> to wind ellipse</td> 3720 </tr> 3721 <tr> <td><a name='SkPath_addOval_2_start'><code><strong>start</strong></code></a></td> 3722 <td>index of initial <a href='SkPoint_Reference#Point'>point</a> of ellipse</td> 3723 </tr> 3724 </table> 3725 3726 ### Return Value 3727 3728 reference to <a href='SkPath_Reference#Path'>Path</a> 3729 3730 ### Example 3731 3732 <div><fiddle-embed name="f1122d6fffddac0167e96fab4b9a862f"></fiddle-embed></div> 3733 3734 ### See Also 3735 3736 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawOval'>drawOval</a> <a href='#SkPath_Direction'>Direction</a> <a href='undocumented#Oval'>Oval</a> 3737 3738 <a name='SkPath_addCircle'></a> 3739 3740 --- 3741 3742 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3743 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addCircle'>addCircle</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='undocumented#SkScalar'>SkScalar</a> radius, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>) 3744 </pre> 3745 3746 Adds <a href='undocumented#Circle'>Circle</a> centered at (<a href='#SkPath_addCircle_x'>x</a>, <a href='#SkPath_addCircle_y'>y</a>) of <a href='undocumented#Size'>size</a> <a href='#SkPath_addCircle_radius'>radius</a> to <a href='SkPath_Reference#Path'>Path</a>, appending <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, 3747 four <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, and <a href='#SkPath_kClose_Verb'>kClose_Verb</a>. <a href='undocumented#Circle'>Circle</a> begins at: <code>(<a href='#SkPath_addCircle_x'>x</a> + <a href='#SkPath_addCircle_radius'>radius</a>, <a href='#SkPath_addCircle_y'>y</a>)</code>, continuing 3748 clockwise if <a href='#SkPath_addCircle_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, and counterclockwise if <a href='#SkPath_addCircle_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>. 3749 3750 Has no effect if <a href='#SkPath_addCircle_radius'>radius</a> is zero or negative. 3751 3752 ### Parameters 3753 3754 <table> <tr> <td><a name='SkPath_addCircle_x'><code><strong>x</strong></code></a></td> 3755 <td>center of <a href='undocumented#Circle'>Circle</a></td> 3756 </tr> 3757 <tr> <td><a name='SkPath_addCircle_y'><code><strong>y</strong></code></a></td> 3758 <td>center of <a href='undocumented#Circle'>Circle</a></td> 3759 </tr> 3760 <tr> <td><a name='SkPath_addCircle_radius'><code><strong>radius</strong></code></a></td> 3761 <td>distance from center to edge</td> 3762 </tr> 3763 <tr> <td><a name='SkPath_addCircle_dir'><code><strong>dir</strong></code></a></td> 3764 <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='undocumented#Circle'>Circle</a></td> 3765 </tr> 3766 </table> 3767 3768 ### Return Value 3769 3770 reference to <a href='SkPath_Reference#Path'>Path</a> 3771 3772 ### Example 3773 3774 <div><fiddle-embed name="bd5286cb9a5e5c32cd980f72b8f400fb"></fiddle-embed></div> 3775 3776 ### See Also 3777 3778 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawCircle'>drawCircle</a> <a href='#SkPath_Direction'>Direction</a> <a href='undocumented#Circle'>Circle</a> 3779 3780 <a name='SkPath_addArc'></a> 3781 3782 --- 3783 3784 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3785 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addArc'>addArc</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='undocumented#Oval'>oval</a>, <a href='undocumented#SkScalar'>SkScalar</a> startAngle, <a href='undocumented#SkScalar'>SkScalar</a> sweepAngle) 3786 </pre> 3787 3788 Appends <a href='undocumented#Arc'>arc</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, as the start of new <a href='SkPath_Overview#Contour'>contour</a>. <a href='undocumented#Arc'>Arc</a> added is part of ellipse 3789 bounded by <a href='#SkPath_addArc_oval'>oval</a>, from <a href='#SkPath_addArc_startAngle'>startAngle</a> through <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a>. Both <a href='#SkPath_addArc_startAngle'>startAngle</a> and 3790 <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> are measured in degrees, where zero degrees is aligned with the 3791 positive x-axis, and positive sweeps extends <a href='undocumented#Arc'>arc</a> clockwise. 3792 3793 If <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> <= -360, or <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> >= 360; and <a href='#SkPath_addArc_startAngle'>startAngle</a> modulo 90 is nearly 3794 zero, append <a href='#SkPath_addArc_oval'>oval</a> instead of <a href='undocumented#Arc'>arc</a>. Otherwise, <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> values are treated 3795 modulo 360, and <a href='undocumented#Arc'>arc</a> may or may not draw depending on numeric rounding. 3796 3797 ### Parameters 3798 3799 <table> <tr> <td><a name='SkPath_addArc_oval'><code><strong>oval</strong></code></a></td> 3800 <td>bounds of ellipse containing <a href='undocumented#Arc'>arc</a></td> 3801 </tr> 3802 <tr> <td><a name='SkPath_addArc_startAngle'><code><strong>startAngle</strong></code></a></td> 3803 <td>starting angle of <a href='undocumented#Arc'>arc</a> in degrees</td> 3804 </tr> 3805 <tr> <td><a name='SkPath_addArc_sweepAngle'><code><strong>sweepAngle</strong></code></a></td> 3806 <td>sweep, in degrees. Positive is clockwise; treated modulo 360</td> 3807 </tr> 3808 </table> 3809 3810 ### Return Value 3811 3812 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3813 3814 ### Example 3815 3816 <div><fiddle-embed name="9cf5122475624e4cf39f06c698f80b1a"><div>The middle row of the left and right columns draw differently from the entries 3817 above and below because <a href='#SkPath_addArc_sweepAngle'>sweepAngle</a> is outside of the range of +/-360, 3818 and <a href='#SkPath_addArc_startAngle'>startAngle</a> modulo 90 is not zero. 3819 </div></fiddle-embed></div> 3820 3821 ### See Also 3822 3823 <a href='undocumented#Arc'>Arc</a> <a href='#SkPath_arcTo'>arcTo</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawArc'>drawArc</a> 3824 3825 <a name='SkPath_addRoundRect'></a> 3826 3827 --- 3828 3829 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3830 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRoundRect'>addRoundRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, <a href='undocumented#SkScalar'>SkScalar</a> rx, <a href='undocumented#SkScalar'>SkScalar</a> ry, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>) 3831 </pre> 3832 3833 Appends <a href='SkRRect_Reference#SkRRect'>SkRRect</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, creating a new closed <a href='SkPath_Overview#Contour'>contour</a>. <a href='SkRRect_Reference#SkRRect'>SkRRect</a> has bounds 3834 equal to <a href='#SkPath_addRoundRect_rect'>rect</a>; each corner is 90 degrees of an ellipse with radii (<a href='#SkPath_addRoundRect_rx'>rx</a>, <a href='#SkPath_addRoundRect_ry'>ry</a>). If 3835 <a href='#SkPath_addRoundRect_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, <a href='SkRRect_Reference#SkRRect'>SkRRect</a> starts at top-left of the lower-left corner and 3836 winds clockwise. If <a href='#SkPath_addRoundRect_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>, <a href='SkRRect_Reference#SkRRect'>SkRRect</a> starts at the bottom-left 3837 of the upper-left corner and winds counterclockwise. 3838 3839 If either <a href='#SkPath_addRoundRect_rx'>rx</a> or <a href='#SkPath_addRoundRect_ry'>ry</a> is too large, <a href='#SkPath_addRoundRect_rx'>rx</a> and <a href='#SkPath_addRoundRect_ry'>ry</a> are scaled uniformly until the 3840 corners fit. If <a href='#SkPath_addRoundRect_rx'>rx</a> or <a href='#SkPath_addRoundRect_ry'>ry</a> is less than or equal to zero, <a href='#SkPath_addRoundRect'>addRoundRect</a>() appends 3841 <a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkPath_addRoundRect_rect'>rect</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. 3842 3843 After appending, <a href='SkPath_Reference#SkPath'>SkPath</a> may be empty, or may contain: <a href='SkRect_Reference#SkRect'>SkRect</a>, <a href='undocumented#Oval'>oval</a>, or <a href='SkRRect_Reference#SkRRect'>SkRRect</a>. 3844 3845 ### Parameters 3846 3847 <table> <tr> <td><a name='SkPath_addRoundRect_rect'><code><strong>rect</strong></code></a></td> 3848 <td>bounds of <a href='SkRRect_Reference#SkRRect'>SkRRect</a></td> 3849 </tr> 3850 <tr> <td><a name='SkPath_addRoundRect_rx'><code><strong>rx</strong></code></a></td> 3851 <td>x-axis radius of rounded corners on the <a href='SkRRect_Reference#SkRRect'>SkRRect</a></td> 3852 </tr> 3853 <tr> <td><a name='SkPath_addRoundRect_ry'><code><strong>ry</strong></code></a></td> 3854 <td>y-axis radius of rounded corners on the <a href='SkRRect_Reference#SkRRect'>SkRRect</a></td> 3855 </tr> 3856 <tr> <td><a name='SkPath_addRoundRect_dir'><code><strong>dir</strong></code></a></td> 3857 <td><a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> to wind <a href='SkRRect_Reference#SkRRect'>SkRRect</a></td> 3858 </tr> 3859 </table> 3860 3861 ### Return Value 3862 3863 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3864 3865 ### Example 3866 3867 <div><fiddle-embed name="24736f685f265cf533f1700c042db353"><div>If either radius is zero, <a href='SkPath_Reference#Path'>path</a> contains <a href='SkRect_Reference#Rect'>Rect</a> and is drawn red. 3868 If sides are only radii, <a href='SkPath_Reference#Path'>path</a> contains <a href='undocumented#Oval'>Oval</a> and is drawn blue. 3869 All remaining <a href='SkPath_Reference#Path'>path</a> draws are convex, and are drawn in gray; no 3870 <a href='SkPath_Reference#Path'>paths</a> constructed from <a href='#SkPath_addRoundRect'>addRoundRect</a> are concave, so none are 3871 drawn in green. 3872 </div></fiddle-embed></div> 3873 3874 ### See Also 3875 3876 <a href='#SkPath_addRRect'>addRRect</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> 3877 3878 <a name='SkPath_addRoundRect_2'></a> 3879 3880 --- 3881 3882 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3883 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRoundRect'>addRoundRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>, const <a href='undocumented#SkScalar'>SkScalar</a> radii[], <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>) 3884 </pre> 3885 3886 Appends <a href='#RRect'>Round_Rect</a> to <a href='SkPath_Reference#Path'>Path</a>, creating a new closed <a href='SkPath_Overview#Contour'>Contour</a>. <a href='#RRect'>Round_Rect</a> has bounds 3887 equal to <a href='#SkPath_addRoundRect_2_rect'>rect</a>; each corner is 90 degrees of an ellipse with <a href='#SkPath_addRoundRect_2_radii'>radii</a> from the 3888 array. 3889 3890 | <a href='#SkPath_addRoundRect_2_radii'>radii</a> index | location | 3891 | --- | --- | 3892 | 0 | x-axis radius of top-left corner | 3893 | 1 | y-axis radius of top-left corner | 3894 | 2 | x-axis radius of top-right corner | 3895 | 3 | y-axis radius of top-right corner | 3896 | 4 | x-axis radius of bottom-right corner | 3897 | 5 | y-axis radius of bottom-right corner | 3898 | 6 | x-axis radius of bottom-left corner | 3899 | 7 | y-axis radius of bottom-left corner | 3900 3901 If <a href='#SkPath_addRoundRect_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, <a href='#RRect'>Round_Rect</a> starts at top-left of the lower-left corner 3902 and winds clockwise. If <a href='#SkPath_addRoundRect_2_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>, <a href='#RRect'>Round_Rect</a> starts at the 3903 bottom-left of the upper-left corner and winds counterclockwise. 3904 3905 If both <a href='#SkPath_addRoundRect_2_radii'>radii</a> on any side of <a href='#SkPath_addRoundRect_2_rect'>rect</a> exceed its length, all <a href='#SkPath_addRoundRect_2_radii'>radii</a> are scaled 3906 uniformly until the corners fit. If either radius of a corner is less than or 3907 equal to zero, both are treated as zero. 3908 3909 After appending, <a href='SkPath_Reference#Path'>Path</a> may be empty, or may contain: <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, or <a href='#RRect'>Round_Rect</a>. 3910 3911 ### Parameters 3912 3913 <table> <tr> <td><a name='SkPath_addRoundRect_2_rect'><code><strong>rect</strong></code></a></td> 3914 <td>bounds of <a href='#RRect'>Round_Rect</a></td> 3915 </tr> 3916 <tr> <td><a name='SkPath_addRoundRect_2_radii'><code><strong>radii</strong></code></a></td> 3917 <td>array of 8 <a href='undocumented#SkScalar'>SkScalar</a> values, a radius pair for each corner</td> 3918 </tr> 3919 <tr> <td><a name='SkPath_addRoundRect_2_dir'><code><strong>dir</strong></code></a></td> 3920 <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='#RRect'>Round_Rect</a></td> 3921 </tr> 3922 </table> 3923 3924 ### Return Value 3925 3926 reference to <a href='SkPath_Reference#Path'>Path</a> 3927 3928 ### Example 3929 3930 <div><fiddle-embed name="c43d70606b4ee464d2befbcf448c5e73"></fiddle-embed></div> 3931 3932 ### See Also 3933 3934 <a href='#SkPath_addRRect'>addRRect</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawRoundRect'>drawRoundRect</a> 3935 3936 <a name='SkPath_addRRect'></a> 3937 3938 --- 3939 3940 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3941 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRRect'>addRRect</a>(const <a href='SkRRect_Reference#SkRRect'>SkRRect</a>& rrect, <a href='#SkPath_Direction'>Direction</a> dir = <a href='#SkPath_kCW_Direction'>kCW_Direction</a>) 3942 </pre> 3943 3944 Adds <a href='#SkPath_addRRect_rrect'>rrect</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, creating a new closed <a href='SkPath_Overview#Contour'>contour</a>. If 3945 <a href='#SkPath_addRRect_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, <a href='#SkPath_addRRect_rrect'>rrect</a> starts at top-left of the lower-left corner and 3946 winds clockwise. If <a href='#SkPath_addRRect_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>, <a href='#SkPath_addRRect_rrect'>rrect</a> starts at the bottom-left 3947 of the upper-left corner and winds counterclockwise. 3948 3949 After appending, <a href='SkPath_Reference#SkPath'>SkPath</a> may be empty, or may contain: <a href='SkRect_Reference#SkRect'>SkRect</a>, <a href='undocumented#Oval'>oval</a>, or <a href='SkRRect_Reference#SkRRect'>SkRRect</a>. 3950 3951 ### Parameters 3952 3953 <table> <tr> <td><a name='SkPath_addRRect_rrect'><code><strong>rrect</strong></code></a></td> 3954 <td>bounds and radii of rounded rectangle</td> 3955 </tr> 3956 <tr> <td><a name='SkPath_addRRect_dir'><code><strong>dir</strong></code></a></td> 3957 <td><a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Direction'>Direction</a> to wind <a href='SkRRect_Reference#SkRRect'>SkRRect</a></td> 3958 </tr> 3959 </table> 3960 3961 ### Return Value 3962 3963 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 3964 3965 ### Example 3966 3967 <div><fiddle-embed name="d9ecd58081b5bc77a157636fcb345dc6"></fiddle-embed></div> 3968 3969 ### See Also 3970 3971 <a href='#SkPath_addRoundRect'>addRoundRect</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawRRect'>drawRRect</a> 3972 3973 <a name='SkPath_addRRect_2'></a> 3974 3975 --- 3976 3977 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 3978 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addRRect'>addRRect</a>(const <a href='SkRRect_Reference#SkRRect'>SkRRect</a>& rrect, <a href='#SkPath_Direction'>Direction</a> dir, unsigned start) 3979 </pre> 3980 3981 Adds <a href='#SkPath_addRRect_2_rrect'>rrect</a> to <a href='SkPath_Reference#Path'>Path</a>, creating a new closed <a href='SkPath_Overview#Contour'>Contour</a>. If <a href='#SkPath_addRRect_2_dir'>dir</a> is <a href='#SkPath_kCW_Direction'>kCW_Direction</a>, <a href='#SkPath_addRRect_2_rrect'>rrect</a> 3982 winds clockwise; if <a href='#SkPath_addRRect_2_dir'>dir</a> is <a href='#SkPath_kCCW_Direction'>kCCW_Direction</a>, <a href='#SkPath_addRRect_2_rrect'>rrect</a> winds counterclockwise. 3983 <a href='#SkPath_addRRect_2_start'>start</a> determines the first <a href='SkPoint_Reference#Point'>point</a> of <a href='#SkPath_addRRect_2_rrect'>rrect</a> to add. 3984 3985 | <a href='#SkPath_addRRect_2_start'>start</a> | location | 3986 | --- | --- | 3987 | 0 | right of top-left corner | 3988 | 1 | left of top-right corner | 3989 | 2 | bottom of top-right corner | 3990 | 3 | top of bottom-right corner | 3991 | 4 | left of bottom-right corner | 3992 | 5 | right of bottom-left corner | 3993 | 6 | top of bottom-left corner | 3994 | 7 | bottom of top-left corner | 3995 3996 After appending, <a href='SkPath_Reference#Path'>Path</a> may be empty, or may contain: <a href='SkRect_Reference#Rect'>Rect</a>, <a href='undocumented#Oval'>Oval</a>, or <a href='#RRect'>Round_Rect</a>. 3997 3998 ### Parameters 3999 4000 <table> <tr> <td><a name='SkPath_addRRect_2_rrect'><code><strong>rrect</strong></code></a></td> 4001 <td>bounds and radii of rounded rectangle</td> 4002 </tr> 4003 <tr> <td><a name='SkPath_addRRect_2_dir'><code><strong>dir</strong></code></a></td> 4004 <td><a href='#SkPath_Direction'>Direction</a> to wind <a href='#RRect'>Round_Rect</a></td> 4005 </tr> 4006 <tr> <td><a name='SkPath_addRRect_2_start'><code><strong>start</strong></code></a></td> 4007 <td>index of initial <a href='SkPoint_Reference#Point'>point</a> of <a href='#RRect'>Round_Rect</a></td> 4008 </tr> 4009 </table> 4010 4011 ### Return Value 4012 4013 reference to <a href='SkPath_Reference#Path'>Path</a> 4014 4015 ### Example 4016 4017 <div><fiddle-embed name="888edd4c4a91ca62ceb01bce8ab675b2"></fiddle-embed></div> 4018 4019 ### See Also 4020 4021 <a href='#SkPath_addRoundRect'>addRoundRect</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawRRect'>drawRRect</a> 4022 4023 <a name='SkPath_addPoly'></a> 4024 4025 --- 4026 4027 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4028 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPoly'>addPoly</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count, bool close) 4029 </pre> 4030 4031 Adds <a href='SkPath_Overview#Contour'>contour</a> created from <a href='undocumented#Line'>line</a> array, adding (<a href='#SkPath_addPoly_count'>count</a> - 1) <a href='undocumented#Line'>line</a> segments. 4032 <a href='SkPath_Overview#Contour'>Contour</a> added starts at <a href='#SkPath_addPoly_pts'>pts</a>[0], then adds a <a href='undocumented#Line'>line</a> for every additional <a href='SkPoint_Reference#SkPoint'>SkPoint</a> 4033 in <a href='#SkPath_addPoly_pts'>pts</a> array. If <a href='#SkPath_addPoly_close'>close</a> is true, appends <a href='#SkPath_kClose_Verb'>kClose_Verb</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, connecting 4034 <a href='#SkPath_addPoly_pts'>pts</a>[<a href='#SkPath_addPoly_count'>count</a> - 1] and <a href='#SkPath_addPoly_pts'>pts</a>[0]. 4035 4036 If <a href='#SkPath_addPoly_count'>count</a> is zero, append <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='SkPath_Reference#Path'>path</a>. 4037 Has no effect if <a href='#SkPath_addPoly_count'>count</a> is less than one. 4038 4039 ### Parameters 4040 4041 <table> <tr> <td><a name='SkPath_addPoly_pts'><code><strong>pts</strong></code></a></td> 4042 <td>array of <a href='undocumented#Line'>line</a> sharing end and start <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td> 4043 </tr> 4044 <tr> <td><a name='SkPath_addPoly_count'><code><strong>count</strong></code></a></td> 4045 <td>length of <a href='SkPath_Reference#Point_Array'>SkPoint array</a></td> 4046 </tr> 4047 <tr> <td><a name='SkPath_addPoly_close'><code><strong>close</strong></code></a></td> 4048 <td>true to add <a href='undocumented#Line'>line</a> connecting <a href='SkPath_Overview#Contour'>contour</a> end and start</td> 4049 </tr> 4050 </table> 4051 4052 ### Return Value 4053 4054 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 4055 4056 ### Example 4057 4058 <div><fiddle-embed name="182b3999772f330f3b0b891b492634ae"></fiddle-embed></div> 4059 4060 ### See Also 4061 4062 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawPoints'>drawPoints</a> 4063 4064 <a name='SkPath_addPoly_2'></a> 4065 4066 --- 4067 4068 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4069 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPoly'>addPoly</a>(const std::initializer_list<<a href='SkPoint_Reference#SkPoint'>SkPoint</a>>& list, bool close) 4070 </pre> 4071 4072 Adds <a href='SkPath_Overview#Contour'>contour</a> created from <a href='#SkPath_addPoly_2_list'>list</a>. <a href='SkPath_Overview#Contour'>Contour</a> added starts at <a href='#SkPath_addPoly_2_list'>list</a>[0], then adds a <a href='undocumented#Line'>line</a> 4073 for every additional <a href='SkPoint_Reference#SkPoint'>SkPoint</a> in <a href='#SkPath_addPoly_2_list'>list</a>. If <a href='#SkPath_addPoly_2_close'>close</a> is true, appends <a href='#SkPath_kClose_Verb'>kClose_Verb</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, 4074 connecting last and first <a href='SkPoint_Reference#SkPoint'>SkPoint</a> in <a href='#SkPath_addPoly_2_list'>list</a>. 4075 4076 If <a href='#SkPath_addPoly_2_list'>list</a> is empty, append <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to <a href='SkPath_Reference#Path'>path</a>. 4077 4078 ### Parameters 4079 4080 <table> <tr> <td><a name='SkPath_addPoly_2_list'><code><strong>list</strong></code></a></td> 4081 <td>array of <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td> 4082 </tr> 4083 <tr> <td><a name='SkPath_addPoly_2_close'><code><strong>close</strong></code></a></td> 4084 <td>true to add <a href='undocumented#Line'>line</a> connecting <a href='SkPath_Overview#Contour'>contour</a> end and start</td> 4085 </tr> 4086 </table> 4087 4088 ### Return Value 4089 4090 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 4091 4092 ### Example 4093 4094 <div><fiddle-embed name="1a6b69acad5ceafede3c5984ec6634cb"></fiddle-embed></div> 4095 4096 ### See Also 4097 4098 <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_drawPoints'>drawPoints</a> 4099 4100 <a name='SkPath_AddPathMode'></a> 4101 4102 --- 4103 4104 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4105 enum <a href='#SkPath_AddPathMode'>AddPathMode</a> { 4106 <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>, 4107 <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a>, 4108 }; 4109 </pre> 4110 4111 <a href='#SkPath_AddPathMode'>AddPathMode</a> chooses how <a href='#SkPath_addPath'>addPath</a> appends. Adding one <a href='SkPath_Reference#Path'>Path</a> to another can extend 4112 the last <a href='SkPath_Overview#Contour'>Contour</a> or start a new <a href='SkPath_Overview#Contour'>Contour</a>. 4113 4114 ### Constants 4115 4116 <table style='border-collapse: collapse; width: 62.5em'> 4117 <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> 4118 <th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> 4119 <th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> 4120 <tr style='background-color: #f0f0f0; '> 4121 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kAppend_AddPathMode'><code>SkPath::kAppend_AddPathMode</code></a></td> 4122 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # appended to destination unaltered ##</td> 4123 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 4124 <a href='SkPath_Reference#Path'>Path</a> <a href='SkPath_Reference#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Path_Conic_Weight'>Conic_Weights</a> are appended to destination unaltered. 4125 Since <a href='SkPath_Reference#Path'>Path</a> <a href='#Path_Verb_Array'>Verb_Array</a> begins with <a href='#SkPath_kMove_Verb'>kMove_Verb</a> if src is not empty, this 4126 starts a new <a href='SkPath_Overview#Contour'>Contour</a>. 4127 </td> 4128 </tr> 4129 <tr> 4130 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kExtend_AddPathMode'><code>SkPath::kExtend_AddPathMode</code></a></td> 4131 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # add line if prior Contour is not closed ##</td> 4132 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 4133 If destination is closed or empty, start a new <a href='SkPath_Overview#Contour'>Contour</a>. If destination 4134 is not empty, add <a href='undocumented#Line'>Line</a> from <a href='#Path_Last_Point'>Last_Point</a> to added <a href='SkPath_Reference#Path'>Path</a> first <a href='SkPoint_Reference#Point'>Point</a>. Skip added 4135 <a href='SkPath_Reference#Path'>Path</a> initial <a href='#SkPath_kMove_Verb'>kMove_Verb</a>, then append remaining <a href='SkPath_Reference#Verb'>Verbs</a>, <a href='SkPoint_Reference#Point'>Points</a>, and <a href='#Path_Conic_Weight'>Conic_Weights</a>. 4136 </td> 4137 </tr> 4138 </table> 4139 4140 ### Example 4141 4142 <div><fiddle-embed name="801b02e74c64aafdb734f2e5cf3e5ab0"><div>test is built from <a href='SkPath_Reference#Path'>path</a>, open on the top row, and closed on the bottom row. 4143 The left column uses <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>; the right uses <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a>. 4144 The top right composition is made up of one <a href='SkPath_Overview#Contour'>contour</a>; the other three have two. 4145 </div></fiddle-embed></div> 4146 4147 ### See Also 4148 4149 <a href='#SkPath_addPath'>addPath</a> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> 4150 4151 <a name='SkPath_addPath'></a> 4152 4153 --- 4154 4155 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4156 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPath'>addPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, <a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>) 4157 </pre> 4158 4159 Appends <a href='#SkPath_addPath_src'>src</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, offset by (<a href='#SkPath_addPath_dx'>dx</a>, <a href='#SkPath_addPath_dy'>dy</a>). 4160 4161 If <a href='#SkPath_addPath_mode'>mode</a> is <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>, <a href='#SkPath_addPath_src'>src</a> <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a> are 4162 added unaltered. If <a href='#SkPath_addPath_mode'>mode</a> is <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a>, add <a href='undocumented#Line'>line</a> before appending 4163 <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a>. 4164 4165 ### Parameters 4166 4167 <table> <tr> <td><a name='SkPath_addPath_src'><code><strong>src</strong></code></a></td> 4168 <td><a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a> to add</td> 4169 </tr> 4170 <tr> <td><a name='SkPath_addPath_dx'><code><strong>dx</strong></code></a></td> 4171 <td>offset added to <a href='#SkPath_addPath_src'>src</a> <a href='SkPath_Reference#Point_Array'>SkPoint array</a> x-axis coordinates</td> 4172 </tr> 4173 <tr> <td><a name='SkPath_addPath_dy'><code><strong>dy</strong></code></a></td> 4174 <td>offset added to <a href='#SkPath_addPath_src'>src</a> <a href='SkPath_Reference#Point_Array'>SkPoint array</a> y-axis coordinates</td> 4175 </tr> 4176 <tr> <td><a name='SkPath_addPath_mode'><code><strong>mode</strong></code></a></td> 4177 <td><a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a> or <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a></td> 4178 </tr> 4179 </table> 4180 4181 ### Return Value 4182 4183 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 4184 4185 ### Example 4186 4187 <div><fiddle-embed name="c416bddfe286628974e1c7f0fd66f3f4"></fiddle-embed></div> 4188 4189 ### See Also 4190 4191 <a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_offset'>offset</a> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> 4192 4193 <a name='SkPath_addPath_2'></a> 4194 4195 --- 4196 4197 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4198 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPath'>addPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>) 4199 </pre> 4200 4201 Appends <a href='#SkPath_addPath_2_src'>src</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. 4202 4203 If <a href='#SkPath_addPath_2_mode'>mode</a> is <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>, <a href='#SkPath_addPath_2_src'>src</a> <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a> are 4204 added unaltered. If <a href='#SkPath_addPath_2_mode'>mode</a> is <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a>, add <a href='undocumented#Line'>line</a> before appending 4205 <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a>. 4206 4207 ### Parameters 4208 4209 <table> <tr> <td><a name='SkPath_addPath_2_src'><code><strong>src</strong></code></a></td> 4210 <td><a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a> to add</td> 4211 </tr> 4212 <tr> <td><a name='SkPath_addPath_2_mode'><code><strong>mode</strong></code></a></td> 4213 <td><a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a> or <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a></td> 4214 </tr> 4215 </table> 4216 4217 ### Return Value 4218 4219 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 4220 4221 ### Example 4222 4223 <div><fiddle-embed name="84b2d1c0fc29f1b35e855b6fc6672f9e"></fiddle-embed></div> 4224 4225 ### See Also 4226 4227 <a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> 4228 4229 <a name='SkPath_addPath_3'></a> 4230 4231 --- 4232 4233 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4234 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_addPath'>addPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='SkMatrix_Reference#Matrix'>matrix</a>, <a href='#SkPath_AddPathMode'>AddPathMode</a> mode = <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>) 4235 </pre> 4236 4237 Appends <a href='#SkPath_addPath_3_src'>src</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, transformed by <a href='#SkPath_addPath_3_matrix'>matrix</a>. Transformed <a href='undocumented#Curve'>curves</a> may have different 4238 <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a>. 4239 4240 If <a href='#SkPath_addPath_3_mode'>mode</a> is <a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a>, <a href='#SkPath_addPath_3_src'>src</a> <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a> are 4241 added unaltered. If <a href='#SkPath_addPath_3_mode'>mode</a> is <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a>, add <a href='undocumented#Line'>line</a> before appending 4242 <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a>. 4243 4244 ### Parameters 4245 4246 <table> <tr> <td><a name='SkPath_addPath_3_src'><code><strong>src</strong></code></a></td> 4247 <td><a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a> to add</td> 4248 </tr> 4249 <tr> <td><a name='SkPath_addPath_3_matrix'><code><strong>matrix</strong></code></a></td> 4250 <td>transform applied to <a href='#SkPath_addPath_3_src'>src</a></td> 4251 </tr> 4252 <tr> <td><a name='SkPath_addPath_3_mode'><code><strong>mode</strong></code></a></td> 4253 <td><a href='#SkPath_kAppend_AddPathMode'>kAppend_AddPathMode</a> or <a href='#SkPath_kExtend_AddPathMode'>kExtend_AddPathMode</a></td> 4254 </tr> 4255 </table> 4256 4257 ### Return Value 4258 4259 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 4260 4261 ### Example 4262 4263 <div><fiddle-embed name="3a90a91030f7289d5df0671d342dbbad"></fiddle-embed></div> 4264 4265 ### See Also 4266 4267 <a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_transform'>transform</a> <a href='#SkPath_offset'>offset</a> <a href='#SkPath_reverseAddPath'>reverseAddPath</a> 4268 4269 <a name='SkPath_reverseAddPath'></a> 4270 4271 --- 4272 4273 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4274 <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='#SkPath_reverseAddPath'>reverseAddPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& src) 4275 </pre> 4276 4277 Appends <a href='#SkPath_reverseAddPath_src'>src</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>, from back to front. 4278 Reversed <a href='#SkPath_reverseAddPath_src'>src</a> always appends a new <a href='SkPath_Overview#Contour'>contour</a> to <a href='SkPath_Reference#SkPath'>SkPath</a>. 4279 4280 ### Parameters 4281 4282 <table> <tr> <td><a name='SkPath_reverseAddPath_src'><code><strong>src</strong></code></a></td> 4283 <td><a href='SkPath_Reference#SkPath'>SkPath</a> <a href='SkPath_Reference#Verb'>verbs</a>, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>, and <a href='SkPath_Reference#Conic_Weight'>conic weights</a> to add</td> 4284 </tr> 4285 </table> 4286 4287 ### Return Value 4288 4289 reference to <a href='SkPath_Reference#SkPath'>SkPath</a> 4290 4291 ### Example 4292 4293 <div><fiddle-embed name="5e8513f073db09acde3ff616f6426e3d"></fiddle-embed></div> 4294 4295 ### See Also 4296 4297 <a href='#SkPath_AddPathMode'>AddPathMode</a> <a href='#SkPath_transform'>transform</a> <a href='#SkPath_offset'>offset</a> <a href='#SkPath_addPath'>addPath</a> 4298 4299 <a name='SkPath_offset'></a> 4300 4301 --- 4302 4303 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4304 void offset(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='SkPath_Reference#SkPath'>SkPath</a>* dst)const 4305 </pre> 4306 4307 Offsets <a href='SkPath_Reference#Point_Array'>SkPoint array</a> by (<a href='#SkPath_offset_dx'>dx</a>, <a href='#SkPath_offset_dy'>dy</a>). Offset <a href='SkPath_Reference#SkPath'>SkPath</a> replaces <a href='#SkPath_offset_dst'>dst</a>. 4308 If <a href='#SkPath_offset_dst'>dst</a> is nullptr, <a href='SkPath_Reference#SkPath'>SkPath</a> is replaced by offset <a href='undocumented#Data'>data</a>. 4309 4310 ### Parameters 4311 4312 <table> <tr> <td><a name='SkPath_offset_dx'><code><strong>dx</strong></code></a></td> 4313 <td>offset added to <a href='SkPath_Reference#Point_Array'>SkPoint array</a> x-axis coordinates</td> 4314 </tr> 4315 <tr> <td><a name='SkPath_offset_dy'><code><strong>dy</strong></code></a></td> 4316 <td>offset added to <a href='SkPath_Reference#Point_Array'>SkPoint array</a> y-axis coordinates</td> 4317 </tr> 4318 <tr> <td><a name='SkPath_offset_dst'><code><strong>dst</strong></code></a></td> 4319 <td>overwritten, translated copy of <a href='SkPath_Reference#SkPath'>SkPath</a>; may be nullptr</td> 4320 </tr> 4321 </table> 4322 4323 ### Example 4324 4325 <div><fiddle-embed name="1d1892196ba5bda257df4f3351abd084"></fiddle-embed></div> 4326 4327 ### See Also 4328 4329 <a href='#SkPath_addPath'>addPath</a> <a href='#SkPath_transform'>transform</a> 4330 4331 <a name='Transform'></a> 4332 4333 <a name='SkPath_offset_2'></a> 4334 4335 --- 4336 4337 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4338 void offset(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) 4339 </pre> 4340 4341 Offsets <a href='SkPath_Reference#Point_Array'>SkPoint array</a> by (<a href='#SkPath_offset_2_dx'>dx</a>, <a href='#SkPath_offset_2_dy'>dy</a>). <a href='SkPath_Reference#SkPath'>SkPath</a> is replaced by offset <a href='undocumented#Data'>data</a>. 4342 4343 ### Parameters 4344 4345 <table> <tr> <td><a name='SkPath_offset_2_dx'><code><strong>dx</strong></code></a></td> 4346 <td>offset added to <a href='SkPath_Reference#Point_Array'>SkPoint array</a> x-axis coordinates</td> 4347 </tr> 4348 <tr> <td><a name='SkPath_offset_2_dy'><code><strong>dy</strong></code></a></td> 4349 <td>offset added to <a href='SkPath_Reference#Point_Array'>SkPoint array</a> y-axis coordinates</td> 4350 </tr> 4351 </table> 4352 4353 ### Example 4354 4355 <div><fiddle-embed name="5188d77585715db30bef228f2dfbcccd"></fiddle-embed></div> 4356 4357 ### See Also 4358 4359 <a href='#SkPath_addPath'>addPath</a> <a href='#SkPath_transform'>transform</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_translate'>translate()</a> 4360 4361 <a name='SkPath_transform'></a> 4362 4363 --- 4364 4365 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4366 void transform(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='SkMatrix_Reference#Matrix'>matrix</a>, <a href='SkPath_Reference#SkPath'>SkPath</a>* dst)const 4367 </pre> 4368 4369 Transforms <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and weight by <a href='#SkPath_transform_matrix'>matrix</a>. 4370 transform may change <a href='SkPath_Reference#Verb'>verbs</a> and increase their number. 4371 Transformed <a href='SkPath_Reference#SkPath'>SkPath</a> replaces <a href='#SkPath_transform_dst'>dst</a>; if <a href='#SkPath_transform_dst'>dst</a> is nullptr, original <a href='undocumented#Data'>data</a> 4372 is replaced. 4373 4374 ### Parameters 4375 4376 <table> <tr> <td><a name='SkPath_transform_matrix'><code><strong>matrix</strong></code></a></td> 4377 <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to apply to <a href='SkPath_Reference#SkPath'>SkPath</a></td> 4378 </tr> 4379 <tr> <td><a name='SkPath_transform_dst'><code><strong>dst</strong></code></a></td> 4380 <td>overwritten, transformed copy of <a href='SkPath_Reference#SkPath'>SkPath</a>; may be nullptr</td> 4381 </tr> 4382 </table> 4383 4384 ### Example 4385 4386 <div><fiddle-embed name="99761add116ce3b0730557224c1b0105"></fiddle-embed></div> 4387 4388 ### See Also 4389 4390 <a href='#SkPath_addPath'>addPath</a> <a href='#SkPath_offset'>offset</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_concat'>concat()</a> <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> 4391 4392 <a name='SkPath_transform_2'></a> 4393 4394 --- 4395 4396 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4397 void transform(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='SkMatrix_Reference#Matrix'>matrix</a>) 4398 </pre> 4399 4400 Transforms <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and weight by <a href='#SkPath_transform_2_matrix'>matrix</a>. 4401 transform may change <a href='SkPath_Reference#Verb'>verbs</a> and increase their number. 4402 <a href='SkPath_Reference#SkPath'>SkPath</a> is replaced by transformed <a href='undocumented#Data'>data</a>. 4403 4404 ### Parameters 4405 4406 <table> <tr> <td><a name='SkPath_transform_2_matrix'><code><strong>matrix</strong></code></a></td> 4407 <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to apply to <a href='SkPath_Reference#SkPath'>SkPath</a></td> 4408 </tr> 4409 </table> 4410 4411 ### Example 4412 4413 <div><fiddle-embed name="c40979a3b92a30cfb7bae36abcc1d805"></fiddle-embed></div> 4414 4415 ### See Also 4416 4417 <a href='#SkPath_addPath'>addPath</a> <a href='#SkPath_offset'>offset</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_concat'>concat()</a> <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> 4418 4419 <a name='Last_Point'></a> 4420 4421 <a href='SkPath_Reference#Path'>Path</a> is defined cumulatively, often by adding a segment to the end of last 4422 <a href='SkPath_Overview#Contour'>Contour</a>. <a href='#Path_Last_Point'>Last_Point</a> of <a href='SkPath_Overview#Contour'>Contour</a> is shared as first <a href='SkPoint_Reference#Point'>Point</a> of added <a href='undocumented#Line'>Line</a> or <a href='undocumented#Curve'>Curve</a>. 4423 <a href='#Path_Last_Point'>Last_Point</a> can be read and written directly with <a href='#SkPath_getLastPt'>getLastPt</a> and <a href='#SkPath_setLastPt'>setLastPt</a>. 4424 4425 <a name='SkPath_getLastPt'></a> 4426 4427 --- 4428 4429 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4430 bool <a href='#SkPath_getLastPt'>getLastPt</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a>* lastPt)const 4431 </pre> 4432 4433 Returns <a href='#Last_Point'>last point</a> on <a href='SkPath_Reference#SkPath'>SkPath</a> in <a href='#SkPath_getLastPt_lastPt'>lastPt</a>. Returns false if <a href='SkPath_Reference#Point_Array'>SkPoint array</a> is empty, 4434 storing (0, 0) if <a href='#SkPath_getLastPt_lastPt'>lastPt</a> is not nullptr. 4435 4436 ### Parameters 4437 4438 <table> <tr> <td><a name='SkPath_getLastPt_lastPt'><code><strong>lastPt</strong></code></a></td> 4439 <td>storage for final <a href='SkPoint_Reference#SkPoint'>SkPoint</a> in <a href='SkPath_Reference#Point_Array'>SkPoint array</a>; may be nullptr</td> 4440 </tr> 4441 </table> 4442 4443 ### Return Value 4444 4445 true if <a href='SkPath_Reference#Point_Array'>SkPoint array</a> contains one or more <a href='SkPoint_Reference#SkPoint'>SkPoint</a> 4446 4447 ### Example 4448 4449 <div><fiddle-embed name="df8160dd7ac8aa4b40fce7286fe49952"> 4450 4451 #### Example Output 4452 4453 ~~~~ 4454 last point: 35.2786, 52.9772 4455 ~~~~ 4456 4457 </fiddle-embed></div> 4458 4459 ### See Also 4460 4461 <a href='#SkPath_setLastPt'>setLastPt</a> 4462 4463 <a name='SkPath_setLastPt'></a> 4464 4465 --- 4466 4467 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4468 void <a href='#SkPath_setLastPt'>setLastPt</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) 4469 </pre> 4470 4471 Sets <a href='#Last_Point'>last point</a> to (<a href='#SkPath_setLastPt_x'>x</a>, <a href='#SkPath_setLastPt_y'>y</a>). If <a href='SkPath_Reference#Point_Array'>SkPoint array</a> is empty, append <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to 4472 <a href='#Verb_Array'>verb array</a> and append (<a href='#SkPath_setLastPt_x'>x</a>, <a href='#SkPath_setLastPt_y'>y</a>) to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 4473 4474 ### Parameters 4475 4476 <table> <tr> <td><a name='SkPath_setLastPt_x'><code><strong>x</strong></code></a></td> 4477 <td>set x-axis value of <a href='#Last_Point'>last point</a></td> 4478 </tr> 4479 <tr> <td><a name='SkPath_setLastPt_y'><code><strong>y</strong></code></a></td> 4480 <td>set y-axis value of <a href='#Last_Point'>last point</a></td> 4481 </tr> 4482 </table> 4483 4484 ### Example 4485 4486 <div><fiddle-embed name="542c5afaea5f57baa11d0561dd402e18"></fiddle-embed></div> 4487 4488 ### See Also 4489 4490 <a href='#SkPath_getLastPt'>getLastPt</a> 4491 4492 <a name='SkPath_setLastPt_2'></a> 4493 4494 --- 4495 4496 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4497 void <a href='#SkPath_setLastPt'>setLastPt</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a>& p) 4498 </pre> 4499 4500 Sets the <a href='#Last_Point'>last point</a> on the <a href='SkPath_Reference#Path'>path</a>. If <a href='SkPath_Reference#Point_Array'>SkPoint array</a> is empty, append <a href='#SkPath_kMove_Verb'>kMove_Verb</a> to 4501 <a href='#Verb_Array'>verb array</a> and append <a href='#SkPath_setLastPt_2_p'>p</a> to <a href='SkPath_Reference#Point_Array'>SkPoint array</a>. 4502 4503 ### Parameters 4504 4505 <table> <tr> <td><a name='SkPath_setLastPt_2_p'><code><strong>p</strong></code></a></td> 4506 <td>set value of <a href='#Last_Point'>last point</a></td> 4507 </tr> 4508 </table> 4509 4510 ### Example 4511 4512 <div><fiddle-embed name="6fa5e8f9513b3225e106778592e27e94"></fiddle-embed></div> 4513 4514 ### See Also 4515 4516 <a href='#SkPath_getLastPt'>getLastPt</a> 4517 4518 <a name='SkPath_SegmentMask'></a> 4519 4520 --- 4521 4522 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4523 enum <a href='#SkPath_SegmentMask'>SegmentMask</a> { 4524 <a href='#SkPath_kLine_SegmentMask'>kLine_SegmentMask</a> = 1 << 0, 4525 <a href='#SkPath_kQuad_SegmentMask'>kQuad_SegmentMask</a> = 1 << 1, 4526 <a href='#SkPath_kConic_SegmentMask'>kConic_SegmentMask</a> = 1 << 2, 4527 <a href='#SkPath_kCubic_SegmentMask'>kCubic_SegmentMask</a> = 1 << 3, 4528 }; 4529 </pre> 4530 4531 <a href='#SkPath_SegmentMask'>SegmentMask</a> constants correspond to each drawing <a href='#SkPath_Verb'>Verb</a> type in <a href='SkPath_Reference#Path'>Path</a>; for 4532 instance, if <a href='SkPath_Reference#Path'>Path</a> only contains <a href='undocumented#Line'>Lines</a>, only the <a href='#SkPath_kLine_SegmentMask'>kLine_SegmentMask</a> bit is set. 4533 4534 ### Constants 4535 4536 <table style='border-collapse: collapse; width: 62.5em'> 4537 <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th> 4538 <th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th> 4539 <th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr> 4540 <tr style='background-color: #f0f0f0; '> 4541 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kLine_SegmentMask'><code>SkPath::kLine_SegmentMask</code></a></td> 4542 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> 4543 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 4544 Set if <a href='#Path_Verb_Array'>Verb_Array</a> contains <a href='#SkPath_kLine_Verb'>kLine_Verb</a>. 4545 </td> 4546 </tr> 4547 <tr> 4548 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kQuad_SegmentMask'><code>SkPath::kQuad_SegmentMask</code></a></td> 4549 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> 4550 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 4551 Set if <a href='#Path_Verb_Array'>Verb_Array</a> contains <a href='#SkPath_kQuad_Verb'>kQuad_Verb</a>. Note that <a href='#SkPath_conicTo'>conicTo</a> may add a <a href='SkPath_Reference#Quad'>Quad</a>. 4552 </td> 4553 </tr> 4554 <tr style='background-color: #f0f0f0; '> 4555 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kConic_SegmentMask'><code>SkPath::kConic_SegmentMask</code></a></td> 4556 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td> 4557 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 4558 Set if <a href='#Path_Verb_Array'>Verb_Array</a> contains <a href='#SkPath_kConic_Verb'>kConic_Verb</a>. 4559 </td> 4560 </tr> 4561 <tr> 4562 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkPath_kCubic_SegmentMask'><code>SkPath::kCubic_SegmentMask</code></a></td> 4563 <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td> 4564 <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> 4565 Set if <a href='#Path_Verb_Array'>Verb_Array</a> contains <a href='#SkPath_kCubic_Verb'>kCubic_Verb</a>. 4566 </td> 4567 </tr> 4568 </table> 4569 4570 ### Example 4571 4572 <div><fiddle-embed name="a61e5758574e28190ec4ed8c4ae7e7fa"><div>When <a href='#SkPath_conicTo'>conicTo</a> has a weight of one, <a href='SkPath_Reference#Quad'>Quad</a> is added to <a href='SkPath_Reference#Path'>Path</a>. 4573 </div> 4574 4575 #### Example Output 4576 4577 ~~~~ 4578 Path kConic_SegmentMask is clear 4579 Path kQuad_SegmentMask is set 4580 ~~~~ 4581 4582 </fiddle-embed></div> 4583 4584 ### See Also 4585 4586 <a href='#SkPath_getSegmentMasks'>getSegmentMasks</a> <a href='#SkPath_Verb'>Verb</a> 4587 4588 <a name='SkPath_getSegmentMasks'></a> 4589 4590 --- 4591 4592 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4593 uint32_t <a href='#SkPath_getSegmentMasks'>getSegmentMasks</a>()const 4594 </pre> 4595 4596 Returns a mask, where each set bit corresponds to a <a href='#SkPath_SegmentMask'>SegmentMask</a> constant 4597 if <a href='SkPath_Reference#SkPath'>SkPath</a> contains one or more <a href='SkPath_Reference#Verb'>verbs</a> of that type. 4598 Returns zero if <a href='SkPath_Reference#SkPath'>SkPath</a> contains no <a href='undocumented#Line'>lines</a>, or <a href='undocumented#Curve'>curves</a>: <a href='SkPath_Reference#Quad'>quads</a>, <a href='SkPath_Reference#Conic'>conics</a>, or <a href='SkPath_Reference#Cubic'>cubics</a>. 4599 4600 <a href='#SkPath_getSegmentMasks'>getSegmentMasks</a>() returns a cached result; it is very fast. 4601 4602 ### Return Value 4603 4604 <a href='#SkPath_SegmentMask'>SegmentMask</a> bits or zero 4605 4606 ### Example 4607 4608 <div><fiddle-embed name="657a3f3e11acafea92b84d6bb0c13633"> 4609 4610 #### Example Output 4611 4612 ~~~~ 4613 mask quad set 4614 ~~~~ 4615 4616 </fiddle-embed></div> 4617 4618 ### See Also 4619 4620 <a href='#SkPath_getSegmentMasks'>getSegmentMasks</a> <a href='#SkPath_Verb'>Verb</a> 4621 4622 <a name='SkPath_contains'></a> 4623 4624 --- 4625 4626 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4627 bool contains(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y)const 4628 </pre> 4629 4630 Returns true if the <a href='SkPoint_Reference#Point'>point</a> (<a href='#SkPath_contains_x'>x</a>, <a href='#SkPath_contains_y'>y</a>) is contained by <a href='SkPath_Reference#Path'>Path</a>, taking into 4631 account <a href='#SkPath_FillType'>FillType</a>. 4632 4633 | <a href='#SkPath_FillType'>FillType</a> | <a href='#SkPath_contains'>contains()</a> returns true if <a href='SkPoint_Reference#Point'>Point</a> is enclosed by | 4634 | --- | --- | 4635 | <a href='#SkPath_kWinding_FillType'>kWinding_FillType</a> | a non-zero sum of <a href='SkPath_Overview#Contour'>Contour</a> <a href='SkPath_Reference#Direction'>Directions</a>. | 4636 | <a href='#SkPath_kEvenOdd_FillType'>kEvenOdd_FillType</a> | an odd number of <a href='SkPath_Overview#Contour'>Contours</a>. | 4637 | <a href='#SkPath_kInverseWinding_FillType'>kInverseWinding_FillType</a> | a zero sum of <a href='SkPath_Overview#Contour'>Contour</a> <a href='SkPath_Reference#Direction'>Directions</a>. | 4638 | <a href='#SkPath_kInverseEvenOdd_FillType'>kInverseEvenOdd_FillType</a> | and even number of <a href='SkPath_Overview#Contour'>Contours</a>. | 4639 4640 ### Parameters 4641 4642 <table> <tr> <td><a name='SkPath_contains_x'><code><strong>x</strong></code></a></td> 4643 <td>x-axis value of containment test</td> 4644 </tr> 4645 <tr> <td><a name='SkPath_contains_y'><code><strong>y</strong></code></a></td> 4646 <td>y-axis value of containment test</td> 4647 </tr> 4648 </table> 4649 4650 ### Return Value 4651 4652 true if <a href='SkPoint_Reference#Point'>Point</a> is in <a href='SkPath_Reference#Path'>Path</a> 4653 4654 ### Example 4655 4656 <div><fiddle-embed name="c0216b3f7ebd80b9589ae5728f08fc80"></fiddle-embed></div> 4657 4658 ### See Also 4659 4660 <a href='#SkPath_conservativelyContainsRect'>conservativelyContainsRect</a> <a href='#Path_Fill_Type'>Fill_Type</a> <a href='undocumented#Op'>Op</a> 4661 4662 <a name='SkPath_dump'></a> 4663 4664 --- 4665 4666 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4667 void <a href='#SkPath_dump'>dump</a>(<a href='SkWStream_Reference#SkWStream'>SkWStream</a>* <a href='SkStream_Reference#Stream'>stream</a>, bool forceClose, bool dumpAsHex)const 4668 </pre> 4669 4670 Writes <a href='undocumented#Text'>text</a> representation of <a href='SkPath_Reference#SkPath'>SkPath</a> to <a href='#SkPath_dump_stream'>stream</a>. If <a href='#SkPath_dump_stream'>stream</a> is nullptr, writes to 4671 standard output. Set <a href='#SkPath_dump_forceClose'>forceClose</a> to true to get edges used to fill <a href='SkPath_Reference#SkPath'>SkPath</a>. 4672 Set <a href='#SkPath_dump_dumpAsHex'>dumpAsHex</a> true to generate exact binary representations 4673 of floating <a href='SkPoint_Reference#Point'>point</a> numbers used in <a href='SkPath_Reference#Point_Array'>SkPoint array</a> and <a href='SkPath_Reference#Conic_Weight'>conic weights</a>. 4674 4675 ### Parameters 4676 4677 <table> <tr> <td><a name='SkPath_dump_stream'><code><strong>stream</strong></code></a></td> 4678 <td>writable <a href='SkWStream_Reference#SkWStream'>SkWStream</a> receiving <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='undocumented#Text'>text</a> representation; may be nullptr</td> 4679 </tr> 4680 <tr> <td><a name='SkPath_dump_forceClose'><code><strong>forceClose</strong></code></a></td> 4681 <td>true if missing <a href='#SkPath_kClose_Verb'>kClose_Verb</a> is output</td> 4682 </tr> 4683 <tr> <td><a name='SkPath_dump_dumpAsHex'><code><strong>dumpAsHex</strong></code></a></td> 4684 <td>true if <a href='undocumented#SkScalar'>SkScalar</a> values are written as hexadecimal</td> 4685 </tr> 4686 </table> 4687 4688 ### Example 4689 4690 <div><fiddle-embed name="8036d764452a62f9953af50846f0f3c0"> 4691 4692 #### Example Output 4693 4694 ~~~~ 4695 path.setFillType(SkPath::kWinding_FillType); 4696 path.moveTo(0, 0); 4697 path.quadTo(20, 30, 40, 50); 4698 path.setFillType(SkPath::kWinding_FillType); 4699 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4700 path.quadTo(SkBits2Float(0x41a00000), SkBits2Float(0x41f00000), SkBits2Float(0x42200000), SkBits2Float(0x42480000)); // 20, 30, 40, 50 4701 path.setFillType(SkPath::kWinding_FillType); 4702 path.moveTo(0, 0); 4703 path.quadTo(20, 30, 40, 50); 4704 path.lineTo(0, 0); 4705 path.close(); 4706 path.setFillType(SkPath::kWinding_FillType); 4707 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4708 path.quadTo(SkBits2Float(0x41a00000), SkBits2Float(0x41f00000), SkBits2Float(0x42200000), SkBits2Float(0x42480000)); // 20, 30, 40, 50 4709 path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4710 path.close(); 4711 ~~~~ 4712 4713 </fiddle-embed></div> 4714 4715 ### See Also 4716 4717 <a href='#SkPath_dumpHex'>dumpHex</a> <a href='SkRect_Reference#SkRect'>SkRect</a>::<a href='#SkRect_dump'>dump()</a> <a href='SkRRect_Reference#SkRRect'>SkRRect</a>::<a href='#SkRRect_dump'>dump()</a> <a href='undocumented#SkPathMeasure'>SkPathMeasure</a>::<a href='#SkPathMeasure_dump'>dump()</a> 4718 4719 <a name='SkPath_dump_2'></a> 4720 4721 --- 4722 4723 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4724 void <a href='#SkPath_dump'>dump()</a>const 4725 </pre> 4726 4727 Writes <a href='undocumented#Text'>text</a> representation of <a href='SkPath_Reference#SkPath'>SkPath</a> to standard output. The representation may be 4728 directly compiled as C++ code. Floating <a href='SkPoint_Reference#Point'>point</a> values are written 4729 with limited precision; it may not be possible to reconstruct original <a href='SkPath_Reference#SkPath'>SkPath</a> 4730 from output. 4731 4732 ### Example 4733 4734 <div><fiddle-embed name="92e0032f85181795d1f8b5a2c8e4e4b7"> 4735 4736 #### Example Output 4737 4738 ~~~~ 4739 path.setFillType(SkPath::kWinding_FillType); 4740 path.moveTo(0, 0); 4741 path.lineTo(0.857143f, 0.666667f); 4742 path is not equal to copy 4743 ~~~~ 4744 4745 </fiddle-embed></div> 4746 4747 ### See Also 4748 4749 <a href='#SkPath_dumpHex'>dumpHex</a> <a href='SkRect_Reference#SkRect'>SkRect</a>::<a href='#SkRect_dump'>dump()</a> <a href='SkRRect_Reference#SkRRect'>SkRRect</a>::<a href='#SkRRect_dump'>dump()</a> <a href='undocumented#SkPathMeasure'>SkPathMeasure</a>::<a href='#SkPathMeasure_dump'>dump()</a> <a href='#SkPath_writeToMemory'>writeToMemory</a> 4750 4751 <a name='SkPath_dumpHex'></a> 4752 4753 --- 4754 4755 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4756 void <a href='#SkPath_dumpHex'>dumpHex</a>()const 4757 </pre> 4758 4759 Writes <a href='undocumented#Text'>text</a> representation of <a href='SkPath_Reference#Path'>Path</a> to standard output. The representation may be 4760 directly compiled as C++ code. Floating <a href='SkPoint_Reference#Point'>point</a> values are written 4761 in hexadecimal to preserve their exact bit pattern. The output reconstructs the 4762 original <a href='SkPath_Reference#Path'>Path</a>. 4763 4764 Use instead of <a href='#SkPath_dump'>dump()</a> when submitting 4765 <a href='https://bug.skia.org'>bug reports against Skia</a></a> . 4766 4767 ### Example 4768 4769 <div><fiddle-embed name="72a92fe058e8b3be6c8a30fad7fd1266"> 4770 4771 #### Example Output 4772 4773 ~~~~ 4774 path.setFillType(SkPath::kWinding_FillType); 4775 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4776 path.lineTo(SkBits2Float(0x3f5b6db7), SkBits2Float(0x3f2aaaab)); // 0.857143f, 0.666667f 4777 path is equal to copy 4778 ~~~~ 4779 4780 </fiddle-embed></div> 4781 4782 ### See Also 4783 4784 <a href='#SkPath_dump'>dump</a> <a href='SkRect_Reference#SkRect'>SkRect</a>::<a href='#SkRect_dumpHex'>dumpHex</a> <a href='SkRRect_Reference#SkRRect'>SkRRect</a>::<a href='#SkRRect_dumpHex'>dumpHex</a> <a href='#SkPath_writeToMemory'>writeToMemory</a> 4785 4786 <a name='SkPath_writeToMemory'></a> 4787 4788 --- 4789 4790 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4791 size_t <a href='#SkPath_writeToMemory'>writeToMemory</a>(void* buffer)const 4792 </pre> 4793 4794 Writes <a href='SkPath_Reference#SkPath'>SkPath</a> to <a href='#SkPath_writeToMemory_buffer'>buffer</a>, returning the number of bytes written. 4795 Pass nullptr to obtain the storage <a href='undocumented#Size'>size</a>. 4796 4797 Writes <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a>, <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, <a href='#Conic_Weight'>conic weight</a>, and 4798 additionally writes computed information like <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> and bounds. 4799 4800 Use only be used in concert with <a href='#SkPath_readFromMemory'>readFromMemory</a>(); 4801 the format used for <a href='SkPath_Reference#SkPath'>SkPath</a> in memory is not guaranteed. 4802 4803 ### Parameters 4804 4805 <table> <tr> <td><a name='SkPath_writeToMemory_buffer'><code><strong>buffer</strong></code></a></td> 4806 <td>storage for <a href='SkPath_Reference#SkPath'>SkPath</a>; may be nullptr</td> 4807 </tr> 4808 </table> 4809 4810 ### Return Value 4811 4812 <a href='undocumented#Size'>size</a> of storage required for <a href='SkPath_Reference#SkPath'>SkPath</a>; always a multiple of 4 4813 4814 ### Example 4815 4816 <div><fiddle-embed name="e5f16eda6a1c2d759556285f72598445"> 4817 4818 #### Example Output 4819 4820 ~~~~ 4821 path is equal to copy 4822 ~~~~ 4823 4824 </fiddle-embed></div> 4825 4826 ### See Also 4827 4828 <a href='#SkPath_serialize'>serialize</a> <a href='#SkPath_readFromMemory'>readFromMemory</a> <a href='#SkPath_dump'>dump</a> <a href='#SkPath_dumpHex'>dumpHex</a> 4829 4830 <a name='SkPath_serialize'></a> 4831 4832 --- 4833 4834 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4835 <a href='undocumented#sk_sp'>sk_sp</a><<a href='undocumented#SkData'>SkData</a>> <a href='#SkPath_serialize'>serialize()</a>const 4836 </pre> 4837 4838 Writes <a href='SkPath_Reference#SkPath'>SkPath</a> to buffer, returning the buffer written to, wrapped in <a href='undocumented#SkData'>SkData</a>. 4839 4840 <a href='#SkPath_serialize'>serialize()</a> writes <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a>, verb array, <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array, <a href='SkPath_Reference#Conic'>conic</a> weight, and 4841 additionally writes computed information like <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> and bounds. 4842 4843 <a href='#SkPath_serialize'>serialize()</a> should only be used in concert with <a href='#SkPath_readFromMemory'>readFromMemory</a>(). 4844 The format used for <a href='SkPath_Reference#SkPath'>SkPath</a> in memory is not guaranteed. 4845 4846 ### Return Value 4847 4848 <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='undocumented#Data'>data</a> wrapped in <a href='undocumented#SkData'>SkData</a> buffer 4849 4850 ### Example 4851 4852 <div><fiddle-embed name="2c6aff73608cd198659db6d1eeaaae4f"> 4853 4854 #### Example Output 4855 4856 ~~~~ 4857 path is equal to copy 4858 ~~~~ 4859 4860 </fiddle-embed></div> 4861 4862 ### See Also 4863 4864 <a href='#SkPath_writeToMemory'>writeToMemory</a> <a href='#SkPath_readFromMemory'>readFromMemory</a> <a href='#SkPath_dump'>dump</a> <a href='#SkPath_dumpHex'>dumpHex</a> 4865 4866 <a name='SkPath_readFromMemory'></a> 4867 4868 --- 4869 4870 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4871 size_t <a href='#SkPath_readFromMemory'>readFromMemory</a>(const void* buffer, size_t length) 4872 </pre> 4873 4874 Initializes <a href='SkPath_Reference#SkPath'>SkPath</a> from <a href='#SkPath_readFromMemory_buffer'>buffer</a> of <a href='undocumented#Size'>size</a> <a href='#SkPath_readFromMemory_length'>length</a>. Returns zero if the <a href='#SkPath_readFromMemory_buffer'>buffer</a> is 4875 <a href='undocumented#Data'>data</a> is inconsistent, or the <a href='#SkPath_readFromMemory_length'>length</a> is too small. 4876 4877 Reads <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a>, <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, <a href='#Conic_Weight'>conic weight</a>, and 4878 additionally reads computed information like <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Convexity'>Convexity</a> and bounds. 4879 4880 Used only in concert with <a href='#SkPath_writeToMemory'>writeToMemory</a>(); 4881 the format used for <a href='SkPath_Reference#SkPath'>SkPath</a> in memory is not guaranteed. 4882 4883 ### Parameters 4884 4885 <table> <tr> <td><a name='SkPath_readFromMemory_buffer'><code><strong>buffer</strong></code></a></td> 4886 <td>storage for <a href='SkPath_Reference#SkPath'>SkPath</a></td> 4887 </tr> 4888 <tr> <td><a name='SkPath_readFromMemory_length'><code><strong>length</strong></code></a></td> 4889 <td><a href='#SkPath_readFromMemory_buffer'>buffer</a> <a href='undocumented#Size'>size</a> in bytes; must be multiple of 4</td> 4890 </tr> 4891 </table> 4892 4893 ### Return Value 4894 4895 number of bytes read, or zero on failure 4896 4897 ### Example 4898 4899 <div><fiddle-embed name="9c6edd836c573a0fd232d2b8aa11a678"> 4900 4901 #### Example Output 4902 4903 ~~~~ 4904 length = 32; returned by readFromMemory = 0 4905 length = 40; returned by readFromMemory = 36 4906 ~~~~ 4907 4908 </fiddle-embed></div> 4909 4910 ### See Also 4911 4912 <a href='#SkPath_writeToMemory'>writeToMemory</a> 4913 4914 <a name='Generation_ID'></a> 4915 4916 <a href='#Path_Generation_ID'>Generation_ID</a> provides a quick way to check if <a href='#Path_Verb_Array'>Verb_Array</a>, <a href='#Path_Point_Array'>Point_Array</a>, or 4917 <a href='#Path_Conic_Weight'>Conic_Weight</a> has changed. <a href='#Path_Generation_ID'>Generation_ID</a> is not a hash; identical <a href='SkPath_Reference#Path'>Paths</a> will 4918 not necessarily have matching <a href='#Path_Generation_ID'>Generation_IDs</a>. 4919 4920 Empty <a href='SkPath_Reference#Path'>Paths</a> have a <a href='#Path_Generation_ID'>Generation_ID</a> of one. 4921 4922 <a name='SkPath_getGenerationID'></a> 4923 4924 --- 4925 4926 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4927 uint32_t <a href='#SkPath_getGenerationID'>getGenerationID</a>()const 4928 </pre> 4929 4930 (See Skia bug 1762.) 4931 Returns a non-zero, globally unique value. A different value is returned 4932 if verb array, <a href='SkPoint_Reference#SkPoint'>SkPoint</a> array, or <a href='SkPath_Reference#Conic'>conic</a> weight changes. 4933 4934 Setting <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a> does not change generation identifier. 4935 4936 Each time the <a href='SkPath_Reference#Path'>path</a> is modified, a different generation identifier will be returned. 4937 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_FillType'>FillType</a> does affect generation identifier on Android framework. 4938 4939 ### Return Value 4940 4941 non-zero, globally unique value 4942 4943 ### Example 4944 4945 <div><fiddle-embed name="a0f166715d6479f91258d854e63e586d"> 4946 4947 #### Example Output 4948 4949 ~~~~ 4950 empty genID = 1 4951 1st lineTo genID = 2 4952 empty genID = 1 4953 2nd lineTo genID = 3 4954 ~~~~ 4955 4956 </fiddle-embed></div> 4957 4958 ### See Also 4959 4960 <a href='#SkPath_equal_operator'>operator==</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& a, const <a href='SkPath_Reference#SkPath'>SkPath</a>& b) 4961 4962 <a name='SkPath_isValid'></a> 4963 4964 --- 4965 4966 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 4967 bool <a href='#SkPath_isValid'>isValid</a>()const 4968 </pre> 4969 4970 Returns if <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='undocumented#Data'>data</a> is consistent. Corrupt <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='undocumented#Data'>data</a> is detected if 4971 internal values are out of range or internal storage does not match 4972 array dimensions. 4973 4974 ### Return Value 4975 4976 true if <a href='SkPath_Reference#SkPath'>SkPath</a> <a href='undocumented#Data'>data</a> is consistent 4977 4978 <a name='SkPath_Iter'></a> 4979 4980 --- 4981 4982 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4983 class <a href='#SkPath_Iter'>Iter</a> { 4984 4985 <a href='#SkPath_Iter_Iter'>Iter()</a>; 4986 <a href='#SkPath_Iter_Iter'>Iter</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>, bool forceClose); 4987 void <a href='#SkPath_Iter_setPath'>setPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>, bool forceClose); 4988 <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_Iter_next'>next</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[4], bool doConsumeDegenerates = true, bool exact = false); 4989 <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_Iter_conicWeight'>conicWeight</a>() const; 4990 bool <a href='#SkPath_Iter_isCloseLine'>isCloseLine</a>() const; 4991 bool <a href='#SkPath_Iter_isClosedContour'>isClosedContour</a>() const; 4992 }; 4993 4994 </pre> 4995 4996 Iterates through <a href='#Path_Verb_Array'>Verb_Array</a>, and associated <a href='#Path_Point_Array'>Point_Array</a> and <a href='#Path_Conic_Weight'>Conic_Weight</a>. 4997 Provides options to treat open <a href='SkPath_Overview#Contour'>Contours</a> as closed, and to ignore 4998 degenerate <a href='undocumented#Data'>data</a>. 4999 5000 ### Example 5001 5002 <div><fiddle-embed name="2f53df9201769ab7e7c0e164a1334309"><div>Ignoring the actual <a href='SkPath_Reference#Verb'>Verbs</a> and replacing them with <a href='SkPath_Reference#Quad'>Quads</a> rounds the 5003 <a href='SkPath_Reference#Path'>path</a> of the <a href='undocumented#Glyph'>glyph</a>. 5004 </div></fiddle-embed></div> 5005 5006 ### See Also 5007 5008 <a href='#SkPath_RawIter'>RawIter</a> 5009 5010 <a name='SkPath_Iter_Iter'></a> 5011 5012 --- 5013 5014 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5015 <a href='#SkPath_Iter_Iter'>Iter()</a> 5016 </pre> 5017 5018 Initializes <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> with an empty <a href='SkPath_Reference#SkPath'>SkPath</a>. <a href='#SkPath_Iter_next'>next()</a> on <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> returns 5019 <a href='#SkPath_kDone_Verb'>kDone_Verb</a>. 5020 Call <a href='#SkPath_Iter_setPath'>setPath</a> to initialize <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> at a later time. 5021 5022 ### Return Value 5023 5024 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> of empty <a href='SkPath_Reference#SkPath'>SkPath</a> 5025 5026 ### Example 5027 5028 <div><fiddle-embed name="01648775cb9b354b2f1836dad82a25ab"> 5029 5030 #### Example Output 5031 5032 ~~~~ 5033 iter is done 5034 iter is done 5035 ~~~~ 5036 5037 </fiddle-embed></div> 5038 5039 ### See Also 5040 5041 <a href='#SkPath_Iter_setPath'>setPath</a> 5042 5043 <a name='SkPath_Iter_const_SkPath'></a> 5044 5045 --- 5046 5047 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5048 <a href='#SkPath_Iter'>Iter</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>, bool forceClose) 5049 </pre> 5050 5051 Sets <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> to return elements of <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='#Conic_Weight'>conic weight</a> in 5052 <a href='#SkPath_Iter_const_SkPath_path'>path</a>. If <a href='#SkPath_Iter_const_SkPath_forceClose'>forceClose</a> is true, <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> will add <a href='#SkPath_kLine_Verb'>kLine_Verb</a> and <a href='#SkPath_kClose_Verb'>kClose_Verb</a> after each 5053 open <a href='SkPath_Overview#Contour'>contour</a>. <a href='#SkPath_Iter_const_SkPath_path'>path</a> is not altered. 5054 5055 ### Parameters 5056 5057 <table> <tr> <td><a name='SkPath_Iter_const_SkPath_path'><code><strong>path</strong></code></a></td> 5058 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to iterate</td> 5059 </tr> 5060 <tr> <td><a name='SkPath_Iter_const_SkPath_forceClose'><code><strong>forceClose</strong></code></a></td> 5061 <td>true if open <a href='SkPath_Overview#Contour'>contours</a> generate <a href='#SkPath_kClose_Verb'>kClose_Verb</a></td> 5062 </tr> 5063 </table> 5064 5065 ### Return Value 5066 5067 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> of <a href='#SkPath_Iter_const_SkPath_path'>path</a> 5068 5069 ### Example 5070 5071 <div><fiddle-embed name="13044dbf68885c0f15322c0633b633a3"> 5072 5073 #### Example Output 5074 5075 ~~~~ 5076 open: 5077 kMove_Verb {0, 0}, 5078 kQuad_Verb {0, 0}, {10, 20}, {30, 40}, 5079 kDone_Verb 5080 closed: 5081 kMove_Verb {0, 0}, 5082 kQuad_Verb {0, 0}, {10, 20}, {30, 40}, 5083 kLine_Verb {30, 40}, {0, 0}, 5084 kClose_Verb {0, 0}, 5085 kDone_Verb 5086 ~~~~ 5087 5088 </fiddle-embed></div> 5089 5090 ### See Also 5091 5092 <a href='#SkPath_Iter_setPath'>setPath</a> 5093 5094 <a name='SkPath_Iter_setPath'></a> 5095 5096 --- 5097 5098 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5099 void <a href='#SkPath_Iter_setPath'>setPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>, bool forceClose) 5100 </pre> 5101 5102 Sets <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> to return elements of <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='#Conic_Weight'>conic weight</a> in 5103 <a href='#SkPath_Iter_setPath_path'>path</a>. If <a href='#SkPath_Iter_setPath_forceClose'>forceClose</a> is true, <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> will add <a href='#SkPath_kLine_Verb'>kLine_Verb</a> and <a href='#SkPath_kClose_Verb'>kClose_Verb</a> after each 5104 open <a href='SkPath_Overview#Contour'>contour</a>. <a href='#SkPath_Iter_setPath_path'>path</a> is not altered. 5105 5106 ### Parameters 5107 5108 <table> <tr> <td><a name='SkPath_Iter_setPath_path'><code><strong>path</strong></code></a></td> 5109 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to iterate</td> 5110 </tr> 5111 <tr> <td><a name='SkPath_Iter_setPath_forceClose'><code><strong>forceClose</strong></code></a></td> 5112 <td>true if open <a href='SkPath_Overview#Contour'>contours</a> generate <a href='#SkPath_kClose_Verb'>kClose_Verb</a></td> 5113 </tr> 5114 </table> 5115 5116 ### Example 5117 5118 <div><fiddle-embed name="6c9688008cea8937ad5cc188b38ecf16"> 5119 5120 #### Example Output 5121 5122 ~~~~ 5123 quad open: 5124 kMove_Verb {0, 0}, 5125 kQuad_Verb {0, 0}, {10, 20}, {30, 40}, 5126 kDone_Verb 5127 conic closed: 5128 kMove_Verb {0, 0}, 5129 kConic_Verb {0, 0}, {1, 2}, {3, 4}, weight = 0.5 5130 kLine_Verb {3, 4}, {0, 0}, 5131 kClose_Verb {0, 0}, 5132 kDone_Verb 5133 ~~~~ 5134 5135 </fiddle-embed></div> 5136 5137 ### See Also 5138 5139 <a href='#SkPath_Iter_const_SkPath'>Iter(const SkPath& path, bool forceClose)</a> 5140 5141 <a name='SkPath_Iter_next'></a> 5142 5143 --- 5144 5145 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5146 <a href='#SkPath_Verb'>Verb</a> next(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[4], bool doConsumeDegenerates = true, bool exact = false) 5147 </pre> 5148 5149 Returns next <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> in <a href='#Verb_Array'>verb array</a>, and advances <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a>. 5150 When <a href='#Verb_Array'>verb array</a> is exhausted, returns <a href='#SkPath_kDone_Verb'>kDone_Verb</a>. 5151 5152 Zero to four <a href='SkPoint_Reference#SkPoint'>SkPoint</a> are stored in <a href='#SkPath_Iter_next_pts'>pts</a>, depending on the returned <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a>. 5153 5154 If <a href='#SkPath_Iter_next_doConsumeDegenerates'>doConsumeDegenerates</a> is true, skip consecutive <a href='#SkPath_kMove_Verb'>kMove_Verb</a> entries, returning 5155 only the last in the series; and skip very small <a href='undocumented#Line'>lines</a>, <a href='SkPath_Reference#Quad'>quads</a>, and <a href='SkPath_Reference#Conic'>conics</a>; and 5156 skip <a href='#SkPath_kClose_Verb'>kClose_Verb</a> following <a href='#SkPath_kMove_Verb'>kMove_Verb</a>. 5157 if <a href='#SkPath_Iter_next_doConsumeDegenerates'>doConsumeDegenerates</a> is true and <a href='#SkPath_Iter_next_exact'>exact</a> is true, only skip <a href='undocumented#Line'>lines</a>, <a href='SkPath_Reference#Quad'>quads</a>, and 5158 <a href='SkPath_Reference#Conic'>conics</a> with zero lengths. 5159 5160 ### Parameters 5161 5162 <table> <tr> <td><a name='SkPath_Iter_next_pts'><code><strong>pts</strong></code></a></td> 5163 <td>storage for <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='undocumented#Data'>data</a> describing returned <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a></td> 5164 </tr> 5165 <tr> <td><a name='SkPath_Iter_next_doConsumeDegenerates'><code><strong>doConsumeDegenerates</strong></code></a></td> 5166 <td>if true, skip degenerate <a href='SkPath_Reference#Verb'>verbs</a></td> 5167 </tr> 5168 <tr> <td><a name='SkPath_Iter_next_exact'><code><strong>exact</strong></code></a></td> 5169 <td>skip zero length <a href='undocumented#Curve'>curves</a></td> 5170 </tr> 5171 </table> 5172 5173 ### Return Value 5174 5175 next <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> from <a href='#Verb_Array'>verb array</a> 5176 5177 ### Example 5178 5179 <div><fiddle-embed name="00ae8984856486bdb626d0ed6587855a"><div>skip degenerate skips the first in a <a href='#SkPath_kMove_Verb'>kMove_Verb</a> pair, the <a href='#SkPath_kMove_Verb'>kMove_Verb</a> 5180 followed by the <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, the zero length <a href='undocumented#Line'>Line</a> and the very small <a href='undocumented#Line'>Line</a>. 5181 5182 skip degenerate if <a href='#SkPath_Iter_next_exact'>exact</a> skips the same as skip degenerate, but shows 5183 the very small <a href='undocumented#Line'>Line</a>. 5184 5185 skip none shows all of the <a href='SkPath_Reference#Verb'>Verbs</a> and <a href='SkPoint_Reference#Point'>Points</a> in <a href='SkPath_Reference#Path'>Path</a>. 5186 </div> 5187 5188 #### Example Output 5189 5190 ~~~~ 5191 skip degenerate: 5192 kMove_Verb {20, 20}, 5193 kQuad_Verb {20, 20}, {10, 20}, {30, 40}, 5194 kDone_Verb 5195 skip degenerate if exact: 5196 kMove_Verb {20, 20}, 5197 kQuad_Verb {20, 20}, {10, 20}, {30, 40}, 5198 kMove_Verb {30, 30}, 5199 kLine_Verb {30, 30}, {30.00001, 30}, 5200 kDone_Verb 5201 skip none: 5202 kMove_Verb {10, 10}, 5203 kMove_Verb {20, 20}, 5204 kQuad_Verb {20, 20}, {10, 20}, {30, 40}, 5205 kMove_Verb {1, 1}, 5206 kClose_Verb {1, 1}, 5207 kMove_Verb {30, 30}, 5208 kLine_Verb {30, 30}, {30, 30}, 5209 kMove_Verb {30, 30}, 5210 kLine_Verb {30, 30}, {30.00001, 30}, 5211 kDone_Verb 5212 ~~~~ 5213 5214 </fiddle-embed></div> 5215 5216 ### See Also 5217 5218 <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_IsLineDegenerate'>IsLineDegenerate</a> <a href='#SkPath_IsCubicDegenerate'>IsCubicDegenerate</a> <a href='#SkPath_IsQuadDegenerate'>IsQuadDegenerate</a> 5219 5220 <a name='SkPath_Iter_conicWeight'></a> 5221 5222 --- 5223 5224 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5225 <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_Iter_conicWeight'>conicWeight</a>()const 5226 </pre> 5227 5228 Returns <a href='SkPath_Reference#Conic'>conic</a> weight if <a href='#SkPath_Iter_next'>next()</a> returned <a href='#SkPath_kConic_Verb'>kConic_Verb</a>. 5229 5230 If <a href='#SkPath_Iter_next'>next()</a> has not been called, or <a href='#SkPath_Iter_next'>next()</a> did not return <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, 5231 result is undefined. 5232 5233 ### Return Value 5234 5235 <a href='SkPath_Reference#Conic'>conic</a> weight for <a href='SkPath_Reference#Conic'>conic</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> returned by <a href='#SkPath_Iter_next'>next()</a> 5236 5237 ### Example 5238 5239 <div><fiddle-embed name="7cdea37741d50f0594c6244eb07fd175"> 5240 5241 #### Example Output 5242 5243 ~~~~ 5244 first verb is move 5245 next verb is conic 5246 conic points: {0,0}, {1,2}, {3,4} 5247 conic weight: 0.5 5248 ~~~~ 5249 5250 </fiddle-embed></div> 5251 5252 ### See Also 5253 5254 <a href='#Path_Conic_Weight'>Conic_Weight</a> 5255 5256 <a name='SkPath_Iter_isCloseLine'></a> 5257 5258 --- 5259 5260 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5261 bool <a href='#SkPath_Iter_isCloseLine'>isCloseLine</a>()const 5262 </pre> 5263 5264 Returns true if last <a href='#SkPath_kLine_Verb'>kLine_Verb</a> returned by <a href='#SkPath_Iter_next'>next()</a> was generated 5265 by <a href='#SkPath_kClose_Verb'>kClose_Verb</a>. When true, the end <a href='SkPoint_Reference#Point'>point</a> returned by <a href='#SkPath_Iter_next'>next()</a> is 5266 also the start <a href='SkPoint_Reference#Point'>point</a> of <a href='SkPath_Overview#Contour'>contour</a>. 5267 5268 If <a href='#SkPath_Iter_next'>next()</a> has not been called, or <a href='#SkPath_Iter_next'>next()</a> did not return <a href='#SkPath_kLine_Verb'>kLine_Verb</a>, 5269 result is undefined. 5270 5271 ### Return Value 5272 5273 true if last <a href='#SkPath_kLine_Verb'>kLine_Verb</a> was generated by <a href='#SkPath_kClose_Verb'>kClose_Verb</a> 5274 5275 ### Example 5276 5277 <div><fiddle-embed name="7000b501f49341629bfdd9f80e686103"> 5278 5279 #### Example Output 5280 5281 ~~~~ 5282 1st verb is move 5283 moveTo point: {6,7} 5284 2nd verb is conic 5285 3rd verb is line 5286 line points: {3,4}, {6,7} 5287 line generated by close 5288 4th verb is close 5289 ~~~~ 5290 5291 </fiddle-embed></div> 5292 5293 ### See Also 5294 5295 <a href='#SkPath_close'>close()</a> 5296 5297 <a name='SkPath_Iter_isClosedContour'></a> 5298 5299 --- 5300 5301 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5302 bool <a href='#SkPath_Iter_isClosedContour'>isClosedContour</a>()const 5303 </pre> 5304 5305 Returns true if subsequent calls to <a href='#SkPath_Iter_next'>next()</a> return <a href='#SkPath_kClose_Verb'>kClose_Verb</a> before returning 5306 <a href='#SkPath_kMove_Verb'>kMove_Verb</a>. if true, <a href='SkPath_Overview#Contour'>contour</a> <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> is processing may end with <a href='#SkPath_kClose_Verb'>kClose_Verb</a>, or 5307 <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> may have been initialized with force close set to true. 5308 5309 ### Return Value 5310 5311 true if <a href='SkPath_Overview#Contour'>contour</a> is closed 5312 5313 ### Example 5314 5315 <div><fiddle-embed name="b0d48a6e949db1cb545216ae9c3c3c70"> 5316 5317 #### Example Output 5318 5319 ~~~~ 5320 without close(), forceClose is false: isClosedContour returns false 5321 with close(), forceClose is false: isClosedContour returns true 5322 without close(), forceClose is true : isClosedContour returns true 5323 with close(), forceClose is true : isClosedContour returns true 5324 ~~~~ 5325 5326 </fiddle-embed></div> 5327 5328 ### See Also 5329 5330 <a href='#SkPath_Iter_const_SkPath'>Iter(const SkPath& path, bool forceClose)</a> 5331 5332 <a name='SkPath_RawIter'></a> 5333 5334 --- 5335 5336 <pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 5337 class <a href='#SkPath_RawIter'>RawIter</a> { 5338 5339 <a href='#SkPath_RawIter_RawIter'>RawIter()</a>; 5340 <a href='#SkPath_RawIter_RawIter'>RawIter</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>); 5341 void <a href='#SkPath_RawIter_setPath'>setPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>); 5342 <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_RawIter_next'>next</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[4]); 5343 <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_RawIter_peek'>peek()</a> const; 5344 <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_RawIter_conicWeight'>conicWeight</a>() const; 5345 }; 5346 5347 </pre> 5348 5349 Iterates through <a href='#Path_Verb_Array'>Verb_Array</a>, and associated <a href='#Path_Point_Array'>Point_Array</a> and <a href='#Path_Conic_Weight'>Conic_Weight</a>. 5350 <a href='#Path_Verb_Array'>Verb_Array</a>, <a href='#Path_Point_Array'>Point_Array</a>, and <a href='#Path_Conic_Weight'>Conic_Weight</a> are returned unaltered. 5351 5352 <a name='SkPath_RawIter_RawIter'></a> 5353 5354 --- 5355 5356 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5357 <a href='#SkPath_RawIter_RawIter'>RawIter()</a> 5358 </pre> 5359 5360 Initializes <a href='#SkPath_RawIter'>RawIter</a> with an empty <a href='SkPath_Reference#SkPath'>SkPath</a>. <a href='#SkPath_RawIter_next'>next()</a> on <a href='#SkPath_RawIter'>RawIter</a> returns <a href='#SkPath_kDone_Verb'>kDone_Verb</a>. 5361 Call <a href='#SkPath_RawIter_setPath'>setPath</a> to initialize <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> at a later time. 5362 5363 ### Return Value 5364 5365 <a href='#SkPath_RawIter'>RawIter</a> of empty <a href='SkPath_Reference#SkPath'>SkPath</a> 5366 5367 <a name='SkPath_RawIter_copy_const_SkPath'></a> 5368 5369 --- 5370 5371 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5372 <a href='#SkPath_RawIter'>RawIter</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) 5373 </pre> 5374 5375 Sets <a href='#SkPath_RawIter'>RawIter</a> to return elements of <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='#Conic_Weight'>conic weight</a> in <a href='#SkPath_RawIter_copy_const_SkPath_path'>path</a>. 5376 5377 ### Parameters 5378 5379 <table> <tr> <td><a name='SkPath_RawIter_copy_const_SkPath_path'><code><strong>path</strong></code></a></td> 5380 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to iterate</td> 5381 </tr> 5382 </table> 5383 5384 ### Return Value 5385 5386 <a href='#SkPath_RawIter'>RawIter</a> of <a href='#SkPath_RawIter_copy_const_SkPath_path'>path</a> 5387 5388 <a name='SkPath_RawIter_setPath'></a> 5389 5390 --- 5391 5392 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5393 void <a href='#SkPath_RawIter_setPath'>setPath</a>(const <a href='SkPath_Reference#SkPath'>SkPath</a>& <a href='SkPath_Reference#Path'>path</a>) 5394 </pre> 5395 5396 Sets <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Iter'>Iter</a> to return elements of <a href='#Verb_Array'>verb array</a>, <a href='SkPath_Reference#Point_Array'>SkPoint array</a>, and <a href='#Conic_Weight'>conic weight</a> in 5397 <a href='#SkPath_RawIter_setPath_path'>path</a>. 5398 5399 ### Parameters 5400 5401 <table> <tr> <td><a name='SkPath_RawIter_setPath_path'><code><strong>path</strong></code></a></td> 5402 <td><a href='SkPath_Reference#SkPath'>SkPath</a> to iterate</td> 5403 </tr> 5404 </table> 5405 5406 <a name='SkPath_RawIter_next'></a> 5407 5408 --- 5409 5410 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5411 <a href='#SkPath_Verb'>Verb</a> next(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[4]) 5412 </pre> 5413 5414 Returns next <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> in <a href='#Verb_Array'>verb array</a>, and advances <a href='#SkPath_RawIter'>RawIter</a>. 5415 When <a href='#Verb_Array'>verb array</a> is exhausted, returns <a href='#SkPath_kDone_Verb'>kDone_Verb</a>. 5416 Zero to four <a href='SkPoint_Reference#SkPoint'>SkPoint</a> are stored in <a href='#SkPath_RawIter_next_pts'>pts</a>, depending on the returned <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a>. 5417 5418 ### Parameters 5419 5420 <table> <tr> <td><a name='SkPath_RawIter_next_pts'><code><strong>pts</strong></code></a></td> 5421 <td>storage for <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='undocumented#Data'>data</a> describing returned <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a></td> 5422 </tr> 5423 </table> 5424 5425 ### Return Value 5426 5427 next <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> from <a href='#Verb_Array'>verb array</a> 5428 5429 ### Example 5430 5431 <div><fiddle-embed name="944a80c7ff8c04e1fecc4aec4a47ea60"> 5432 5433 #### Example Output 5434 5435 ~~~~ 5436 kMove_Verb {50, 60}, 5437 kQuad_Verb {50, 60}, {10, 20}, {30, 40}, 5438 kClose_Verb {50, 60}, 5439 kMove_Verb {50, 60}, 5440 kLine_Verb {50, 60}, {30, 30}, 5441 kConic_Verb {30, 30}, {1, 2}, {3, 4}, weight = 0.5 5442 kCubic_Verb {3, 4}, {-1, -2}, {-3, -4}, {-5, -6}, 5443 kDone_Verb 5444 ~~~~ 5445 5446 </fiddle-embed></div> 5447 5448 ### See Also 5449 5450 <a href='#SkPath_RawIter_peek'>peek()</a> 5451 5452 <a name='SkPath_RawIter_peek'></a> 5453 5454 --- 5455 5456 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5457 <a href='#SkPath_Verb'>Verb</a> <a href='#SkPath_RawIter_peek'>peek()</a>const 5458 </pre> 5459 5460 Returns next <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a>, but does not advance <a href='#SkPath_RawIter'>RawIter</a>. 5461 5462 ### Return Value 5463 5464 next <a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_Verb'>Verb</a> from verb array 5465 5466 ### Example 5467 5468 <div><fiddle-embed name="eb5fa5bea23059ce538e883502f828f5"> 5469 5470 #### Example Output 5471 5472 ~~~~ 5473 #Volatile 5474 peek Move == verb Move 5475 peek Quad == verb Quad 5476 peek Conic == verb Conic 5477 peek Cubic == verb Cubic 5478 peek Done == verb Done 5479 peek Done == verb Done 5480 ~~~~ 5481 5482 </fiddle-embed></div> 5483 5484 ### See Also 5485 5486 <a href='#SkPath_RawIter_next'>next</a> 5487 5488 <a name='SkPath_RawIter_conicWeight'></a> 5489 5490 --- 5491 5492 <pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0"> 5493 <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkPath_RawIter_conicWeight'>conicWeight</a>()const 5494 </pre> 5495 5496 Returns <a href='SkPath_Reference#Conic'>conic</a> weight if <a href='#SkPath_RawIter_next'>next()</a> returned <a href='#SkPath_kConic_Verb'>kConic_Verb</a>. 5497 5498 If <a href='#SkPath_RawIter_next'>next()</a> has not been called, or <a href='#SkPath_RawIter_next'>next()</a> did not return <a href='#SkPath_kConic_Verb'>kConic_Verb</a>, 5499 result is undefined. 5500 5501 ### Return Value 5502 5503 <a href='SkPath_Reference#Conic'>conic</a> weight for <a href='SkPath_Reference#Conic'>conic</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> returned by <a href='#SkPath_RawIter_next'>next()</a> 5504 5505 ### Example 5506 5507 <div><fiddle-embed name="69f360a0ba8f40c51ef4cd9f972c5893"> 5508 5509 #### Example Output 5510 5511 ~~~~ 5512 first verb is move 5513 next verb is conic 5514 conic points: {0,0}, {1,2}, {3,4} 5515 conic weight: 0.5 5516 ~~~~ 5517 5518 </fiddle-embed></div> 5519 5520 ### See Also 5521 5522 <a href='#Path_Conic_Weight'>Conic_Weight</a> 5523 5524