1SkPath Reference 2=== 3 4# <a name="Path"></a> Path 5 6## <a name="Overview"></a> Overview 7 8## <a name="Subtopics"></a> Subtopics 9 10| name | description | 11| --- | --- | 12| <a href="#Classes_and_Structs">Classes and Structs</a> | embedded struct and class members | 13| <a href="#Constants">Constants</a> | enum and enum class, const values | 14| <a href="#Constructors">Constructors</a> | functions that construct <a href="SkPath_Reference#SkPath">SkPath</a> | 15| <a href="#Member_Functions">Member Functions</a> | static functions and member methods | 16| <a href="#Operators">Operators</a> | operator overloading methods | 17| <a href="#Related_Functions">Related Functions</a> | similar methods grouped together | 18<a href="#Path">Path</a> contains <a href="#Line">Lines</a> and <a href="#Curve">Curves</a> which can be stroked or filled. <a href="#Contour">Contour</a> is 19composed of a series of connected <a href="#Line">Lines</a> and <a href="#Curve">Curves</a>. <a href="#Path">Path</a> may contain zero, 20one, or more <a href="#Contour">Contours</a>. 21Each <a href="undocumented#Line">Line</a> and <a href="undocumented#Curve">Curve</a> are described by <a href="#Verb">Verb</a>, <a href="#Point">Points</a>, and optional <a href="#Conic_Weight">Conic Weight</a>. 22 23Each pair of connected <a href="#Line">Lines</a> and <a href="#Curve">Curves</a> share common <a href="SkPoint_Reference#Point">Point</a>; for instance, <a href="#Path">Path</a> 24containing two connected <a href="#Line">Lines</a> are described the <a href="#Verb">Verb</a> sequence: 25<a href="#SkPath_kMove_Verb">SkPath::kMove Verb</a>, <a href="#SkPath_kLine_Verb">SkPath::kLine Verb</a>, <a href="#SkPath_kLine_Verb">SkPath::kLine Verb</a>; and a <a href="SkPoint_Reference#Point">Point</a> sequence 26with three entries, sharing 27the middle entry as the end of the first <a href="undocumented#Line">Line</a> and the start of the second <a href="undocumented#Line">Line</a>. 28 29<a href="#Path">Path</a> components <a href="#Arc">Arc</a>, <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> are composed of 30<a href="#Line">Lines</a> and <a href="#Curve">Curves</a> with as many <a href="#Verb">Verbs</a> and <a href="#Point">Points</a> required 31for an exact description. Once added to <a href="#Path">Path</a>, these components may lose their 32identity; although <a href="#Path">Path</a> can be inspected to determine if it describes a single 33<a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, <a href="undocumented#Round_Rect">Round Rect</a>, and so on. 34 35### Example 36 37<div><fiddle-embed name="93887af0c1dac49521972698cf04069c"><div><a href="#Path">Path</a> contains three <a href="#Contour">Contours</a>: <a href="undocumented#Line">Line</a>, <a href="undocumented#Circle">Circle</a>, and <a href="#Quad">Quad</a>. <a href="undocumented#Line">Line</a> is stroked but 38not filled. <a href="undocumented#Circle">Circle</a> is stroked and filled; <a href="undocumented#Circle">Circle</a> stroke forms a loop. <a href="#Quad">Quad</a> 39is stroked and filled, but since it is not closed, <a href="#Quad">Quad</a> does not stroke a loop.</div></fiddle-embed></div> 40 41<a href="#Path">Path</a> contains a <a href="#Fill_Type">Fill Type</a> which determines whether overlapping <a href="#Contour">Contours</a> 42form fills or holes. <a href="#Fill_Type">Fill Type</a> also determines whether area inside or outside 43<a href="#Line">Lines</a> and <a href="#Curve">Curves</a> is filled. 44 45### Example 46 47<div><fiddle-embed name="36a995442c081ee779ecab2962d36e69"><div><a href="#Path">Path</a> is drawn filled, then stroked, then stroked and filled.</div></fiddle-embed></div> 48 49<a href="#Path">Path</a> contents are never shared. Copying <a href="#Path">Path</a> by value effectively creates 50a new <a href="#Path">Path</a> independent of the original. Internally, the copy does not duplicate 51its contents until it is edited, to reduce memory use and improve performance. 52 53## <a name="Contour"></a> Contour 54 55<a href="#Contour">Contour</a> contains one or more <a href="#Verb">Verbs</a>, and as many <a href="#Point">Points</a> as 56are required to satisfy <a href="#Verb_Array">Verb Array</a>. First <a href="#Verb">Verb</a> in <a href="#Path">Path</a> is always 57<a href="#SkPath_kMove_Verb">SkPath::kMove Verb</a>; each <a href="#SkPath_kMove_Verb">SkPath::kMove Verb</a> that follows starts a new <a href="#Contour">Contour</a>. 58 59### Example 60 61<div><fiddle-embed name="0374f2dcd7effeb1dd435205a6c2de6f"><div>Each <a href="#SkPath_moveTo">SkPath::moveTo</a> starts a new <a href="#Contour">Contour</a>, and content after <a href="#SkPath_close">SkPath::close()</a> 62also starts a new <a href="#Contour">Contour</a>. Since <a href="#SkPath_conicTo">SkPath::conicTo</a> is not preceded by 63<a href="#SkPath_moveTo">SkPath::moveTo</a>, the first <a href="SkPoint_Reference#Point">Point</a> of the third <a href="#Contour">Contour</a> starts at the last <a href="SkPoint_Reference#Point">Point</a> 64of the second <a href="#Contour">Contour</a>.</div></fiddle-embed></div> 65 66If final <a href="#Verb">Verb</a> in <a href="#Contour">Contour</a> is <a href="#SkPath_kClose_Verb">SkPath::kClose Verb</a>, <a href="undocumented#Line">Line</a> connects <a href="#Last_Point">Last Point</a> in 67<a href="#Contour">Contour</a> with first <a href="SkPoint_Reference#Point">Point</a>. A closed <a href="#Contour">Contour</a>, stroked, draws 68<a href="#Stroke_Join">Paint Stroke Join</a> at <a href="#Last_Point">Last Point</a> and first <a href="SkPoint_Reference#Point">Point</a>. Without <a href="#SkPath_kClose_Verb">SkPath::kClose Verb</a> 69as final <a href="#Verb">Verb</a>, <a href="#Last_Point">Last Point</a> and first <a href="SkPoint_Reference#Point">Point</a> are not connected; <a href="#Contour">Contour</a> 70remains open. An open <a href="#Contour">Contour</a>, stroked, draws <a href="#Stroke_Cap">Paint Stroke Cap</a> at 71<a href="#Last_Point">Last Point</a> and first <a href="SkPoint_Reference#Point">Point</a>. 72 73### Example 74 75<div><fiddle-embed name="7a1f39b12d2cd8b7f5b1190879259cb2"><div><a href="#Path">Path</a> is drawn stroked, with an open <a href="#Contour">Contour</a> and a closed <a href="#Contour">Contour</a>.</div></fiddle-embed></div> 76 77## <a name="Zero_Length"></a> Zero Length 78 79<a href="#Contour">Contour</a> length is distance traveled from first <a href="SkPoint_Reference#Point">Point</a> to <a href="#Last_Point">Last Point</a>, 80plus, if <a href="#Contour">Contour</a> is closed, distance from <a href="#Last_Point">Last Point</a> to first <a href="SkPoint_Reference#Point">Point</a>. 81Even if <a href="#Contour">Contour</a> length is zero, stroked <a href="#Line">Lines</a> are drawn if <a href="#Stroke_Cap">Paint Stroke Cap</a> 82makes them visible. 83 84### Example 85 86<div><fiddle-embed name="62848df605af6258653d9e16b27d8f7f"></fiddle-embed></div> 87 88# <a name="SkPath"></a> Class SkPath 89<a href="#Path">Paths</a> contain geometry. <a href="#Path">Paths</a> may be empty, or contain one or more <a href="#Verb">Verbs</a> that 90outline a figure. <a href="#Path">Path</a> always starts with a move verb to a Cartesian_Coordinate, 91and may be followed by additional verbs that add lines or curves. 92Adding a close verb makes the geometry into a continuous loop, a closed contour. 93<a href="#Path">Paths</a> may contain any number of contours, each beginning with a move verb. 94 95<a href="#Path">Path</a> contours may contain only a move verb, or may also contain lines, 96<a href="#Quad">Quadratic Beziers</a>, <a href="#Conic">Conics</a>, and <a href="#Cubic">Cubic Beziers</a>. <a href="#Path">Path</a> contours may be open or 97closed. 98 99When used to draw a filled area, <a href="#Path">Path</a> describes whether the fill is inside or 100outside the geometry. <a href="#Path">Path</a> also describes the winding rule used to fill 101overlapping contours. 102 103Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and convexity. Call 104<a href="#SkPath_updateBoundsCache">SkPath::updateBoundsCache</a> to make <a href="#Path">Path</a> thread safe. 105 106## <a name="Related_Functions"></a> Related Functions 107 108| name | description | 109| --- | --- | 110| <a href="#Arc">Arc</a> | part of <a href="undocumented#Oval">Oval</a> or <a href="undocumented#Circle">Circle</a> | 111| <a href="#Conic">Conic</a> | conic section defined by three points and a weight | 112| <a href="#SkPath_Convexity">Convexity</a> | if <a href="#Path">Path</a> is concave or convex | 113| <a href="#Cubic">Cubic</a> | Bezier_Curve described by third-order polynomial | 114| <a href="#SkPath_Direction">Direction</a> | <a href="#Path">Path</a> contour orientation | 115| <a href="#Fill_Type">Fill Type</a> | <a href="#Path">Path</a> fill rule, normal and inverted | 116| <a href="#Generation_ID">Generation ID</a> | value reflecting contents change | 117| <a href="#Last_Point">Last Point</a> | final <a href="SkPoint_Reference#Point">Point</a> in <a href="#Contour">Contour</a> | 118| <a href="#Point_Array">Point Array</a> | end points and control points for lines and curves | 119| <a href="#Quad">Quad</a> | Bezier_Curve described by second-order polynomial | 120| <a href="#SkPath_Verb">Verb</a> | line and curve type | 121| <a href="#Verb_Array">Verb Array</a> | line and curve type for points | 122| Weight | strength of <a href="#Conic">Conic</a> control <a href="SkPoint_Reference#Point">Point</a> | 123 124## <a name="Constants"></a> Constants 125 126| name | description | 127| --- | --- | 128| <a href="#SkPath_AddPathMode">AddPathMode</a> | sets <a href="#SkPath_addPath">addPath</a> options | 129| <a href="#SkPath_ArcSize">ArcSize</a> | used by <a href="#SkPath_arcTo">arcTo</a> variation | 130| <a href="#SkPath_Convexity">Convexity</a> | returns if <a href="#Path">Path</a> is convex or concave | 131| <a href="#SkPath_Direction">Direction</a> | sets <a href="#Contour">Contour</a> clockwise or counterclockwise | 132| <a href="#SkPath_FillType">FillType</a> | sets winding rule and inverse fill | 133| <a href="#SkPath_SegmentMask">SegmentMask</a> | returns <a href="#SkPath_Verb">Verb</a> types in <a href="#Path">Path</a> | 134| <a href="#SkPath_Verb">Verb</a> | controls how <a href="#Path">Path</a> <a href="#Point">Points</a> are interpreted | 135 136## <a name="Classes_and_Structs"></a> Classes and Structs 137 138| name | description | 139| --- | --- | 140| <a href="#SkPath_Iter">Iter</a> | <a href="#Path">Path</a> data iterator | 141| <a href="#SkPath_RawIter">RawIter</a> | <a href="#Path">Path</a> raw data iterator | 142 143## <a name="Constructors"></a> Constructors 144 145| name | description | 146| --- | --- | 147| <a href="#SkPath_empty_constructor">SkPath()</a> | constructs with default values | 148| <a href="#SkPath_copy_const_SkPath">SkPath(const SkPath& path)</a> | makes a shallow copy | 149| <a href="#SkPath_destructor">~SkPath()</a> | decreases <a href="undocumented#Reference_Count">Reference Count</a> of owned objects | 150 151## <a name="Operators"></a> Operators 152 153| name | description | 154| --- | --- | 155| <a href="#SkPath_notequal_operator">operator!=(const SkPath& a, const SkPath& b)</a> | compares paths for inequality | 156| <a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> | makes a shallow copy | 157| <a href="#SkPath_equal_operator">operator==(const SkPath& a, const SkPath& b)</a> | compares paths for equality | 158 159## <a name="Member_Functions"></a> Member Functions 160 161| name | description | 162| --- | --- | 163| <a href="#SkPath_ConvertConicToQuads">ConvertConicToQuads</a> | approximates <a href="#Conic">Conic</a> with <a href="#Quad">Quad</a> array | 164| <a href="#SkPath_ConvertToNonInverseFillType">ConvertToNonInverseFillType</a> | returns <a href="#Fill_Type">Fill Type</a> representing inside geometry | 165| <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> | returns if <a href="#Cubic">Cubic</a> is very small | 166| <a href="#SkPath_IsInverseFillType">IsInverseFillType</a> | returns if <a href="#Fill_Type">Fill Type</a> represents outside geometry | 167| <a href="#SkPath_IsLineDegenerate">IsLineDegenerate</a> | returns if <a href="undocumented#Line">Line</a> is very small | 168| <a href="#SkPath_IsQuadDegenerate">IsQuadDegenerate</a> | returns if <a href="#Quad">Quad</a> is very small | 169| <a href="#SkPath_addArc">addArc</a> | adds one <a href="#Contour">Contour</a> containing <a href="#Arc">Arc</a> | 170| <a href="#SkPath_addCircle">addCircle</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Circle">Circle</a> | 171| <a href="#SkPath_addOval">addOval</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Oval">Oval</a> | 172| <a href="#SkPath_addPath">addPath</a> | adds contents of <a href="#Path">Path</a> | 173| <a href="#SkPath_addPoly">addPoly</a> | adds one <a href="#Contour">Contour</a> containing connected lines | 174| <a href="#SkPath_addRRect">addRRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a> | 175| <a href="#SkPath_addRect">addRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="SkRect_Reference#Rect">Rect</a> | 176| <a href="#SkPath_addRoundRect">addRoundRect</a> | adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a> with common corner radii | 177| <a href="#SkPath_arcTo">arcTo</a> | appends <a href="#Arc">Arc</a> | 178| <a href="#SkPath_close">close</a> | makes last <a href="#Contour">Contour</a> a loop | 179| <a href="#SkPath_computeTightBounds">computeTightBounds</a> | returns extent of geometry | 180| <a href="#SkPath_conicTo">conicTo</a> | appends <a href="#Conic">Conic</a> | 181| <a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> | returns true if <a href="SkRect_Reference#Rect">Rect</a> may be inside | 182| <a href="#SkPath_contains">contains</a> | returns if <a href="SkPoint_Reference#Point">Point</a> is in fill area | 183| <a href="#SkPath_countPoints">countPoints</a> | returns <a href="#Point_Array">Point Array</a> length | 184| <a href="#SkPath_countVerbs">countVerbs</a> | returns <a href="#Verb_Array">Verb Array</a> length | 185| <a href="#SkPath_cubicTo">cubicTo</a> | appends <a href="#Cubic">Cubic</a> | 186| <a href="#SkPath_dump_2">dump</a> | sends text representation using floats to standard output | 187| <a href="#SkPath_dumpHex">dumpHex</a> | sends text representation using hexadecimal to standard output | 188| <a href="#SkPath_getBounds">getBounds</a> | returns maximum and minimum of <a href="#Point_Array">Point Array</a> | 189| <a href="#SkPath_getConvexity">getConvexity</a> | returns geometry convexity, computing if necessary | 190| <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> | returns geometry convexity if known | 191| <a href="#SkPath_getFillType">getFillType</a> | returns <a href="#Fill_Type">Fill Type</a>: winding, even-odd, inverse | 192| <a href="#SkPath_getGenerationID">getGenerationID</a> | returns unique ID | 193| <a href="#SkPath_getLastPt">getLastPt</a> | returns <a href="#Last_Point">Last Point</a> | 194| <a href="#SkPath_getPoint">getPoint</a> | returns entry from <a href="#Point_Array">Point Array</a> | 195| <a href="#SkPath_getPoints">getPoints</a> | returns <a href="#Point_Array">Point Array</a> | 196| <a href="#SkPath_getSegmentMasks">getSegmentMasks</a> | returns types in <a href="#Verb_Array">Verb Array</a> | 197| <a href="#SkPath_getVerbs">getVerbs</a> | returns <a href="#Verb_Array">Verb Array</a> | 198| <a href="#SkPath_incReserve">incReserve</a> | reserves space for additional data | 199| <a href="#SkPath_interpolate">interpolate</a> | interpolates between <a href="#Path">Path</a> pair | 200| <a href="#SkPath_isConvex">isConvex</a> | returns if geometry is convex | 201| <a href="#SkPath_isEmpty">isEmpty</a> | returns if verb count is zero | 202| <a href="#SkPath_isFinite">isFinite</a> | returns if all <a href="SkPoint_Reference#Point">Point</a> values are finite | 203| <a href="#SkPath_isInterpolatable">isInterpolatable</a> | returns if pair contains equal counts of <a href="#Verb_Array">Verb Array</a> and <a href="#Weight">Weights</a> | 204| <a href="#SkPath_isInverseFillType">isInverseFillType</a> | returns if <a href="#Fill_Type">Fill Type</a> fills outside geometry | 205| <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> | returns if final <a href="#Contour">Contour</a> forms a loop | 206| <a href="#SkPath_isLine">isLine</a> | returns if describes <a href="undocumented#Line">Line</a> | 207| <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> | returns if describes <a href="SkRect_Reference#Rect">Rect</a> pair, one inside the other | 208| <a href="#SkPath_isOval">isOval</a> | returns if describes <a href="undocumented#Oval">Oval</a> | 209| <a href="#SkPath_isRRect">isRRect</a> | returns if describes <a href="undocumented#Round_Rect">Round Rect</a> | 210| <a href="#SkPath_isRect">isRect</a> | returns if describes <a href="SkRect_Reference#Rect">Rect</a> | 211| <a href="#SkPath_isValid">isValid</a> | returns if data is internally consistent | 212| <a href="#SkPath_isVolatile">isVolatile</a> | returns if <a href="undocumented#Device">Device</a> should not cache | 213| <a href="#SkPath_lineTo">lineTo</a> | appends <a href="undocumented#Line">Line</a> | 214| <a href="#SkPath_moveTo">moveTo</a> | starts <a href="#Contour">Contour</a> | 215| <a href="#SkPath_offset">offset</a> | translates <a href="#Point_Array">Point Array</a> | 216| <a href="#SkPath_pathRefIsValid">pathRefIsValid</a> | to be deprecated | 217| <a href="#SkPath_quadTo">quadTo</a> | appends <a href="#Quad">Quad</a> | 218| <a href="#SkPath_rArcTo">rArcTo</a> | appends <a href="#Arc">Arc</a> relative to <a href="#Last_Point">Last Point</a> | 219| <a href="#SkPath_rConicTo">rConicTo</a> | appends <a href="#Conic">Conic</a> relative to <a href="#Last_Point">Last Point</a> | 220| <a href="#SkPath_rCubicTo">rCubicTo</a> | appends <a href="#Cubic">Cubic</a> relative to <a href="#Last_Point">Last Point</a> | 221| <a href="#SkPath_rLineTo">rLineTo</a> | appends <a href="undocumented#Line">Line</a> relative to <a href="#Last_Point">Last Point</a> | 222| <a href="#SkPath_rMoveTo">rMoveTo</a> | starts <a href="#Contour">Contour</a> relative to <a href="#Last_Point">Last Point</a> | 223| <a href="#SkPath_rQuadTo">rQuadTo</a> | appends <a href="#Quad">Quad</a> relative to <a href="#Last_Point">Last Point</a> | 224| <a href="#SkPath_readFromMemory">readFromMemory</a> | Initializes from buffer | 225| <a href="#SkPath_reset">reset</a> | removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a>; frees memory | 226| <a href="#SkPath_reverseAddPath">reverseAddPath</a> | adds contents of <a href="#Path">Path</a> back to front | 227| <a href="#SkPath_rewind">rewind</a> | removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a>, keeping memory | 228| <a href="#SkPath_serialize">serialize</a> | copies data to buffer | 229| <a href="#SkPath_setConvexity">setConvexity</a> | sets if geometry is convex to avoid future computation | 230| <a href="#SkPath_setFillType">setFillType</a> | sets <a href="#Fill_Type">Fill Type</a>: winding, even-odd, inverse | 231| <a href="#SkPath_setIsConvex">setIsConvex</a> | deprecated | 232| <a href="#SkPath_setIsVolatile">setIsVolatile</a> | sets if <a href="undocumented#Device">Device</a> should not cache | 233| <a href="#SkPath_setLastPt">setLastPt</a> | replaces <a href="#Last_Point">Last Point</a> | 234| <a href="#SkPath_swap">swap</a> | exchanges <a href="#Path">Path</a> pair | 235| <a href="#SkPath_toggleInverseFillType">toggleInverseFillType</a> | toggles <a href="#Fill_Type">Fill Type</a> between inside and outside geometry | 236| <a href="#SkPath_transform">transform</a> | applies <a href="SkMatrix_Reference#Matrix">Matrix</a> to <a href="#Point_Array">Point Array</a> and <a href="#Weight">Weights</a> | 237| <a href="#SkPath_unique">unique</a> | returns if data has single owner | 238| <a href="#SkPath_updateBoundsCache">updateBoundsCache</a> | refreshes result of <a href="#SkPath_getBounds">getBounds</a> | 239| <a href="#SkPath_writeToMemory">writeToMemory</a> | copies data to buffer | 240 241## <a name="Verb"></a> Verb 242 243## <a name="SkPath_Verb"></a> Enum SkPath::Verb 244 245<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 246enum <a href="#Verb">Verb</a> { 247<a href="#SkPath_kMove_Verb">kMove Verb</a>, 248<a href="#SkPath_kLine_Verb">kLine Verb</a>, 249<a href="#SkPath_kQuad_Verb">kQuad Verb</a>, 250<a href="#SkPath_kConic_Verb">kConic Verb</a>, 251<a href="#SkPath_kCubic_Verb">kCubic Verb</a>, 252<a href="#SkPath_kClose_Verb">kClose Verb</a>, 253<a href="#SkPath_kDone_Verb">kDone Verb</a>, 254};</pre> 255 256<a href="#Verb">Verb</a> instructs <a href="#Path">Path</a> how to interpret one or more <a href="SkPoint_Reference#Point">Point</a> and optional <a href="#Conic_Weight">Conic Weight</a>; 257manage <a href="#Contour">Contour</a>, and terminate <a href="#Path">Path</a>. 258 259### Constants 260 261<table> 262 <tr> 263 <td><a name="SkPath_kMove_Verb"> <code><strong>SkPath::kMove_Verb </strong></code> </a></td><td>0</td><td>Starts new <a href="#Contour">Contour</a> at next <a href="SkPoint_Reference#Point">Point</a>.</td> 264 </tr> 265 <tr> 266 <td><a name="SkPath_kLine_Verb"> <code><strong>SkPath::kLine_Verb </strong></code> </a></td><td>1</td><td>Adds <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to next <a href="SkPoint_Reference#Point">Point</a>. 267<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>.</td> 268 </tr> 269 <tr> 270 <td><a name="SkPath_kQuad_Verb"> <code><strong>SkPath::kQuad_Verb </strong></code> </a></td><td>2</td><td>Adds <a href="#Quad">Quad</a> from <a href="#Last_Point">Last Point</a>, using control <a href="SkPoint_Reference#Point">Point</a>, and end <a href="SkPoint_Reference#Point">Point</a>. 271<a href="#Quad">Quad</a> is a parabolic section within tangents from <a href="#Last_Point">Last Point</a> to control <a href="SkPoint_Reference#Point">Point</a>, 272and control <a href="SkPoint_Reference#Point">Point</a> to end <a href="SkPoint_Reference#Point">Point</a>.</td> 273 </tr> 274 <tr> 275 <td><a name="SkPath_kConic_Verb"> <code><strong>SkPath::kConic_Verb </strong></code> </a></td><td>3</td><td>Adds <a href="#Conic">Conic</a> from <a href="#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="#Conic_Weight">Conic Weight</a>. 276<a href="#Conic">Conic</a> is a elliptical, parabolic, or hyperbolic section within tangents 277from <a href="#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 278by <a href="#Conic_Weight">Conic Weight</a>. <a href="#Conic_Weight">Conic Weight</a> less than one is elliptical; equal to one is 279parabolic (and identical to <a href="#Quad">Quad</a>); greater than one hyperbolic.</td> 280 </tr> 281 <tr> 282 <td><a name="SkPath_kCubic_Verb"> <code><strong>SkPath::kCubic_Verb </strong></code> </a></td><td>4</td><td>Adds <a href="#Cubic">Cubic</a> from <a href="#Last_Point">Last Point</a>, using two control <a href="#Point">Points</a>, and end <a href="SkPoint_Reference#Point">Point</a>. 283<a href="#Cubic">Cubic</a> is a third-order Bezier_Curve section within tangents from <a href="#Last_Point">Last Point</a> 284to 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>.</td> 285 </tr> 286 <tr> 287 <td><a name="SkPath_kClose_Verb"> <code><strong>SkPath::kClose_Verb </strong></code> </a></td><td>5</td><td>Closes <a href="#Contour">Contour</a>, connecting <a href="#Last_Point">Last Point</a> to <a href="#SkPath_kMove_Verb">kMove Verb</a> <a href="SkPoint_Reference#Point">Point</a>.</td> 288 </tr> 289 <tr> 290 <td><a name="SkPath_kDone_Verb"> <code><strong>SkPath::kDone_Verb </strong></code> </a></td><td>6</td><td>Terminates <a href="#Path">Path</a>. Not in <a href="#Verb_Array">Verb Array</a>, but returned by <a href="#Path">Path</a> iterator.</td> 291 </tr> 292Each <a href="#Verb">Verb</a> has zero or more <a href="#Point">Points</a> stored in <a href="#Path">Path</a>. 293<a href="#Path">Path</a> iterator returns complete curve descriptions, duplicating shared <a href="#Point">Points</a> 294for consecutive entries. 295 296</table> 297 298| <a href="#Verb">Verb</a> | Allocated <a href="#Point">Points</a> | Iterated <a href="#Point">Points</a> | <a href="#Weight">Weights</a> | 299| --- | --- | --- | --- | 300| <a href="#SkPath_kMove_Verb">kMove Verb</a> | 1 | 1 | 0 | 301| <a href="#SkPath_kLine_Verb">kLine Verb</a> | 1 | 2 | 0 | 302| <a href="#SkPath_kQuad_Verb">kQuad Verb</a> | 2 | 3 | 0 | 303| <a href="#SkPath_kConic_Verb">kConic Verb</a> | 2 | 3 | 1 | 304| <a href="#SkPath_kCubic_Verb">kCubic Verb</a> | 3 | 4 | 0 | 305| <a href="#SkPath_kClose_Verb">kClose Verb</a> | 0 | 1 | 0 | 306| <a href="#SkPath_kDone_Verb">kDone Verb</a> | -- | 0 | 0 | 307 308### Example 309 310<div><fiddle-embed name="799096fdc1298aa815934a74e76570ca"> 311 312#### Example Output 313 314~~~~ 315verb count: 7 316verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConic_Verb 317~~~~ 318 319</fiddle-embed></div> 320 321 322 323## <a name="Direction"></a> Direction 324 325## <a name="SkPath_Direction"></a> Enum SkPath::Direction 326 327<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 328enum <a href="#Direction">Direction</a> { 329<a href="#SkPath_kCW_Direction">kCW Direction</a>, 330<a href="#SkPath_kCCW_Direction">kCCW Direction</a>, 331};</pre> 332 333<a href="#Direction">Direction</a> describes whether <a href="#Contour">Contour</a> is clockwise or counterclockwise. 334When <a href="#Path">Path</a> contains multiple overlapping <a href="#Contour">Contours</a>, <a href="#Direction">Direction</a> together with 335<a href="#Fill_Type">Fill Type</a> determines whether overlaps are filled or form holes. 336 337<a href="#Direction">Direction</a> also determines how <a href="#Contour">Contour</a> is measured. For instance, dashing 338measures along <a href="#Path">Path</a> to determine where to start and stop stroke; <a href="#Direction">Direction</a> 339will change dashed results as it steps clockwise or counterclockwise. 340 341Closed <a href="#Contour">Contours</a> like <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> added with 342<a href="#SkPath_kCW_Direction">kCW Direction</a> travel clockwise; the same added with <a href="#SkPath_kCCW_Direction">kCCW Direction</a> 343travel counterclockwise. 344 345### Constants 346 347<table> 348 <tr> 349 <td><a name="SkPath_kCW_Direction"> <code><strong>SkPath::kCW_Direction </strong></code> </a></td><td>0</td><td><a href="#Contour">Contour</a> travels in a clockwise direction</td> 350 </tr> 351 <tr> 352 <td><a name="SkPath_kCCW_Direction"> <code><strong>SkPath::kCCW_Direction </strong></code> </a></td><td>1</td><td><a href="#Contour">Contour</a> travels in a counterclockwise direction</td> 353 </tr> 354</table> 355 356### Example 357 358<div><fiddle-embed name="0de03d9c939b6238318b7366866e8722"></fiddle-embed></div> 359 360### See Also 361 362<a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_rArcTo">rArcTo</a> <a href="#SkPath_isRect">isRect</a> <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> <a href="#SkPath_addOval">addOval</a><sup><a href="#SkPath_addOval_2">[2]</a></sup> 363 364 365 366<a name="SkPath_empty_constructor"></a> 367## SkPath 368 369<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 370SkPath() 371</pre> 372 373By default, <a href="#Path">Path</a> has no <a href="#Verb">Verbs</a>, no <a href="#Point">Points</a>, and no <a href="#Weight">Weights</a>. 374<a href="#Fill_Type">Fill Type</a> is set to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. 375 376### Return Value 377 378empty <a href="#Path">Path</a> 379 380### Example 381 382<div><fiddle-embed name="0a0026fca638d1cd75c0ab884e3ee1c6"> 383 384#### Example Output 385 386~~~~ 387path is empty 388~~~~ 389 390</fiddle-embed></div> 391 392### See Also 393 394<a href="#SkPath_reset">reset</a> <a href="#SkPath_rewind">rewind</a> 395 396--- 397 398<a name="SkPath_copy_const_SkPath"></a> 399## SkPath 400 401<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 402SkPath(const SkPath& path) 403</pre> 404 405Copy constructor makes two paths identical by value. Internally, <a href="#SkPath_copy_const_SkPath_path">path</a> and 406the returned result share pointer values. The underlying <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a> 407and <a href="#Weight">Weights</a> are copied when modified. 408 409Creating a <a href="#Path">Path</a> copy is very efficient and never allocates memory. 410<a href="#Path">Paths</a> are always copied by value from the interface; the underlying shared 411pointers are not exposed. 412 413### Parameters 414 415<table> <tr> <td><a name="SkPath_copy_const_SkPath_path"> <code><strong>path </strong></code> </a></td> <td> 416<a href="#Path">Path</a> to copy by value</td> 417 </tr> 418</table> 419 420### Return Value 421 422copy of <a href="#Path">Path</a> 423 424### Example 425 426<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 427of each other.</div> 428 429#### Example Output 430 431~~~~ 432path verbs: 2 433path2 verbs: 3 434after reset 435path verbs: 0 436path2 verbs: 3 437~~~~ 438 439</fiddle-embed></div> 440 441### See Also 442 443<a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> 444 445--- 446 447<a name="SkPath_destructor"></a> 448## ~SkPath 449 450<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 451~SkPath() 452</pre> 453 454Releases ownership of any shared data and deletes data if <a href="#Path">Path</a> is sole owner. 455 456### Example 457 458<div><fiddle-embed name="01ad6be9b7d15a2217daea273eb3d466"><div>delete calls <a href="#Path">Path</a> Destructor, but copy of original in path2 is unaffected.</div></fiddle-embed></div> 459 460### See Also 461 462<a href="#SkPath_empty_constructor">SkPath()</a> <a href="#SkPath_copy_const_SkPath">SkPath(const SkPath& path)</a> <a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> 463 464--- 465 466<a name="SkPath_copy_operator"></a> 467## operator= 468 469<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 470SkPath& operator=(const SkPath& path) 471</pre> 472 473<a href="#Path">Path</a> assignment makes two paths identical by value. Internally, assignment 474shares pointer values. The underlying <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a> and <a href="#Weight">Weights</a> 475are copied when modified. 476 477Copying <a href="#Path">Paths</a> by assignment is very efficient and never allocates memory. 478<a href="#Path">Paths</a> are always copied by value from the interface; the underlying shared 479pointers are not exposed. 480 481### Parameters 482 483<table> <tr> <td><a name="SkPath_copy_operator_path"> <code><strong>path </strong></code> </a></td> <td> 484<a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Weight">Weights</a>, and <a href="#Fill_Type">Fill Type</a> to copy</td> 485 </tr> 486</table> 487 488### Return Value 489 490<a href="#Path">Path</a> copied by value 491 492### Example 493 494<div><fiddle-embed name="bba288f5f77fc8e37e89d2ec08e0ac60"> 495 496#### Example Output 497 498~~~~ 499path1 bounds = 10, 20, 30, 40 500path2 bounds = 10, 20, 30, 40 501~~~~ 502 503</fiddle-embed></div> 504 505### See Also 506 507<a href="#SkPath_swap">swap</a> <a href="#SkPath_copy_const_SkPath">SkPath(const SkPath& path)</a> 508 509--- 510 511<a name="SkPath_equal_operator"></a> 512## operator== 513 514<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 515bool operator==(const SkPath& a, const SkPath& b) 516</pre> 517 518Compares <a href="#SkPath_equal_operator_a">a</a> and <a href="#SkPath_equal_operator_b">b</a>; returns true if <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a> 519are equivalent. 520 521### Parameters 522 523<table> <tr> <td><a name="SkPath_equal_operator_a"> <code><strong>a </strong></code> </a></td> <td> 524<a href="#Path">Path</a> to compare</td> 525 </tr> <tr> <td><a name="SkPath_equal_operator_b"> <code><strong>b </strong></code> </a></td> <td> 526<a href="#Path">Path</a> to compare</td> 527 </tr> 528</table> 529 530### Return Value 531 532true if <a href="#Path">Path</a> pair are equivalent 533 534### Example 535 536<div><fiddle-embed name="31883f51bb357f2ac5990d88f8b82e02"><div>Rewind removes <a href="#Verb_Array">Verb Array</a> but leaves storage; since storage is not compared, 537<a href="#Path">Path</a> pair are equivalent.</div> 538 539#### Example Output 540 541~~~~ 542empty one == two 543moveTo one != two 544rewind one == two 545reset one == two 546~~~~ 547 548</fiddle-embed></div> 549 550--- 551 552<a name="SkPath_notequal_operator"></a> 553## operator!= 554 555<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 556bool operator!=(const SkPath& a, const SkPath& b) 557</pre> 558 559Compares <a href="#SkPath_notequal_operator_a">a</a> and <a href="#SkPath_notequal_operator_b">b</a>; returns true if <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a> 560are not equivalent. 561 562### Parameters 563 564<table> <tr> <td><a name="SkPath_notequal_operator_a"> <code><strong>a </strong></code> </a></td> <td> 565<a href="#Path">Path</a> to compare</td> 566 </tr> <tr> <td><a name="SkPath_notequal_operator_b"> <code><strong>b </strong></code> </a></td> <td> 567<a href="#Path">Path</a> to compare</td> 568 </tr> 569</table> 570 571### Return Value 572 573true if <a href="#Path">Path</a> pair are not equivalent 574 575### Example 576 577<div><fiddle-embed name="0c6870ba1cea85ce6da5abd489c23d83"><div><a href="#Path">Path</a> pair are equal though their convexity is not equal.</div> 578 579#### Example Output 580 581~~~~ 582empty one == two 583addRect one == two 584setConvexity one == two 585convexity != 586~~~~ 587 588</fiddle-embed></div> 589 590--- 591 592<a name="SkPath_isInterpolatable"></a> 593## isInterpolatable 594 595<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 596bool isInterpolatable(const SkPath& compare) const 597</pre> 598 599Return true if <a href="#Path">Paths</a> contain equal <a href="#Verb">Verbs</a> and equal <a href="#Weight">Weights</a>. 600If <a href="#Path">Paths</a> contain one or more <a href="#Conic">Conics</a>, the <a href="#Weight">Weights</a> must match. 601 602<a href="#SkPath_conicTo">conicTo</a> may add different <a href="#Verb">Verbs</a> depending on <a href="#Conic_Weight">Conic Weight</a>, so it is not 603trivial to interpolate a pair of <a href="#Path">Paths</a> containing <a href="#Conic">Conics</a> with different 604<a href="#Conic_Weight">Conic Weight</a> values. 605 606### Parameters 607 608<table> <tr> <td><a name="SkPath_isInterpolatable_compare"> <code><strong>compare </strong></code> </a></td> <td> 609<a href="#Path">Path</a> to <a href="#SkPath_isInterpolatable_compare">compare</a></td> 610 </tr> 611</table> 612 613### Return Value 614 615true if <a href="#Path">Paths</a> <a href="#Verb_Array">Verb Array</a> and <a href="#Weight">Weights</a> are equivalent 616 617### Example 618 619<div><fiddle-embed name="c81fc7dfaf785c3fb77209c7f2ebe5b8"> 620 621#### Example Output 622 623~~~~ 624paths are interpolatable 625~~~~ 626 627</fiddle-embed></div> 628 629### See Also 630 631<a href="#SkPath_isInterpolatable">isInterpolatable</a> 632 633--- 634 635<a name="SkPath_interpolate"></a> 636## interpolate 637 638<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 639bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const 640</pre> 641 642Interpolate between <a href="#Path">Paths</a> with <a href="#Point_Array">Point Array</a> of equal size. 643Copy <a href="#Verb_Array">Verb Array</a> and <a href="#Weight">Weights</a> to <a href="#SkPath_interpolate_out">out</a>, and set <a href="#SkPath_interpolate_out">out</a> <a href="#Point_Array">Point Array</a> to a weighted 644average of this <a href="#Point_Array">Point Array</a> and <a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a>, using the formula: 645(<a href="#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>). 646 647<a href="#SkPath_interpolate_weight">weight</a> is most useful when between zero (<a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a>) and 648one (this <a href="#Point_Array">Point Array</a>); will work with values outside of this 649range. 650 651<a href="#SkPath_interpolate">interpolate</a> returns false and leaves <a href="#SkPath_interpolate_out">out</a> unchanged if <a href="#Point_Array">Point Array</a> is not 652the same size as <a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a>. Call <a href="#SkPath_isInterpolatable">isInterpolatable</a> to check <a href="#Path">Path</a> 653compatibility prior to calling <a href="#SkPath_interpolate">interpolate</a>. 654 655### Parameters 656 657<table> <tr> <td><a name="SkPath_interpolate_ending"> <code><strong>ending </strong></code> </a></td> <td> 658<a href="#Point_Array">Point Array</a> averaged with this <a href="#Point_Array">Point Array</a></td> 659 </tr> <tr> <td><a name="SkPath_interpolate_weight"> <code><strong>weight </strong></code> </a></td> <td> 660contribution of this <a href="#Point_Array">Point Array</a>, and 661one minus contribution of <a href="#SkPath_interpolate_ending">ending</a> <a href="#Point_Array">Point Array</a></td> 662 </tr> <tr> <td><a name="SkPath_interpolate_out"> <code><strong>out </strong></code> </a></td> <td> 663<a href="#Path">Path</a> replaced by interpolated averages</td> 664 </tr> 665</table> 666 667### Return Value 668 669true if <a href="#Path">Paths</a> contain same number of <a href="#Point">Points</a> 670 671### Example 672 673<div><fiddle-embed name="404f11c5c9c9ca8a64822d484552a473"></fiddle-embed></div> 674 675### See Also 676 677<a href="#SkPath_isInterpolatable">isInterpolatable</a> 678 679--- 680 681<a name="SkPath_unique"></a> 682## unique 683 684<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 685bool unique() const 686</pre> 687 688### Return Value 689 690true if <a href="#Path">Path</a> has one owner 691 692--- 693 694## <a name="Fill_Type"></a> Fill Type 695 696## <a name="SkPath_FillType"></a> Enum SkPath::FillType 697 698<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 699enum <a href="#SkPath_FillType">FillType</a> { 700<a href="#SkPath_kWinding_FillType">kWinding FillType</a>, 701<a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, 702<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, 703<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a>, 704};</pre> 705 706<a href="#Fill_Type">Fill Type</a> selects the rule used to fill <a href="#Path">Path</a>. <a href="#Path">Path</a> set to <a href="#SkPath_kWinding_FillType">kWinding FillType</a> 707fills if the sum of <a href="#Contour">Contour</a> edges is not zero, where clockwise edges add one, and 708counterclockwise edges subtract one. <a href="#Path">Path</a> set to <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> fills if the 709number of <a href="#Contour">Contour</a> edges is odd. Each <a href="#Fill_Type">Fill Type</a> has an inverse variant that 710reverses the rule: 711<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> fills where the sum of <a href="#Contour">Contour</a> edges is zero; 712<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> fills where the number of <a href="#Contour">Contour</a> edges is even. 713 714### Example 715 716<div><fiddle-embed name="525ed591c31960de23068dba8ea11a75"><div>The top row has two clockwise rectangles. The second row has one clockwise and 717one counterclockwise rectangle. The even-odd variants draw the same. The 718winding variants draw the top rectangle overlap, which has a winding of 2, the 719same as the outer parts of the top rectangles, which have a winding of 1.</div></fiddle-embed></div> 720 721### Constants 722 723<table> 724 <tr> 725 <td><a name="SkPath_kWinding_FillType"> <code><strong>SkPath::kWinding_FillType </strong></code> </a></td><td>0</td><td>Specifies fill as area is enclosed by a non-zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>.</td> 726 </tr> 727 <tr> 728 <td><a name="SkPath_kEvenOdd_FillType"> <code><strong>SkPath::kEvenOdd_FillType </strong></code> </a></td><td>1</td><td>Specifies fill as area enclosed by an odd number of <a href="#Contour">Contours</a>.</td> 729 </tr> 730 <tr> 731 <td><a name="SkPath_kInverseWinding_FillType"> <code><strong>SkPath::kInverseWinding_FillType </strong></code> </a></td><td>2</td><td>Specifies fill as area is enclosed by a zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>.</td> 732 </tr> 733 <tr> 734 <td><a name="SkPath_kInverseEvenOdd_FillType"> <code><strong>SkPath::kInverseEvenOdd_FillType </strong></code> </a></td><td>3</td><td>Specifies fill as area enclosed by an even number of <a href="#Contour">Contours</a>.</td> 735 </tr> 736</table> 737 738### Example 739 740<div><fiddle-embed name="0ebf978b234a00e2c2573cfa7b04e776"></fiddle-embed></div> 741 742### See Also 743 744<a href="#SkPaint_Style">SkPaint::Style</a> <a href="#SkPath_Direction">Direction</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> 745 746 747 748<a name="SkPath_getFillType"></a> 749## getFillType 750 751<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 752FillType getFillType() const 753</pre> 754 755Returns <a href="#SkPath_FillType">FillType</a>, the rule used to fill <a href="#Path">Path</a>. <a href="#SkPath_FillType">FillType</a> of a new <a href="#Path">Path</a> is 756<a href="#SkPath_kWinding_FillType">kWinding FillType</a>. 757 758### Return Value 759 760one 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>, 761<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> 762 763### Example 764 765<div><fiddle-embed name="2eb8f985d1e263e70b5c0aa4a8b68d8e"> 766 767#### Example Output 768 769~~~~ 770default path fill type is kWinding_FillType 771~~~~ 772 773</fiddle-embed></div> 774 775### See Also 776 777<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_isInverseFillType">isInverseFillType</a> 778 779--- 780 781<a name="SkPath_setFillType"></a> 782## setFillType 783 784<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 785void setFillType(FillType ft) 786</pre> 787 788Sets <a href="#SkPath_FillType">FillType</a>, the rule used to fill <a href="#Path">Path</a>. While there is no check 789that <a href="#SkPath_setFillType_ft">ft</a> is legal, values outside of <a href="#SkPath_FillType">FillType</a> are not supported. 790 791### Parameters 792 793<table> <tr> <td><a name="SkPath_setFillType_ft"> <code><strong>ft </strong></code> </a></td> <td> 794one 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>, 795<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a></td> 796 </tr> 797</table> 798 799### Example 800 801<div><fiddle-embed name="b4a91cd7f50b2a0a0d1bec6d0ac823d2"><div>If empty <a href="#Path">Path</a> is set to inverse <a href="#SkPath_FillType">FillType</a>, it fills all pixels.</div></fiddle-embed></div> 802 803### See Also 804 805<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_toggleInverseFillType">toggleInverseFillType</a> 806 807--- 808 809<a name="SkPath_isInverseFillType"></a> 810## isInverseFillType 811 812<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 813bool isInverseFillType() const 814</pre> 815 816Returns if <a href="#SkPath_FillType">FillType</a> describes area outside <a href="#Path">Path</a> geometry. The inverse fill area 817extends indefinitely. 818 819### Return Value 820 821true 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> 822 823### Example 824 825<div><fiddle-embed name="2a2d39f5da611545caa18bbcea873ab2"> 826 827#### Example Output 828 829~~~~ 830default path fill type is inverse: false 831~~~~ 832 833</fiddle-embed></div> 834 835### See Also 836 837<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_toggleInverseFillType">toggleInverseFillType</a> 838 839--- 840 841<a name="SkPath_toggleInverseFillType"></a> 842## toggleInverseFillType 843 844<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 845void toggleInverseFillType() 846</pre> 847 848Replace <a href="#SkPath_FillType">FillType</a> with its inverse. The inverse of <a href="#SkPath_FillType">FillType</a> describes the area 849unmodified by the original <a href="#SkPath_FillType">FillType</a>. 850 851| <a href="#SkPath_FillType">FillType</a> | toggled <a href="#SkPath_FillType">FillType</a> | 852| --- | --- | 853| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | 854| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | 855| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | 856| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | 857 858### Example 859 860<div><fiddle-embed name="400facce23d417bc5043c5f58404afbd"><div><a href="#Path">Path</a> drawn normally and through its inverse touches every pixel once.</div></fiddle-embed></div> 861 862### See Also 863 864<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_isInverseFillType">isInverseFillType</a> 865 866--- 867 868## <a name="Convexity"></a> Convexity 869 870## <a name="SkPath_Convexity"></a> Enum SkPath::Convexity 871 872<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 873enum <a href="#Convexity">Convexity</a> : uint8_t { 874<a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>, 875<a href="#SkPath_kConvex_Convexity">kConvex Convexity</a>, 876<a href="#SkPath_kConcave_Convexity">kConcave Convexity</a>, 877};</pre> 878 879<a href="#Path">Path</a> is convex if it contains one <a href="#Contour">Contour</a> and <a href="#Contour">Contour</a> loops no more than 880360 degrees, and <a href="#Contour">Contour</a> angles all have same <a href="#SkPath_Direction">Direction</a>. Convex <a href="#Path">Path</a> 881may have better performance and require fewer resources on <a href="undocumented#GPU_Surface">GPU Surface</a>. 882 883<a href="#Path">Path</a> is concave when either at least one <a href="#SkPath_Direction">Direction</a> change is clockwise and 884another is counterclockwise, or the sum of the changes in <a href="#SkPath_Direction">Direction</a> is not 360 885degrees. 886 887Initially <a href="#Path">Path</a> <a href="#Convexity">Convexity</a> is <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>. <a href="#Path">Path</a> <a href="#Convexity">Convexity</a> is computed 888if needed by destination <a href="SkSurface_Reference#Surface">Surface</a>. 889 890### Constants 891 892<table> 893 <tr> 894 <td><a name="SkPath_kUnknown_Convexity"> <code><strong>SkPath::kUnknown_Convexity </strong></code> </a></td><td>0</td><td>Indicates <a href="#Convexity">Convexity</a> has not been determined.</td> 895 </tr> 896 <tr> 897 <td><a name="SkPath_kConvex_Convexity"> <code><strong>SkPath::kConvex_Convexity </strong></code> </a></td><td>1</td><td><a href="#Path">Path</a> has one <a href="#Contour">Contour</a> made of a simple geometry without indentations.</td> 898 </tr> 899 <tr> 900 <td><a name="SkPath_kConcave_Convexity"> <code><strong>SkPath::kConcave_Convexity </strong></code> </a></td><td>2</td><td><a href="#Path">Path</a> has more than one <a href="#Contour">Contour</a>, or a geometry with indentations.</td> 901 </tr> 902</table> 903 904### Example 905 906<div><fiddle-embed name="b7d0c0732411db76fa37b05fc18712b3"></fiddle-embed></div> 907 908### See Also 909 910<a href="#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> 911 912 913 914<a name="SkPath_getConvexity"></a> 915## getConvexity 916 917<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 918Convexity getConvexity() const 919</pre> 920 921Computes <a href="#Convexity">Convexity</a> if required, and returns stored value. 922<a href="#Convexity">Convexity</a> is computed if stored value is <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>, 923or if <a href="#Path">Path</a> has been altered since <a href="#Convexity">Convexity</a> was computed or set. 924 925### Return Value 926 927computed or stored <a href="#Convexity">Convexity</a> 928 929### Example 930 931<div><fiddle-embed name="c8f5ac4040cb5026d234bf99e3f01e8e"></fiddle-embed></div> 932 933### See Also 934 935<a href="#Convexity">Convexity</a> <a href="#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> 936 937--- 938 939<a name="SkPath_getConvexityOrUnknown"></a> 940## getConvexityOrUnknown 941 942<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 943Convexity getConvexityOrUnknown() const 944</pre> 945 946Returns last computed <a href="#Convexity">Convexity</a>, or <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a> if 947<a href="#Path">Path</a> has been altered since <a href="#Convexity">Convexity</a> was computed or set. 948 949### Return Value 950 951stored <a href="#Convexity">Convexity</a> 952 953### Example 954 955<div><fiddle-embed name="bc19da9de880e3f339707247686efc0a"><div><a href="#Convexity">Convexity</a> is unknown unless <a href="#SkPath_getConvexity">getConvexity</a> is called without a subsequent call 956that alters the path.</div></fiddle-embed></div> 957 958### See Also 959 960<a href="#Convexity">Convexity</a> <a href="#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> 961 962--- 963 964<a name="SkPath_setConvexity"></a> 965## setConvexity 966 967<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 968void setConvexity(Convexity convexity) 969</pre> 970 971Stores <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>. 972<a href="#SkPath_setConvexity_convexity">convexity</a> may differ from <a href="#SkPath_getConvexity">getConvexity</a>, although setting an incorrect value may 973cause incorrect or inefficient drawing. 974 975If <a href="#SkPath_setConvexity_convexity">convexity</a> is <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>: <a href="#SkPath_getConvexity">getConvexity</a> will 976compute <a href="#Convexity">Convexity</a>, and <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> will return <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>. 977 978If <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> 979and <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> will return <a href="#SkPath_setConvexity_convexity">convexity</a> until the path is 980altered. 981 982### Parameters 983 984<table> <tr> <td><a name="SkPath_setConvexity_convexity"> <code><strong>convexity </strong></code> </a></td> <td> 985one 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> 986 </tr> 987</table> 988 989### Example 990 991<div><fiddle-embed name="6fe0d520507eeafe118b80f7f1d9b588"></fiddle-embed></div> 992 993### See Also 994 995<a href="#Convexity">Convexity</a> <a href="#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> 996 997--- 998 999<a name="SkPath_isConvex"></a> 1000## isConvex 1001 1002<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1003bool isConvex() const 1004</pre> 1005 1006Computes <a href="#Convexity">Convexity</a> if required, and returns true if value is <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a>. 1007If <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 1008the path has not been altered, <a href="#Convexity">Convexity</a> is not recomputed. 1009 1010### Return Value 1011 1012true if <a href="#Convexity">Convexity</a> stored or computed is <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a> 1013 1014### Example 1015 1016<div><fiddle-embed name="dfd2c40e1c2a7b539a94aec8d040d349"><div>Concave shape is erroneously considered convex after a forced call to 1017<a href="#SkPath_setConvexity">setConvexity</a>.</div></fiddle-embed></div> 1018 1019### See Also 1020 1021<a href="#Convexity">Convexity</a> <a href="#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> 1022 1023--- 1024 1025<a name="SkPath_setIsConvex"></a> 1026## setIsConvex 1027 1028<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1029void setIsConvex(bool isConvex) 1030</pre> 1031 1032Deprecated. Use <a href="#SkPath_setConvexity">setConvexity</a>. 1033 1034### See Also 1035 1036<a href="#Convexity">Convexity</a> <a href="#SkPath_setConvexity">setConvexity</a> <a href="#SkPath_getConvexity">getConvexity</a> 1037 1038--- 1039 1040<a name="SkPath_isOval"></a> 1041## isOval 1042 1043<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1044bool isOval(SkRect* rect, Direction* dir = nullptr, unsigned* start = nullptr) const 1045</pre> 1046 1047Returns true if constructed by <a href="#SkPath_addCircle">addCircle</a>, <a href="#SkPath_addOval">addOval</a>; and in some cases, 1048<a href="#SkPath_addRoundRect">addRoundRect</a>, <a href="#SkPath_addRRect">addRRect</a>. <a href="#Path">Path</a> constructed with <a href="#SkPath_conicTo">conicTo</a> or <a href="#SkPath_rConicTo">rConicTo</a> will not 1049return true though <a href="#Path">Path</a> draws <a href="undocumented#Oval">Oval</a>. 1050 1051<a href="#SkPath_isOval_rect">rect</a> receives bounds of <a href="undocumented#Oval">Oval</a>. 1052<a href="#SkPath_isOval_dir">dir</a> receives <a href="#SkPath_Direction">Direction</a> of <a href="undocumented#Oval">Oval</a>: <a href="#SkPath_kCW_Direction">kCW Direction</a> if clockwise, <a href="#SkPath_kCCW_Direction">kCCW Direction</a> if 1053counterclockwise. 1054<a href="#SkPath_isOval_start">start</a> receives <a href="#SkPath_isOval_start">start</a> of <a href="undocumented#Oval">Oval</a>: 0 for top, 1 for right, 2 for bottom, 3 for left. 1055 1056<a href="#SkPath_isOval_rect">rect</a>, <a href="#SkPath_isOval_dir">dir</a>, and <a href="#SkPath_isOval_start">start</a> are unmodified if <a href="undocumented#Oval">Oval</a> is not found. 1057 1058Triggers performance optimizations on some <a href="undocumented#GPU_Surface">GPU Surface</a> implementations. 1059 1060### Parameters 1061 1062<table> <tr> <td><a name="SkPath_isOval_rect"> <code><strong>rect </strong></code> </a></td> <td> 1063storage for bounding <a href="SkRect_Reference#Rect">Rect</a> of <a href="undocumented#Oval">Oval</a>; may be nullptr</td> 1064 </tr> <tr> <td><a name="SkPath_isOval_dir"> <code><strong>dir </strong></code> </a></td> <td> 1065storage for <a href="#SkPath_Direction">Direction</a>; may be nullptr</td> 1066 </tr> <tr> <td><a name="SkPath_isOval_start"> <code><strong>start </strong></code> </a></td> <td> 1067storage for <a href="#SkPath_isOval_start">start</a> of <a href="undocumented#Oval">Oval</a>; may be nullptr</td> 1068 </tr> 1069</table> 1070 1071### Return Value 1072 1073true if <a href="#Path">Path</a> was constructed by method that reduces to <a href="undocumented#Oval">Oval</a> 1074 1075### Example 1076 1077<div><fiddle-embed name="4fc7b86c9b772c5e85af480524267bde"></fiddle-embed></div> 1078 1079### See Also 1080 1081<a href="undocumented#Oval">Oval</a> <a href="#SkPath_addCircle">addCircle</a> <a href="#SkPath_addOval">addOval</a><sup><a href="#SkPath_addOval_2">[2]</a></sup> 1082 1083--- 1084 1085<a name="SkPath_isRRect"></a> 1086## isRRect 1087 1088<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1089bool isRRect(SkRRect* rrect, Direction* dir = nullptr, unsigned* start = nullptr) const 1090</pre> 1091 1092Returns true if constructed by <a href="#SkPath_addRoundRect">addRoundRect</a>, <a href="#SkPath_addRRect">addRRect</a>; and if construction 1093is not empty, not <a href="SkRect_Reference#Rect">Rect</a>, and not <a href="undocumented#Oval">Oval</a>. <a href="#Path">Path</a> constructed with other calls 1094will not return true though <a href="#Path">Path</a> draws <a href="undocumented#Round_Rect">Round Rect</a>. 1095 1096<a href="#SkPath_isRRect_rrect">rrect</a> receives bounds of <a href="undocumented#Round_Rect">Round Rect</a>. 1097<a href="#SkPath_isRRect_dir">dir</a> receives <a href="#SkPath_Direction">Direction</a> of <a href="undocumented#Oval">Oval</a>: <a href="#SkPath_kCW_Direction">kCW Direction</a> if clockwise, <a href="#SkPath_kCCW_Direction">kCCW Direction</a> if 1098counterclockwise. 1099<a href="#SkPath_isRRect_start">start</a> receives <a href="#SkPath_isRRect_start">start</a> of <a href="undocumented#Round_Rect">Round Rect</a>: 0 for top, 1 for right, 2 for bottom, 3 for left. 1100 1101<a href="#SkPath_isRRect_rrect">rrect</a>, <a href="#SkPath_isRRect_dir">dir</a>, and <a href="#SkPath_isRRect_start">start</a> are unmodified if <a href="undocumented#Round_Rect">Round Rect</a> is not found. 1102 1103Triggers performance optimizations on some <a href="undocumented#GPU_Surface">GPU Surface</a> implementations. 1104 1105### Parameters 1106 1107<table> <tr> <td><a name="SkPath_isRRect_rrect"> <code><strong>rrect </strong></code> </a></td> <td> 1108storage for bounding <a href="SkRect_Reference#Rect">Rect</a> of <a href="undocumented#Round_Rect">Round Rect</a>; may be nullptr</td> 1109 </tr> <tr> <td><a name="SkPath_isRRect_dir"> <code><strong>dir </strong></code> </a></td> <td> 1110storage for <a href="#SkPath_Direction">Direction</a>; may be nullptr</td> 1111 </tr> <tr> <td><a name="SkPath_isRRect_start"> <code><strong>start </strong></code> </a></td> <td> 1112storage for <a href="#SkPath_isRRect_start">start</a> of <a href="undocumented#Round_Rect">Round Rect</a>; may be nullptr</td> 1113 </tr> 1114</table> 1115 1116### Return Value 1117 1118true if <a href="#Path">Path</a> contains only <a href="undocumented#Round_Rect">Round Rect</a> 1119 1120### Example 1121 1122<div><fiddle-embed name="f2b7e57a385e6604475c99ec8daa2697"><div>Draw rounded rectangle and its bounds. Draw an arc indicating where the rounded 1123rectangle starts and its direction.</div></fiddle-embed></div> 1124 1125### See Also 1126 1127<a href="undocumented#Round_Rect">Round Rect</a> <a href="#SkPath_addRoundRect">addRoundRect</a><sup><a href="#SkPath_addRoundRect_2">[2]</a></sup> <a href="#SkPath_addRRect">addRRect</a><sup><a href="#SkPath_addRRect_2">[2]</a></sup> 1128 1129--- 1130 1131<a name="SkPath_reset"></a> 1132## reset 1133 1134<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1135void reset() 1136</pre> 1137 1138Sets <a href="#Path">Path</a> to its initial state. 1139Removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a>, and sets <a href="#SkPath_FillType">FillType</a> to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. 1140Internal storage associated with <a href="#Path">Path</a> is released. 1141 1142### Example 1143 1144<div><fiddle-embed name="8cdca35d2964bbbecb93d79a13f71c65"></fiddle-embed></div> 1145 1146### See Also 1147 1148<a href="#SkPath_rewind">rewind</a> 1149 1150--- 1151 1152<a name="SkPath_rewind"></a> 1153## rewind 1154 1155<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1156void rewind() 1157</pre> 1158 1159Sets <a href="#Path">Path</a> to its initial state, preserving internal storage. 1160Removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a>, and sets <a href="#SkPath_FillType">FillType</a> to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. 1161Internal storage associated with <a href="#Path">Path</a> is retained. 1162 1163Use <a href="#SkPath_rewind">rewind</a> instead of <a href="#SkPath_reset">reset</a> if <a href="#Path">Path</a> storage will be reused and performance 1164is critical. 1165 1166### Example 1167 1168<div><fiddle-embed name="f1fedbb89da9c2a33a91805175663012"><div>Although path1 retains its internal storage, it is indistinguishable from 1169a newly initialized path.</div></fiddle-embed></div> 1170 1171### See Also 1172 1173<a href="#SkPath_reset">reset</a> 1174 1175--- 1176 1177<a name="SkPath_isEmpty"></a> 1178## isEmpty 1179 1180<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1181bool isEmpty() const 1182</pre> 1183 1184Empty <a href="#Path">Path</a> may have <a href="#SkPath_FillType">FillType</a> but has no <a href="SkPoint_Reference#SkPoint">SkPoint</a>, <a href="#SkPath_Verb">Verb</a>, or <a href="#Conic_Weight">Conic Weight</a>. 1185<a href="#SkPath_empty_constructor">SkPath()</a> constructs empty <a href="#Path">Path</a>; <a href="#SkPath_reset">reset</a> and (rewind) make <a href="#Path">Path</a> empty. 1186 1187### Return Value 1188 1189true if the path contains no <a href="#SkPath_Verb">Verb</a> array 1190 1191### Example 1192 1193<div><fiddle-embed name="0b34e6d55d11586744adeb889d2a12f4"> 1194 1195#### Example Output 1196 1197~~~~ 1198initial path is empty 1199after moveTo path is not empty 1200after rewind path is empty 1201after lineTo path is not empty 1202after reset path is empty 1203~~~~ 1204 1205</fiddle-embed></div> 1206 1207### See Also 1208 1209<a href="#SkPath_empty_constructor">SkPath()</a> <a href="#SkPath_reset">reset</a> <a href="#SkPath_rewind">rewind</a> 1210 1211--- 1212 1213<a name="SkPath_isLastContourClosed"></a> 1214## isLastContourClosed 1215 1216<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1217bool isLastContourClosed() const 1218</pre> 1219 1220<a href="#Contour">Contour</a> is closed if <a href="#Path">Path</a> <a href="#SkPath_Verb">Verb</a> array was last modified by <a href="#SkPath_close">close</a>. When stroked, 1221closed <a href="#Contour">Contour</a> draws <a href="#Stroke_Join">Paint Stroke Join</a> instead of <a href="#Stroke_Cap">Paint Stroke Cap</a> at first and last <a href="SkPoint_Reference#Point">Point</a>. 1222 1223### Return Value 1224 1225true if the last <a href="#Contour">Contour</a> ends with a <a href="#SkPath_kClose_Verb">kClose Verb</a> 1226 1227### Example 1228 1229<div><fiddle-embed name="03b740ab94b9017800a52e30b5e7fee7"><div><a href="#SkPath_close">close</a> has no effect if <a href="#Path">Path</a> is empty; <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> returns 1230false until <a href="#Path">Path</a> has geometry followed by <a href="#SkPath_close">close</a>.</div> 1231 1232#### Example Output 1233 1234~~~~ 1235initial last contour is not closed 1236after close last contour is not closed 1237after lineTo last contour is not closed 1238after close last contour is closed 1239~~~~ 1240 1241</fiddle-embed></div> 1242 1243### See Also 1244 1245<a href="#SkPath_close">close</a> 1246 1247--- 1248 1249<a name="SkPath_isFinite"></a> 1250## isFinite 1251 1252<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1253bool isFinite() const 1254</pre> 1255 1256Returns true for finite <a href="SkPoint_Reference#Point">Point</a> array values between negative <a href="undocumented#SK_ScalarMax">SK ScalarMax</a> and 1257positive <a href="undocumented#SK_ScalarMax">SK ScalarMax</a>. Returns false for any <a href="SkPoint_Reference#Point">Point</a> array value of 1258<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>. 1259 1260### Return Value 1261 1262true if all <a href="SkPoint_Reference#Point">Point</a> values are finite 1263 1264### Example 1265 1266<div><fiddle-embed name="dd4e4dd2aaa8039b2430729c6b3af817"> 1267 1268#### Example Output 1269 1270~~~~ 1271initial path is finite 1272after line path is finite 1273after scale path is not finite 1274~~~~ 1275 1276</fiddle-embed></div> 1277 1278### See Also 1279 1280<a href="undocumented#SkScalar">SkScalar</a> 1281 1282--- 1283 1284<a name="SkPath_isVolatile"></a> 1285## isVolatile 1286 1287<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1288bool isVolatile() const 1289</pre> 1290 1291Returns true if the path is volatile; it will not be altered or discarded 1292by the caller after it is drawn. <a href="#Path">Paths</a> by default have volatile set false, allowing 1293<a href="SkSurface_Reference#Surface">Surface</a> to attach a cache of data which speeds repeated drawing. If true, <a href="SkSurface_Reference#Surface">Surface</a> 1294may not speed repeated drawing. 1295 1296### Return Value 1297 1298true if caller will alter <a href="#Path">Path</a> after drawing 1299 1300### Example 1301 1302<div><fiddle-embed name="c722ebe8ac991d77757799ce29e509e1"> 1303 1304#### Example Output 1305 1306~~~~ 1307volatile by default is false 1308~~~~ 1309 1310</fiddle-embed></div> 1311 1312### See Also 1313 1314<a href="#SkPath_setIsVolatile">setIsVolatile</a> 1315 1316--- 1317 1318<a name="SkPath_setIsVolatile"></a> 1319## setIsVolatile 1320 1321<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1322void setIsVolatile(bool isVolatile) 1323</pre> 1324 1325Specify whether <a href="#Path">Path</a> is volatile; whether it will be altered or discarded 1326by the caller after it is drawn. <a href="#Path">Paths</a> by default have volatile set false, allowing 1327<a href="undocumented#Device">Device</a> to attach a cache of data which speeds repeated drawing. 1328 1329Mark temporary paths, discarded or modified after use, as volatile 1330to inform <a href="undocumented#Device">Device</a> that the path need not be cached. 1331 1332Mark animating <a href="#Path">Path</a> volatile to improve performance. 1333Mark unchanging <a href="#Path">Path</a> non-volatile to improve repeated rendering. 1334 1335<a href="undocumented#Raster_Surface">Raster Surface</a> <a href="#Path">Path</a> draws are affected by volatile for some shadows. 1336<a href="undocumented#GPU_Surface">GPU Surface</a> <a href="#Path">Path</a> draws are affected by volatile for some shadows and concave geometries. 1337 1338### Parameters 1339 1340<table> <tr> <td><a name="SkPath_setIsVolatile_isVolatile"> <code><strong>isVolatile </strong></code> </a></td> <td> 1341true if caller will alter <a href="#Path">Path</a> after drawing</td> 1342 </tr> 1343</table> 1344 1345### Example 1346 1347<div><fiddle-embed name="2049ff5141f0c80aac497618622b28af"></fiddle-embed></div> 1348 1349### See Also 1350 1351<a href="#SkPath_isVolatile">isVolatile</a> 1352 1353--- 1354 1355<a name="SkPath_IsLineDegenerate"></a> 1356## IsLineDegenerate 1357 1358<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1359static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact) 1360</pre> 1361 1362Test if <a href="undocumented#Line">Line</a> between <a href="SkPoint_Reference#Point">Point</a> pair is degenerate. 1363<a href="undocumented#Line">Line</a> with no length or that moves a very short distance is degenerate; it is 1364treated as a point. 1365 1366<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>. 1367If false, returns true if <a href="#SkPath_IsLineDegenerate_p1">p1</a> equals or nearly equals <a href="#SkPath_IsLineDegenerate_p2">p2</a>. 1368 1369### Parameters 1370 1371<table> <tr> <td><a name="SkPath_IsLineDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> 1372line start point</td> 1373 </tr> <tr> <td><a name="SkPath_IsLineDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> 1374line end point</td> 1375 </tr> <tr> <td><a name="SkPath_IsLineDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> 1376if false, allow nearly equals</td> 1377 </tr> 1378</table> 1379 1380### Return Value 1381 1382true if <a href="undocumented#Line">Line</a> is degenerate; its length is effectively zero 1383 1384### Example 1385 1386<div><fiddle-embed name="97a031f9186ade586928563840ce9116"><div>As single precision floats, 100 and 100.000001 have the same bit representation, 1387and are exactly equal. 100 and 100.0001 have different bit representations, and 1388are not exactly equal, but are nearly equal.</div> 1389 1390#### Example Output 1391 1392~~~~ 1393line from (100,100) to (100,100) is degenerate, nearly 1394line from (100,100) to (100,100) is degenerate, exactly 1395line from (100,100) to (100.0001,100.0001) is degenerate, nearly 1396line from (100,100) to (100.0001,100.0001) is not degenerate, exactly 1397~~~~ 1398 1399</fiddle-embed></div> 1400 1401### See Also 1402 1403<a href="#SkPath_IsQuadDegenerate">IsQuadDegenerate</a> <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> 1404 1405--- 1406 1407<a name="SkPath_IsQuadDegenerate"></a> 1408## IsQuadDegenerate 1409 1410<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1411static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3, bool exact) 1412</pre> 1413 1414Test if <a href="#Quad">Quad</a> is degenerate. 1415<a href="#Quad">Quad</a> with no length or that moves a very short distance is degenerate; it is 1416treated as a point. 1417 1418### Parameters 1419 1420<table> <tr> <td><a name="SkPath_IsQuadDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> 1421<a href="#Quad">Quad</a> start point</td> 1422 </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> 1423<a href="#Quad">Quad</a> control point</td> 1424 </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_p3"> <code><strong>p3 </strong></code> </a></td> <td> 1425<a href="#Quad">Quad</a> end point</td> 1426 </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> 1427if 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; 1428if 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</td> 1429 </tr> 1430</table> 1431 1432### Return Value 1433 1434true if <a href="#Quad">Quad</a> is degenerate; its length is effectively zero 1435 1436### Example 1437 1438<div><fiddle-embed name="1d50896c528cd4581966646b7d96acff"><div>As single precision floats: 100, 100.00001, and 100.00002 have different bit representations 1439but nearly the same value. Translating all three by 1000 gives them the same bit representation; 1440the fractional portion of the number can not be represented by the float and is lost.</div> 1441 1442#### Example Output 1443 1444~~~~ 1445quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is degenerate, nearly 1446quad (1100,1100), (1100,1100), (1100,1100) is degenerate, nearly 1447quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is not degenerate, exactly 1448quad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly 1449~~~~ 1450 1451</fiddle-embed></div> 1452 1453### See Also 1454 1455<a href="#SkPath_IsLineDegenerate">IsLineDegenerate</a> <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> 1456 1457--- 1458 1459<a name="SkPath_IsCubicDegenerate"></a> 1460## IsCubicDegenerate 1461 1462<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1463static bool IsCubicDegenerate(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3, 1464 const SkPoint& p4, bool exact) 1465</pre> 1466 1467Test if <a href="#Cubic">Cubic</a> is degenerate. 1468<a href="#Cubic">Cubic</a> with no length or that moves a very short distance is degenerate; it is 1469treated as a point. 1470 1471### Parameters 1472 1473<table> <tr> <td><a name="SkPath_IsCubicDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> 1474<a href="#Cubic">Cubic</a> start point</td> 1475 </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> 1476<a href="#Cubic">Cubic</a> control point 1</td> 1477 </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p3"> <code><strong>p3 </strong></code> </a></td> <td> 1478<a href="#Cubic">Cubic</a> control point 2</td> 1479 </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p4"> <code><strong>p4 </strong></code> </a></td> <td> 1480<a href="#Cubic">Cubic</a> end point</td> 1481 </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> 1482if 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; 1483if 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</td> 1484 </tr> 1485</table> 1486 1487### Return Value 1488 1489true if <a href="#Cubic">Cubic</a> is degenerate; its length is effectively zero 1490 1491### Example 1492 1493<div><fiddle-embed name="c79d813f0b37062cb2f7a0c83f4a09f3"> 1494 1495#### Example Output 1496 1497~~~~ 14980.00024414062 is degenerate 14990.00024414065 is length 1500~~~~ 1501 1502</fiddle-embed></div> 1503 1504--- 1505 1506<a name="SkPath_isLine"></a> 1507## isLine 1508 1509<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1510bool isLine(SkPoint line[2]) const 1511</pre> 1512 1513Returns true if <a href="#Path">Path</a> contains only one <a href="undocumented#Line">Line</a>; 1514<a href="#Verb">Path Verb</a> array has two entries: <a href="#SkPath_kMove_Verb">kMove Verb</a>, <a href="#SkPath_kLine_Verb">kLine Verb</a>. 1515If <a href="#Path">Path</a> contains one <a href="undocumented#Line">Line</a> and <a href="#SkPath_isLine_line">line</a> is not nullptr, <a href="#SkPath_isLine_line">line</a> is set to 1516<a href="undocumented#Line">Line</a> start point and <a href="undocumented#Line">Line</a> end point. 1517Returns false if <a href="#Path">Path</a> is not one <a href="undocumented#Line">Line</a>; <a href="#SkPath_isLine_line">line</a> is unaltered. 1518 1519### Parameters 1520 1521<table> <tr> <td><a name="SkPath_isLine_line"> <code><strong>line </strong></code> </a></td> <td> 1522storage for <a href="undocumented#Line">Line</a>. May be nullptr</td> 1523 </tr> 1524</table> 1525 1526### Return Value 1527 1528true if <a href="#Path">Path</a> contains exactly one <a href="undocumented#Line">Line</a> 1529 1530### Example 1531 1532<div><fiddle-embed name="1ad07d56e4258e041606d50cad969392"> 1533 1534#### Example Output 1535 1536~~~~ 1537empty is not line 1538zero line is line (0,0) (0,0) 1539line is line (10,10) (20,20) 1540second move is not line 1541~~~~ 1542 1543</fiddle-embed></div> 1544 1545--- 1546 1547## <a name="Point_Array"></a> Point Array 1548 1549<a href="#Point_Array">Point Array</a> contains <a href="#Point">Points</a> satisfying the allocated <a href="#Point">Points</a> for 1550each <a href="#SkPath_Verb">Verb</a> in <a href="#Verb_Array">Verb Array</a>. For instance, <a href="#Path">Path</a> containing one <a href="#Contour">Contour</a> with <a href="undocumented#Line">Line</a> 1551and <a href="#Quad">Quad</a> is described by <a href="#Verb_Array">Verb Array</a>: Verb::kMoveTo, Verb::kLineTo, Verb::kQuadTo; and 1552one <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="#Point">Points</a> for <a href="#Quad">Quad</a>; totaling four <a href="#Point">Points</a>. 1553 1554<a href="#Point_Array">Point Array</a> may be read directly from <a href="#Path">Path</a> with <a href="#SkPath_getPoints">getPoints</a>, or inspected with 1555<a href="#SkPath_getPoint">getPoint</a>, with <a href="#SkPath_Iter">Iter</a>, or with <a href="#SkPath_RawIter">RawIter</a>. 1556 1557<a name="SkPath_getPoints"></a> 1558## getPoints 1559 1560<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1561int getPoints(SkPoint points[], int max) const 1562</pre> 1563 1564Returns number of <a href="#SkPath_getPoints_points">points</a> in <a href="#Path">Path</a>. Up to <a href="#SkPath_getPoints_max">max</a> <a href="#SkPath_getPoints_points">points</a> are copied. 1565<a href="#SkPath_getPoints_points">points</a> may be nullptr; then, <a href="#SkPath_getPoints_max">max</a> must be zero. 1566If <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. 1567 1568### Parameters 1569 1570<table> <tr> <td><a name="SkPath_getPoints_points"> <code><strong>points </strong></code> </a></td> <td> 1571storage for <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> array. May be nullptr</td> 1572 </tr> <tr> <td><a name="SkPath_getPoints_max"> <code><strong>max </strong></code> </a></td> <td> 1573maximum to copy; must be greater than or equal to zero</td> 1574 </tr> 1575</table> 1576 1577### Return Value 1578 1579<a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> array length 1580 1581### Example 1582 1583<div><fiddle-embed name="9bc86efda08cbcd9c6f7c5f220294a24"> 1584 1585#### Example Output 1586 1587~~~~ 1588no points point count: 3 1589zero max point count: 3 1590too small point count: 3 (0,0) (20,20) 1591just right point count: 3 (0,0) (20,20) (-10,-10) 1592~~~~ 1593 1594</fiddle-embed></div> 1595 1596### See Also 1597 1598<a href="#SkPath_countPoints">countPoints</a> <a href="#SkPath_getPoint">getPoint</a> 1599 1600--- 1601 1602<a name="SkPath_countPoints"></a> 1603## countPoints 1604 1605<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1606int countPoints() const 1607</pre> 1608 1609Returns the number of points in <a href="#Path">Path</a>. 1610<a href="SkPoint_Reference#Point">Point</a> count is initially zero. 1611 1612### Return Value 1613 1614<a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> array length 1615 1616### Example 1617 1618<div><fiddle-embed name="bca6379ccef62cb081b10db7381deb27"> 1619 1620#### Example Output 1621 1622~~~~ 1623empty point count: 0 1624zero line point count: 2 1625line point count: 2 1626second move point count: 3 1627~~~~ 1628 1629</fiddle-embed></div> 1630 1631### See Also 1632 1633<a href="#SkPath_getPoints">getPoints</a> 1634 1635--- 1636 1637<a name="SkPath_getPoint"></a> 1638## getPoint 1639 1640<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1641SkPoint getPoint(int index) const 1642</pre> 1643 1644Returns <a href="SkPoint_Reference#Point">Point</a> at <a href="#SkPath_getPoint_index">index</a> in <a href="#Point_Array">Point Array</a>. Valid range for <a href="#SkPath_getPoint_index">index</a> is 16450 to <a href="#SkPath_countPoints">countPoints</a> - 1. 1646Returns (0, 0) if <a href="#SkPath_getPoint_index">index</a> is out of range. 1647 1648### Parameters 1649 1650<table> <tr> <td><a name="SkPath_getPoint_index"> <code><strong>index </strong></code> </a></td> <td> 1651<a href="SkPoint_Reference#Point">Point</a> array element selector</td> 1652 </tr> 1653</table> 1654 1655### Return Value 1656 1657<a href="SkPoint_Reference#Point">Point</a> array value or (0, 0) 1658 1659### Example 1660 1661<div><fiddle-embed name="1cf6b8dd2994c4ca9a2d6887ff888017"> 1662 1663#### Example Output 1664 1665~~~~ 1666point 0: (-10,-10) 1667point 1: (10,10) 1668~~~~ 1669 1670</fiddle-embed></div> 1671 1672### See Also 1673 1674<a href="#SkPath_countPoints">countPoints</a> <a href="#SkPath_getPoints">getPoints</a> 1675 1676--- 1677 1678## <a name="Verb_Array"></a> Verb Array 1679 1680<a href="#Verb_Array">Verb Array</a> always starts with <a href="#SkPath_kMove_Verb">kMove Verb</a>. 1681If <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>; 1682the quantity of <a href="#SkPath_kMove_Verb">kMove Verb</a> equals the <a href="#Contour">Contour</a> count. 1683<a href="#Verb_Array">Verb Array</a> does not include or count <a href="#SkPath_kDone_Verb">kDone Verb</a>; it is a convenience 1684returned when iterating through <a href="#Verb_Array">Verb Array</a>. 1685 1686<a href="#Verb_Array">Verb Array</a> may be read directly from <a href="#Path">Path</a> with <a href="#SkPath_getVerbs">getVerbs</a>, or inspected with <a href="#SkPath_Iter">Iter</a>, 1687or with <a href="#SkPath_RawIter">RawIter</a>. 1688 1689<a name="SkPath_countVerbs"></a> 1690## countVerbs 1691 1692<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1693int countVerbs() const 1694</pre> 1695 1696Returns the number of <a href="#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>, 1697<a href="#SkPath_kCubic_Verb">kCubic Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>; added to <a href="#Path">Path</a>. 1698 1699### Return Value 1700 1701length of <a href="#Verb_Array">Verb Array</a> 1702 1703### Example 1704 1705<div><fiddle-embed name="af0c66aea3ef81b709664c7007f48aae"> 1706 1707#### Example Output 1708 1709~~~~ 1710empty verb count: 0 1711round rect verb count: 10 1712~~~~ 1713 1714</fiddle-embed></div> 1715 1716### See Also 1717 1718<a href="#SkPath_getVerbs">getVerbs</a> <a href="#SkPath_Iter">Iter</a> <a href="#SkPath_RawIter">RawIter</a> 1719 1720--- 1721 1722<a name="SkPath_getVerbs"></a> 1723## getVerbs 1724 1725<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1726int getVerbs(uint8_t verbs[], int max) const 1727</pre> 1728 1729Returns the number of <a href="#SkPath_getVerbs_verbs">verbs</a> in the path. Up to <a href="#SkPath_getVerbs_max">max</a> <a href="#SkPath_getVerbs_verbs">verbs</a> are copied. The 1730<a href="#SkPath_getVerbs_verbs">verbs</a> are copied as one byte per verb. 1731 1732### Parameters 1733 1734<table> <tr> <td><a name="SkPath_getVerbs_verbs"> <code><strong>verbs </strong></code> </a></td> <td> 1735storage for <a href="#SkPath_getVerbs_verbs">verbs</a>, may be nullptr</td> 1736 </tr> <tr> <td><a name="SkPath_getVerbs_max"> <code><strong>max </strong></code> </a></td> <td> 1737maximum number to copy into <a href="#SkPath_getVerbs_verbs">verbs</a></td> 1738 </tr> 1739</table> 1740 1741### Return Value 1742 1743the actual number of <a href="#SkPath_getVerbs_verbs">verbs</a> in the path 1744 1745### Example 1746 1747<div><fiddle-embed name="2ec66880966a6133ddd9331ce7323438"> 1748 1749#### Example Output 1750 1751~~~~ 1752no verbs verb count: 3 1753zero max verb count: 3 1754too small verb count: 3 move line 1755just right verb count: 3 move line line 1756~~~~ 1757 1758</fiddle-embed></div> 1759 1760### See Also 1761 1762<a href="#SkPath_countVerbs">countVerbs</a> <a href="#SkPath_getPoints">getPoints</a> <a href="#SkPath_Iter">Iter</a> <a href="#SkPath_RawIter">RawIter</a> 1763 1764--- 1765 1766<a name="SkPath_swap"></a> 1767## swap 1768 1769<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1770void swap(SkPath& other) 1771</pre> 1772 1773Exchanges the <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Weight">Weights</a>, and <a href="#Fill_Type">Fill Type</a> with <a href="#SkPath_swap_other">other</a>. 1774Cached state is also exchanged. <a href="#SkPath_swap">swap</a> internally exchanges pointers, so 1775it is lightweight and does not allocate memory. 1776 1777<a href="#SkPath_swap">swap</a> usage has largely been replaced by <a href="#SkPath_copy_operator">operator=(const SkPath& path)</a>. 1778<a href="#Path">Paths</a> do not copy their content on assignment until they are written to, 1779making assignment as efficient as <a href="#SkPath_swap">swap</a>. 1780 1781### Parameters 1782 1783<table> <tr> <td><a name="SkPath_swap_other"> <code><strong>other </strong></code> </a></td> <td> 1784<a href="#Path">Path</a> exchanged by value</td> 1785 </tr> 1786</table> 1787 1788### Example 1789 1790<div><fiddle-embed name="4c5ebee2b5039e5faefa07ae63a15467"> 1791 1792#### Example Output 1793 1794~~~~ 1795path1 bounds = 0, 0, 0, 0 1796path2 bounds = 10, 20, 30, 40 1797~~~~ 1798 1799</fiddle-embed></div> 1800 1801### See Also 1802 1803<a href="#SkPath_copy_operator">operator=(const SkPath& path)</a> 1804 1805--- 1806 1807<a name="SkPath_getBounds"></a> 1808## getBounds 1809 1810<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1811const SkRect& getBounds() const 1812</pre> 1813 1814Returns minimum and maximum x and y values of <a href="#Point_Array">Point Array</a>. 1815Returns (0, 0, 0, 0) if <a href="#Path">Path</a> contains no points. Returned bounds width and height may 1816be larger or smaller than area affected when <a href="#Path">Path</a> is drawn. 1817 1818<a href="SkRect_Reference#Rect">Rect</a> returned includes all <a href="#Point">Points</a> added to <a href="#Path">Path</a>, including <a href="#Point">Points</a> associated with 1819<a href="#SkPath_kMove_Verb">kMove Verb</a> that define empty <a href="#Contour">Contours</a>. 1820 1821### Return Value 1822 1823bounds of all <a href="#Point">Points</a> in <a href="#Point_Array">Point Array</a> 1824 1825### Example 1826 1827<div><fiddle-embed name="9160aa6d1476bd87d927cfc8a4bf25e7"><div>Bounds of upright <a href="undocumented#Circle">Circle</a> can be predicted from center and radius. 1828Bounds of rotated <a href="undocumented#Circle">Circle</a> includes control <a href="#Point">Points</a> outside of filled area.</div> 1829 1830#### Example Output 1831 1832~~~~ 1833empty bounds = 0, 0, 0, 0 1834circle bounds = 25, 20, 75, 70 1835rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553 1836~~~~ 1837 1838</fiddle-embed></div> 1839 1840### See Also 1841 1842<a href="#SkPath_computeTightBounds">computeTightBounds</a> <a href="#SkPath_updateBoundsCache">updateBoundsCache</a> 1843 1844--- 1845 1846<a name="SkPath_updateBoundsCache"></a> 1847## updateBoundsCache 1848 1849<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1850void updateBoundsCache() const 1851</pre> 1852 1853Update internal bounds so that subsequent calls to <a href="#SkPath_getBounds">getBounds</a> are instantaneous. 1854Unaltered copies of <a href="#Path">Path</a> may also access cached bounds through <a href="#SkPath_getBounds">getBounds</a>. 1855 1856For now, identical to calling <a href="#SkPath_getBounds">getBounds</a> and ignoring the returned value. 1857 1858Call to prepare <a href="#Path">Path</a> subsequently drawn from multiple threads, 1859to avoid a race condition where each draw separately computes the bounds. 1860 1861### Example 1862 1863<div><fiddle-embed name="bb761cd858e6d0ca05627262cd22ff5e"> 1864 1865#### Example Output 1866 1867~~~~ 1868#Volatile 1869uncached avg: 0.18048 ms 1870cached avg: 0.182784 ms 1871~~~~ 1872 1873</fiddle-embed></div> 1874 1875### See Also 1876 1877<a href="#SkPath_getBounds">getBounds</a> 1878 1879--- 1880 1881<a name="SkPath_computeTightBounds"></a> 1882## computeTightBounds 1883 1884<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1885SkRect computeTightBounds() const 1886</pre> 1887 1888Returns minimum and maximum x and y values of the lines and curves in <a href="#Path">Path</a>. 1889Returns (0, 0, 0, 0) if <a href="#Path">Path</a> contains no points. 1890Returned bounds width and height may be larger or smaller than area affected 1891when <a href="#Path">Path</a> is drawn. 1892 1893Includes <a href="#Point">Points</a> associated with <a href="#SkPath_kMove_Verb">kMove Verb</a> that define empty 1894<a href="#Contour">Contours</a>. 1895 1896Behaves identically to <a href="#SkPath_getBounds">getBounds</a> when <a href="#Path">Path</a> contains 1897only lines. If <a href="#Path">Path</a> contains curves, computed bounds includes 1898the maximum extent of the <a href="#Quad">Quad</a>, <a href="#Conic">Conic</a>, or <a href="#Cubic">Cubic</a>; is slower than <a href="#SkPath_getBounds">getBounds</a>; 1899and unlike <a href="#SkPath_getBounds">getBounds</a>, does not cache the result. 1900 1901### Return Value 1902 1903tight bounds of curves in <a href="#Path">Path</a> 1904 1905### Example 1906 1907<div><fiddle-embed name="da34f02e69ec98d5681300aea9a2d0bf"> 1908 1909#### Example Output 1910 1911~~~~ 1912empty bounds = 0, 0, 0, 0 1913circle bounds = 25, 20, 75, 70 1914rotated circle bounds = 25, 20, 75, 70 1915~~~~ 1916 1917</fiddle-embed></div> 1918 1919### See Also 1920 1921<a href="#SkPath_getBounds">getBounds</a> 1922 1923--- 1924 1925<a name="SkPath_conservativelyContainsRect"></a> 1926## conservativelyContainsRect 1927 1928<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1929bool conservativelyContainsRect(const SkRect& rect) const 1930</pre> 1931 1932Returns true if <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained by <a href="#Path">Path</a>. 1933May return false when <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained by <a href="#Path">Path</a>. 1934 1935For now, only returns true if <a href="#Path">Path</a> has one <a href="#Contour">Contour</a> and is convex. 1936<a href="#SkPath_conservativelyContainsRect_rect">rect</a> may share points and edges with <a href="#Path">Path</a> and be contained. 1937Returns true if <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is empty, that is, it has zero width or height; and 1938the <a href="SkPoint_Reference#Point">Point</a> or <a href="undocumented#Line">Line</a> described by <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained by <a href="#Path">Path</a>. 1939 1940### Parameters 1941 1942<table> <tr> <td><a name="SkPath_conservativelyContainsRect_rect"> <code><strong>rect </strong></code> </a></td> <td> 1943<a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Line">Line</a>, or <a href="SkPoint_Reference#Point">Point</a> checked for containment</td> 1944 </tr> 1945</table> 1946 1947### Return Value 1948 1949true if <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained 1950 1951### Example 1952 1953<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="#Path">Path</a>.</div></fiddle-embed></div> 1954 1955### See Also 1956 1957<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> 1958 1959--- 1960 1961<a name="SkPath_incReserve"></a> 1962## incReserve 1963 1964<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1965void incReserve(unsigned extraPtCount) 1966</pre> 1967 1968grows <a href="#Path">Path</a> <a href="#Verb_Array">Verb Array</a> and <a href="#Point_Array">Point Array</a> to contain <a href="#SkPath_incReserve_extraPtCount">extraPtCount</a> additional <a href="#Point">Points</a>. 1969May improve performance and use less memory by 1970reducing the number and size of allocations when creating <a href="#Path">Path</a>. 1971 1972### Parameters 1973 1974<table> <tr> <td><a name="SkPath_incReserve_extraPtCount"> <code><strong>extraPtCount </strong></code> </a></td> <td> 1975number of additional <a href="#Point">Points</a> to allocate</td> 1976 </tr> 1977</table> 1978 1979### Example 1980 1981<div><fiddle-embed name="f2260f2a170a54aef5bafe5b91c121b3"></fiddle-embed></div> 1982 1983### See Also 1984 1985<a href="#Point_Array">Point Array</a> 1986 1987--- 1988 1989<a name="SkPath_moveTo"></a> 1990## moveTo 1991 1992<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 1993void moveTo(SkScalar x, SkScalar y) 1994</pre> 1995 1996Adds beginning of <a href="#Contour">Contour</a> at <a href="SkPoint_Reference#Point">Point</a> (<a href="#SkPath_moveTo_x">x</a>, <a href="#SkPath_moveTo_y">y</a>). 1997 1998### Parameters 1999 2000<table> <tr> <td><a name="SkPath_moveTo_x"> <code><strong>x </strong></code> </a></td> <td> 2001<a href="#SkPath_moveTo_x">x</a>-coordinate of <a href="#Contour">Contour</a> start</td> 2002 </tr> <tr> <td><a name="SkPath_moveTo_y"> <code><strong>y </strong></code> </a></td> <td> 2003<a href="#SkPath_moveTo_y">y</a>-coordinate of <a href="#Contour">Contour</a> start</td> 2004 </tr> 2005</table> 2006 2007### Example 2008 2009<div><fiddle-embed name="84101d341e934a535a41ad6cf42218ce"></fiddle-embed></div> 2010 2011### See Also 2012 2013<a href="#Contour">Contour</a> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_rMoveTo">rMoveTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_close">close</a> 2014 2015--- 2016 2017<a name="SkPath_moveTo_2"></a> 2018 2019<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2020void moveTo(const SkPoint& p) 2021</pre> 2022 2023Adds beginning of <a href="#Contour">Contour</a> at <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_moveTo_2_p">p</a>. 2024 2025### Parameters 2026 2027<table> <tr> <td><a name="SkPath_moveTo_2_p"> <code><strong>p </strong></code> </a></td> <td> 2028contour start</td> 2029 </tr> 2030</table> 2031 2032### Example 2033 2034<div><fiddle-embed name="53b351d3fac667a4803418238e44a593"></fiddle-embed></div> 2035 2036### See Also 2037 2038<a href="#Contour">Contour</a> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_rMoveTo">rMoveTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_close">close</a> 2039 2040--- 2041 2042<a name="SkPath_rMoveTo"></a> 2043## rMoveTo 2044 2045<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2046void rMoveTo(SkScalar dx, SkScalar dy) 2047</pre> 2048 2049Adds beginning of <a href="#Contour">Contour</a> relative to <a href="#Last_Point">Last Point</a>. 2050If <a href="#Path">Path</a> is empty, starts <a href="#Contour">Contour</a> at (<a href="#SkPath_rMoveTo_dx">dx</a>, <a href="#SkPath_rMoveTo_dy">dy</a>). 2051Otherwise, start <a href="#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>). 2052Function name stands for "relative move to". 2053 2054### Parameters 2055 2056<table> <tr> <td><a name="SkPath_rMoveTo_dx"> <code><strong>dx </strong></code> </a></td> <td> 2057offset from <a href="#Last_Point">Last Point</a> x to <a href="#Contour">Contour</a> start x</td> 2058 </tr> <tr> <td><a name="SkPath_rMoveTo_dy"> <code><strong>dy </strong></code> </a></td> <td> 2059offset from <a href="#Last_Point">Last Point</a> y to <a href="#Contour">Contour</a> start y</td> 2060 </tr> 2061</table> 2062 2063### Example 2064 2065<div><fiddle-embed name="63e32dec4b2d8440b427f368bf8313a4"></fiddle-embed></div> 2066 2067### See Also 2068 2069<a href="#Contour">Contour</a> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_close">close</a> 2070 2071--- 2072 2073<a name="SkPath_lineTo"></a> 2074## lineTo 2075 2076<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2077void lineTo(SkScalar x, SkScalar y) 2078</pre> 2079 2080Adds <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="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is 2081<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>. 2082 2083<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="#Point_Array">Point Array</a>, if needed. 2084<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="#Point_Array">Point Array</a>. 2085 2086### Parameters 2087 2088<table> <tr> <td><a name="SkPath_lineTo_x"> <code><strong>x </strong></code> </a></td> <td> 2089end of added <a href="undocumented#Line">Line</a> in <a href="#SkPath_lineTo_x">x</a></td> 2090 </tr> <tr> <td><a name="SkPath_lineTo_y"> <code><strong>y </strong></code> </a></td> <td> 2091end of added <a href="undocumented#Line">Line</a> in <a href="#SkPath_lineTo_y">y</a></td> 2092 </tr> 2093</table> 2094 2095### Example 2096 2097<div><fiddle-embed name="e311cdd451edacec33b50cc22a4dd5dc"></fiddle-embed></div> 2098 2099### See Also 2100 2101<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rLineTo">rLineTo</a> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> 2102 2103--- 2104 2105<a name="SkPath_lineTo_2"></a> 2106 2107<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2108void lineTo(const SkPoint& p) 2109</pre> 2110 2111Adds <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_lineTo_2_p">p</a>. If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is 2112<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>. 2113 2114<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="#Point_Array">Point Array</a>, if needed. 2115<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#Point">Point</a> <a href="#SkPath_lineTo_2_p">p</a> to <a href="#Point_Array">Point Array</a>. 2116 2117### Parameters 2118 2119<table> <tr> <td><a name="SkPath_lineTo_2_p"> <code><strong>p </strong></code> </a></td> <td> 2120end <a href="SkPoint_Reference#Point">Point</a> of added <a href="undocumented#Line">Line</a></td> 2121 </tr> 2122</table> 2123 2124### Example 2125 2126<div><fiddle-embed name="41001546a7f7927d08e5a818bcc304f5"></fiddle-embed></div> 2127 2128### See Also 2129 2130<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rLineTo">rLineTo</a> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> 2131 2132--- 2133 2134<a name="SkPath_rLineTo"></a> 2135## rLineTo 2136 2137<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2138void rLineTo(SkScalar dx, SkScalar dy) 2139</pre> 2140 2141Adds <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="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> is 2142<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>. 2143 2144Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; 2145then 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="#Point_Array">Point Array</a>. 2146<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>). 2147Function name stands for "relative line to". 2148 2149### Parameters 2150 2151<table> <tr> <td><a name="SkPath_rLineTo_dx"> <code><strong>dx </strong></code> </a></td> <td> 2152offset from <a href="#Last_Point">Last Point</a> x to <a href="undocumented#Line">Line</a> end x</td> 2153 </tr> <tr> <td><a name="SkPath_rLineTo_dy"> <code><strong>dy </strong></code> </a></td> <td> 2154offset from <a href="#Last_Point">Last Point</a> y to <a href="undocumented#Line">Line</a> end y</td> 2155 </tr> 2156</table> 2157 2158### Example 2159 2160<div><fiddle-embed name="6e0be0766b8ca320da51640326e608b3"></fiddle-embed></div> 2161 2162### See Also 2163 2164<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_lineTo">lineTo</a><sup><a href="#SkPath_lineTo_2">[2]</a></sup> <a href="#SkPath_addRect">addRect</a><sup><a href="#SkPath_addRect_2">[2]</a></sup><sup><a href="#SkPath_addRect_3">[3]</a></sup> 2165 2166--- 2167 2168# <a name="Quad"></a> Quad 2169<a href="#Quad">Quad</a> describes a quadratic Bezier, a second-order curve identical to a section 2170of a parabola. <a href="#Quad">Quad</a> begins at a start <a href="SkPoint_Reference#Point">Point</a>, curves towards a control <a href="SkPoint_Reference#Point">Point</a>, 2171and then curves to an end <a href="SkPoint_Reference#Point">Point</a>. 2172 2173### Example 2174 2175<div><fiddle-embed name="78ad51fa1cd33eb84a6f99061e56e067"></fiddle-embed></div> 2176 2177<a href="#Quad">Quad</a> is a special case of <a href="#Conic">Conic</a> where <a href="#Conic_Weight">Conic Weight</a> is set to one. 2178 2179<a href="#Quad">Quad</a> is always contained by the triangle connecting its three <a href="#Point">Points</a>. <a href="#Quad">Quad</a> 2180begins tangent to the line between start <a href="SkPoint_Reference#Point">Point</a> and control <a href="SkPoint_Reference#Point">Point</a>, and ends 2181tangent to the line between control <a href="SkPoint_Reference#Point">Point</a> and end <a href="SkPoint_Reference#Point">Point</a>. 2182 2183### Example 2184 2185<div><fiddle-embed name="4082f66a42df11bb20462b232b156bb6"></fiddle-embed></div> 2186 2187<a name="SkPath_quadTo"></a> 2188## quadTo 2189 2190<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2191void quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2) 2192</pre> 2193 2194Adds <a href="#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>). 2195If <a href="#Path">Path</a> is empty, or last <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) 2196before adding <a href="#Quad">Quad</a>. 2197 2198Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; 2199then 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>) 2200to <a href="#Point_Array">Point Array</a>. 2201 2202### Parameters 2203 2204<table> <tr> <td><a name="SkPath_quadTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> 2205control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in x</td> 2206 </tr> <tr> <td><a name="SkPath_quadTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> 2207control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in y</td> 2208 </tr> <tr> <td><a name="SkPath_quadTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> 2209end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in x</td> 2210 </tr> <tr> <td><a name="SkPath_quadTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> 2211end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Quad">Quad</a> in y</td> 2212 </tr> 2213</table> 2214 2215### Example 2216 2217<div><fiddle-embed name="60ee3eb747474f5781b0f0dd3a17a866"></fiddle-embed></div> 2218 2219### See Also 2220 2221<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_rQuadTo">rQuadTo</a> 2222 2223--- 2224 2225<a name="SkPath_quadTo_2"></a> 2226 2227<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2228void quadTo(const SkPoint& p1, const SkPoint& p2) 2229</pre> 2230 2231Adds <a href="#Quad">Quad</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_quadTo_2_p1">p1</a>, to <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_quadTo_2_p2">p2</a>. 2232If <a href="#Path">Path</a> is empty, or last <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) 2233before adding <a href="#Quad">Quad</a>. 2234 2235Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; 2236then appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>; and <a href="#Point">Points</a> <a href="#SkPath_quadTo_2_p1">p1</a>, <a href="#SkPath_quadTo_2_p2">p2</a> 2237to <a href="#Point_Array">Point Array</a>. 2238 2239### Parameters 2240 2241<table> <tr> <td><a name="SkPath_quadTo_2_p1"> <code><strong>p1 </strong></code> </a></td> <td> 2242control <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Quad">Quad</a></td> 2243 </tr> <tr> <td><a name="SkPath_quadTo_2_p2"> <code><strong>p2 </strong></code> </a></td> <td> 2244end <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Quad">Quad</a></td> 2245 </tr> 2246</table> 2247 2248### Example 2249 2250<div><fiddle-embed name="82621c4df8da1e589d9e627494067826"></fiddle-embed></div> 2251 2252### See Also 2253 2254<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_rQuadTo">rQuadTo</a> 2255 2256--- 2257 2258<a name="SkPath_rQuadTo"></a> 2259## rQuadTo 2260 2261<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2262void rQuadTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2) 2263</pre> 2264 2265Adds <a href="#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>). 2266If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> 2267is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="#Quad">Quad</a>. 2268 2269Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, 2270if needed; then appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href="#Verb_Array">Verb Array</a>; and appends <a href="#Quad">Quad</a> 2271control and <a href="#Quad">Quad</a> end to <a href="#Point_Array">Point Array</a>. 2272<a href="#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>). 2273<a href="#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>). 2274Function name stands for "relative quad to". 2275 2276### Parameters 2277 2278<table> <tr> <td><a name="SkPath_rQuadTo_dx1"> <code><strong>dx1 </strong></code> </a></td> <td> 2279offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> control x</td> 2280 </tr> <tr> <td><a name="SkPath_rQuadTo_dy1"> <code><strong>dy1 </strong></code> </a></td> <td> 2281offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> control y</td> 2282 </tr> <tr> <td><a name="SkPath_rQuadTo_dx2"> <code><strong>dx2 </strong></code> </a></td> <td> 2283offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> end x</td> 2284 </tr> <tr> <td><a name="SkPath_rQuadTo_dy2"> <code><strong>dy2 </strong></code> </a></td> <td> 2285offset from <a href="#Last_Point">Last Point</a> x to <a href="#Quad">Quad</a> end y</td> 2286 </tr> 2287</table> 2288 2289### Example 2290 2291<div><fiddle-embed name="1c1f4cdef1c572c9aa8fdf3e461191d0"></fiddle-embed></div> 2292 2293### See Also 2294 2295<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> 2296 2297--- 2298 2299# <a name="Conic"></a> Conic 2300<a href="#Conic">Conic</a> describes a conical section: a piece of an ellipse, or a piece of a 2301parabola, or a piece of a hyperbola. <a href="#Conic">Conic</a> begins at a start <a href="SkPoint_Reference#Point">Point</a>, 2302curves towards a control <a href="SkPoint_Reference#Point">Point</a>, and then curves to an end <a href="SkPoint_Reference#Point">Point</a>. The influence 2303of the control <a href="SkPoint_Reference#Point">Point</a> is determined by <a href="#Conic_Weight">Conic Weight</a>. 2304 2305Each <a href="#Conic">Conic</a> in <a href="#Path">Path</a> adds two <a href="#Point">Points</a> and one <a href="#Conic_Weight">Conic Weight</a>. <a href="#Weight">Conic Weights</a> in <a href="#Path">Path</a> 2306may be inspected with <a href="#SkPath_Iter">Iter</a>, or with <a href="#SkPath_RawIter">RawIter</a>. 2307 2308## <a name="Weight"></a> Weight 2309 2310<a href="#Conic_Weight">Weight</a> determines both the strength of the control <a href="SkPoint_Reference#Point">Point</a> and the type of <a href="#Conic">Conic</a>. 2311If <a href="#Conic_Weight">Weight</a> is exactly one, then <a href="#Conic">Conic</a> is identical to <a href="#Quad">Quad</a>; it is always a 2312parabolic segment. 2313 2314### Example 2315 2316<div><fiddle-embed name="2aadded3d20dfef34d1c8abe28c7bc8d"><div>When <a href="#Conic_Weight">Conic Weight</a> is one, <a href="#Quad">Quad</a> is added to path; the two are identical.</div> 2317 2318#### Example Output 2319 2320~~~~ 2321move {0, 0}, 2322quad {0, 0}, {20, 30}, {50, 60}, 2323done 2324~~~~ 2325 2326</fiddle-embed></div> 2327 2328If weight is less than one, <a href="#Conic">Conic</a> is an elliptical segment. 2329 2330### Example 2331 2332<div><fiddle-embed name="e88f554efacfa9f75f270fb1c0add5b4"><div>A 90 degree circular arc has the weight1 / sqrt(2).</div> 2333 2334#### Example Output 2335 2336~~~~ 2337move {0, 0}, 2338conic {0, 0}, {20, 0}, {20, 20}, weight = 0.707107 2339done 2340~~~~ 2341 2342</fiddle-embed></div> 2343 2344If weight is greater than one, <a href="#Conic">Conic</a> is a hyperbolic segment. As weight gets large, 2345a hyperbolic segment can be approximated by straight lines connecting the 2346control <a href="SkPoint_Reference#Point">Point</a> with the end <a href="#Point">Points</a>. 2347 2348### Example 2349 2350<div><fiddle-embed name="6fb11419e99297fe2fe666c296117fb9"> 2351 2352#### Example Output 2353 2354~~~~ 2355move {0, 0}, 2356line {0, 0}, {20, 0}, 2357line {20, 0}, {20, 20}, 2358done 2359~~~~ 2360 2361</fiddle-embed></div> 2362 2363<a name="SkPath_conicTo"></a> 2364## conicTo 2365 2366<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2367void conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w) 2368</pre> 2369 2370Adds <a href="#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>. 2371If <a href="#Path">Path</a> is empty, or last <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) 2372before adding <a href="#Conic">Conic</a>. 2373 2374Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed. 2375 2376If <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>; 2377and (<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="#Point_Array">Point Array</a>; and <a href="#SkPath_conicTo_w">w</a> to <a href="#Weight">Conic Weights</a>. 2378 2379If <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 2380(<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="#Point_Array">Point Array</a>. 2381 2382If <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 2383(<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="#Point_Array">Point Array</a>. 2384 2385### Parameters 2386 2387<table> <tr> <td><a name="SkPath_conicTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> 2388control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in x</td> 2389 </tr> <tr> <td><a name="SkPath_conicTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> 2390control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in y</td> 2391 </tr> <tr> <td><a name="SkPath_conicTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> 2392end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in x</td> 2393 </tr> <tr> <td><a name="SkPath_conicTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> 2394end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Conic">Conic</a> in y</td> 2395 </tr> <tr> <td><a name="SkPath_conicTo_w"> <code><strong>w </strong></code> </a></td> <td> 2396weight of added <a href="#Conic">Conic</a></td> 2397 </tr> 2398</table> 2399 2400### Example 2401 2402<div><fiddle-embed name="358d9b6060b528b0923c007420f09c13"><div>As weight increases, curve is pulled towards control point. 2403The bottom two curves are elliptical; the next is parabolic; the 2404top curve is hyperbolic.</div></fiddle-embed></div> 2405 2406### See Also 2407 2408<a href="#SkPath_rConicTo">rConicTo</a> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_addArc">addArc</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> 2409 2410--- 2411 2412<a name="SkPath_conicTo_2"></a> 2413 2414<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2415void conicTo(const SkPoint& p1, const SkPoint& p2, SkScalar w) 2416</pre> 2417 2418Adds <a href="#Conic">Conic</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_conicTo_2_p1">p1</a>, to <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_conicTo_2_p2">p2</a>, weighted by <a href="#SkPath_conicTo_2_w">w</a>. 2419If <a href="#Path">Path</a> is empty, or last <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) 2420before adding <a href="#Conic">Conic</a>. 2421 2422Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed. 2423 2424If <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>; 2425and <a href="#Point">Points</a> <a href="#SkPath_conicTo_2_p1">p1</a>, <a href="#SkPath_conicTo_2_p2">p2</a> to <a href="#Point_Array">Point Array</a>; and <a href="#SkPath_conicTo_2_w">w</a> to <a href="#Weight">Conic Weights</a>. 2426 2427If <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="#Point">Points</a> <a href="#SkPath_conicTo_2_p1">p1</a>, <a href="#SkPath_conicTo_2_p2">p2</a> 2428to <a href="#Point_Array">Point Array</a>. 2429 2430If <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 2431<a href="#Point">Points</a> <a href="#SkPath_conicTo_2_p1">p1</a>, <a href="#SkPath_conicTo_2_p2">p2</a> to <a href="#Point_Array">Point Array</a>. 2432 2433### Parameters 2434 2435<table> <tr> <td><a name="SkPath_conicTo_2_p1"> <code><strong>p1 </strong></code> </a></td> <td> 2436control <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Conic">Conic</a></td> 2437 </tr> <tr> <td><a name="SkPath_conicTo_2_p2"> <code><strong>p2 </strong></code> </a></td> <td> 2438end <a href="SkPoint_Reference#Point">Point</a> of added <a href="#Conic">Conic</a></td> 2439 </tr> <tr> <td><a name="SkPath_conicTo_2_w"> <code><strong>w </strong></code> </a></td> <td> 2440weight of added <a href="#Conic">Conic</a></td> 2441 </tr> 2442</table> 2443 2444### Example 2445 2446<div><fiddle-embed name="22d25e03b19d5bae92118877e462361b"><div><a href="#Conic">Conics</a> and arcs use identical representations. As the arc sweep increases 2447the <a href="#Conic_Weight">Conic Weight</a> also increases, but remains smaller than one.</div></fiddle-embed></div> 2448 2449### See Also 2450 2451<a href="#SkPath_rConicTo">rConicTo</a> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_addArc">addArc</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> 2452 2453--- 2454 2455<a name="SkPath_rConicTo"></a> 2456## rConicTo 2457 2458<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2459void rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar w) 2460</pre> 2461 2462Adds <a href="#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>), 2463weighted by <a href="#SkPath_rConicTo_w">w</a>. If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> 2464is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="#Conic">Conic</a>. 2465 2466Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, 2467if needed. 2468If <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>, 2469and <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 2470<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> 2471twice to <a href="#Verb_Array">Verb Array</a>. 2472 2473In all cases appends <a href="#Point">Points</a> control and end to <a href="#Point_Array">Point Array</a>. 2474control 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>). 2475end 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>). 2476 2477Function name stands for "relative conic to". 2478 2479### Parameters 2480 2481<table> <tr> <td><a name="SkPath_rConicTo_dx1"> <code><strong>dx1 </strong></code> </a></td> <td> 2482offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> control x</td> 2483 </tr> <tr> <td><a name="SkPath_rConicTo_dy1"> <code><strong>dy1 </strong></code> </a></td> <td> 2484offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> control y</td> 2485 </tr> <tr> <td><a name="SkPath_rConicTo_dx2"> <code><strong>dx2 </strong></code> </a></td> <td> 2486offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> end x</td> 2487 </tr> <tr> <td><a name="SkPath_rConicTo_dy2"> <code><strong>dy2 </strong></code> </a></td> <td> 2488offset from <a href="#Last_Point">Last Point</a> x to <a href="#Conic">Conic</a> end y</td> 2489 </tr> <tr> <td><a name="SkPath_rConicTo_w"> <code><strong>w </strong></code> </a></td> <td> 2490weight of added <a href="#Conic">Conic</a></td> 2491 </tr> 2492</table> 2493 2494### Example 2495 2496<div><fiddle-embed name="3d52763e7c0e20c0b1d484a0afa622d2"></fiddle-embed></div> 2497 2498### See Also 2499 2500<a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_addArc">addArc</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> 2501 2502--- 2503 2504# <a name="Cubic"></a> Cubic 2505<a href="#Cubic">Cubic</a> describes a Bezier_Curve segment described by a third-order polynomial. 2506<a href="#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>; 2507and curves from the end <a href="SkPoint_Reference#Point">Point</a> towards the second control <a href="SkPoint_Reference#Point">Point</a>. 2508 2509### Example 2510 2511<div><fiddle-embed name="466445ed991d86de08587066392d654a"></fiddle-embed></div> 2512 2513<a name="SkPath_cubicTo"></a> 2514## cubicTo 2515 2516<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2517void cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3) 2518</pre> 2519 2520Adds <a href="#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 2521(<a href="#SkPath_cubicTo_x3">x3</a>, <a href="#SkPath_cubicTo_y3">y3</a>). If <a href="#Path">Path</a> is empty, or last <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 2522(0, 0) before adding <a href="#Cubic">Cubic</a>. 2523 2524Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; 2525then 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>) 2526to <a href="#Point_Array">Point Array</a>. 2527 2528### Parameters 2529 2530<table> <tr> <td><a name="SkPath_cubicTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> 2531first control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in x</td> 2532 </tr> <tr> <td><a name="SkPath_cubicTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> 2533first control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in y</td> 2534 </tr> <tr> <td><a name="SkPath_cubicTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> 2535second control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in x</td> 2536 </tr> <tr> <td><a name="SkPath_cubicTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> 2537second control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in y</td> 2538 </tr> <tr> <td><a name="SkPath_cubicTo_x3"> <code><strong>x3 </strong></code> </a></td> <td> 2539end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in x</td> 2540 </tr> <tr> <td><a name="SkPath_cubicTo_y3"> <code><strong>y3 </strong></code> </a></td> <td> 2541end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a> in y</td> 2542 </tr> 2543</table> 2544 2545### Example 2546 2547<div><fiddle-embed name="3e476378e3e0550ab134bbaf61112d98"></fiddle-embed></div> 2548 2549### See Also 2550 2551<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rCubicTo">rCubicTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> 2552 2553--- 2554 2555<a name="SkPath_cubicTo_2"></a> 2556 2557<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2558void cubicTo(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3) 2559</pre> 2560 2561Adds <a href="#Cubic">Cubic</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_cubicTo_2_p1">p1</a>, then towards <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_cubicTo_2_p2">p2</a>, ending at 2562<a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_cubicTo_2_p3">p3</a>. If <a href="#Path">Path</a> is empty, or last <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 2563(0, 0) before adding <a href="#Cubic">Cubic</a>. 2564 2565Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; 2566then appends <a href="#SkPath_kCubic_Verb">kCubic Verb</a> to <a href="#Verb_Array">Verb Array</a>; and <a href="#Point">Points</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> 2567to <a href="#Point_Array">Point Array</a>. 2568 2569### Parameters 2570 2571<table> <tr> <td><a name="SkPath_cubicTo_2_p1"> <code><strong>p1 </strong></code> </a></td> <td> 2572first control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a></td> 2573 </tr> <tr> <td><a name="SkPath_cubicTo_2_p2"> <code><strong>p2 </strong></code> </a></td> <td> 2574second control <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a></td> 2575 </tr> <tr> <td><a name="SkPath_cubicTo_2_p3"> <code><strong>p3 </strong></code> </a></td> <td> 2576end <a href="SkPoint_Reference#Point">Point</a> of <a href="#Cubic">Cubic</a></td> 2577 </tr> 2578</table> 2579 2580### Example 2581 2582<div><fiddle-embed name="d38aaf12c6ff5b8d901a2201bcee5476"></fiddle-embed></div> 2583 2584### See Also 2585 2586<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_rCubicTo">rCubicTo</a> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> 2587 2588--- 2589 2590<a name="SkPath_rCubicTo"></a> 2591## rCubicTo 2592 2593<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2594void rCubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3) 2595</pre> 2596 2597Adds <a href="#Cubic">Cubic</a> from <a href="#Last_Point">Last Point</a> towards <a href="SkPoint_Reference#Vector">Vector</a> (dx1, dy1), then towards 2598<a href="SkPoint_Reference#Vector">Vector</a> (dx2, dy2), to <a href="SkPoint_Reference#Vector">Vector</a> (dx3, dy3). 2599If <a href="#Path">Path</a> is empty, or last <a href="#SkPath_Verb">Verb</a> 2600is <a href="#SkPath_kClose_Verb">kClose Verb</a>, <a href="#Last_Point">Last Point</a> is set to (0, 0) before adding <a href="#Cubic">Cubic</a>. 2601 2602Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, 2603if needed; then appends <a href="#SkPath_kCubic_Verb">kCubic Verb</a> to <a href="#Verb_Array">Verb Array</a>; and appends <a href="#Cubic">Cubic</a> 2604control and <a href="#Cubic">Cubic</a> end to <a href="#Point_Array">Point Array</a>. 2605<a href="#Cubic">Cubic</a> control is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (dx1, dy1). 2606<a href="#Cubic">Cubic</a> end is <a href="#Last_Point">Last Point</a> plus <a href="SkPoint_Reference#Vector">Vector</a> (dx2, dy2). 2607Function name stands for "relative cubic to". 2608 2609### Parameters 2610 2611<table> <tr> <td><a name="SkPath_rCubicTo_x1"> <code><strong>x1 </strong></code> </a></td> <td> 2612offset from <a href="#Last_Point">Last Point</a> x to first <a href="#Cubic">Cubic</a> control x</td> 2613 </tr> <tr> <td><a name="SkPath_rCubicTo_y1"> <code><strong>y1 </strong></code> </a></td> <td> 2614offset from <a href="#Last_Point">Last Point</a> x to first <a href="#Cubic">Cubic</a> control y</td> 2615 </tr> <tr> <td><a name="SkPath_rCubicTo_x2"> <code><strong>x2 </strong></code> </a></td> <td> 2616offset from <a href="#Last_Point">Last Point</a> x to second <a href="#Cubic">Cubic</a> control x</td> 2617 </tr> <tr> <td><a name="SkPath_rCubicTo_y2"> <code><strong>y2 </strong></code> </a></td> <td> 2618offset from <a href="#Last_Point">Last Point</a> x to second <a href="#Cubic">Cubic</a> control y</td> 2619 </tr> <tr> <td><a name="SkPath_rCubicTo_x3"> <code><strong>x3 </strong></code> </a></td> <td> 2620offset from <a href="#Last_Point">Last Point</a> x to <a href="#Cubic">Cubic</a> end x</td> 2621 </tr> <tr> <td><a name="SkPath_rCubicTo_y3"> <code><strong>y3 </strong></code> </a></td> <td> 2622offset from <a href="#Last_Point">Last Point</a> x to <a href="#Cubic">Cubic</a> end y</td> 2623 </tr> 2624</table> 2625 2626### Example 2627 2628<div><fiddle-embed name="19f0cfc7eeba8937fe19446ec0b5f932"></fiddle-embed></div> 2629 2630### See Also 2631 2632<a href="#Contour">Contour</a> <a href="#SkPath_moveTo">moveTo</a><sup><a href="#SkPath_moveTo_2">[2]</a></sup> <a href="#SkPath_cubicTo">cubicTo</a><sup><a href="#SkPath_cubicTo_2">[2]</a></sup> <a href="#SkPath_quadTo">quadTo</a><sup><a href="#SkPath_quadTo_2">[2]</a></sup> 2633 2634--- 2635 2636## <a name="Arc"></a> Arc 2637 2638<a href="#Arc">Arc</a> can be constructed in a number of ways. <a href="#Arc">Arc</a> may be described by part of <a href="undocumented#Oval">Oval</a> and angles, 2639by start point and end point, and by radius and tangent lines. Each construction has advantages, 2640and some constructions correspond to <a href="#Arc">Arc</a> drawing in graphics standards. 2641 2642All <a href="#Arc">Arc</a> draws are implemented by one or more <a href="#Conic">Conic</a> draws. When <a href="#Conic_Weight">Conic Weight</a> is less than one, 2643<a href="#Conic">Conic</a> describes an <a href="#Arc">Arc</a> of some <a href="undocumented#Oval">Oval</a> or <a href="undocumented#Circle">Circle</a>. 2644 2645<a href="#SkPath_arcTo">arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a> 2646describes <a href="#Arc">Arc</a> as a piece of <a href="undocumented#Oval">Oval</a>, beginning at start angle, sweeping clockwise or counterclockwise, 2647which may continue <a href="#Contour">Contour</a> or start a new one. This construction is similar to <a href="undocumented#PostScript">PostScript</a> and 2648<a href="undocumented#HTML_Canvas">HTML Canvas</a> arcs. Variation <a href="#SkPath_addArc">addArc</a> always starts new <a href="#Contour">Contour</a>. Canvas::drawArc draws without 2649requiring <a href="#Path">Path</a>. 2650 2651<a href="#SkPath_arcTo_2">arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a> 2652describes <a href="#Arc">Arc</a> as tangent to the line (x0, y0), (x1, y1) and tangent to the line (x1, y1), (x2, y2) 2653where (x0, y0) is the last <a href="SkPoint_Reference#Point">Point</a> added to <a href="#Path">Path</a>. This construction is similar to <a href="undocumented#PostScript">PostScript</a> and 2654<a href="undocumented#HTML_Canvas">HTML Canvas</a> arcs. 2655 2656<a href="#SkPath_arcTo_4">arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, 2657SkScalar x, SkScalar y)</a> 2658describes <a href="#Arc">Arc</a> as part of <a href="undocumented#Oval">Oval</a> with radii (rx, ry), beginning at 2659last <a href="SkPoint_Reference#Point">Point</a> added to <a href="#Path">Path</a> and ending at (x, y). More than one <a href="#Arc">Arc</a> satisfies this criteria, 2660so additional values choose a single solution. This construction is similar to <a href="undocumented#SVG">SVG</a> arcs. 2661 2662<a href="#SkPath_conicTo">conicTo</a> describes <a href="#Arc">Arc</a> of less than 180 degrees as a pair of tangent lines and <a href="#Conic_Weight">Conic Weight</a>. 2663<a href="#SkPath_conicTo">conicTo</a> can represent any <a href="#Arc">Arc</a> with a sweep less than 180 degrees at any rotation. All <a href="#SkPath_arcTo">arcTo</a> 2664constructions are converted to <a href="#Conic">Conic</a> data when added to <a href="#Path">Path</a>. 2665 2666### Example 2667 2668<div><fiddle-embed name="891ac93abd0cdb27c4156685d3b1bb4c"><div> 2669 2670<table> <tr> 2671 <td><sup>1</sup> <a href="#SkPath_arcTo">arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)</a></td> </tr> <tr> 2672 <td><sup>2</sup> parameter sets force MoveTo</td> </tr> <tr> 2673 <td><sup>3</sup> start angle must be multiple of 90 degrees</td> </tr> <tr> 2674 <td><sup>4</sup> <a href="#SkPath_arcTo_2">arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)</a></td> </tr> <tr> 2675 <td><sup>5</sup> <a href="#SkPath_arcTo_4">arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, 2676Direction sweep, SkScalar x, SkScalar y)</a></td> </tr> 2677</table> 2678 2679</div></fiddle-embed></div> 2680 2681### Example 2682 2683<div><fiddle-embed name="5acc77eba0cb4d00bbf3a8f4db0c0aee"><div>1 describes an arc from an oval, a starting angle, and a sweep angle. 26842 is similar to 1, but does not require building a path to draw. 26853 is similar to 1, but always begins new <a href="#Contour">Contour</a>. 26864 describes an arc from a pair of tangent lines and a radius. 26875 describes an arc from <a href="undocumented#Oval">Oval</a> center, arc start <a href="SkPoint_Reference#Point">Point</a> and arc end <a href="SkPoint_Reference#Point">Point</a>. 26886 describes an arc from a pair of tangent lines and a <a href="#Conic_Weight">Conic Weight</a>.</div></fiddle-embed></div> 2689 2690<a name="SkPath_arcTo"></a> 2691## arcTo 2692 2693<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2694void arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo) 2695</pre> 2696 2697Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> added is part of ellipse 2698bounded 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 2699<a href="#SkPath_arcTo_sweepAngle">sweepAngle</a> are measured in degrees, where zero degrees is aligned with the 2700positive x-axis, and positive sweeps extends <a href="#Arc">Arc</a> clockwise. 2701 2702<a href="#SkPath_arcTo">arcTo</a> adds <a href="undocumented#Line">Line</a> connecting <a href="#Path">Path</a> last <a href="SkPoint_Reference#Point">Point</a> to initial <a href="#Arc">Arc</a> <a href="SkPoint_Reference#Point">Point</a> if <a href="#SkPath_arcTo_forceMoveTo">forceMoveTo</a> 2703is false and <a href="#Path">Path</a> is not empty. Otherwise, added <a href="#Contour">Contour</a> begins with first point 2704of <a href="#Arc">Arc</a>. Angles greater than -360 and less than 360 are treated modulo 360. 2705 2706### Parameters 2707 2708<table> <tr> <td><a name="SkPath_arcTo_oval"> <code><strong>oval </strong></code> </a></td> <td> 2709bounds of ellipse containing <a href="#Arc">Arc</a></td> 2710 </tr> <tr> <td><a name="SkPath_arcTo_startAngle"> <code><strong>startAngle </strong></code> </a></td> <td> 2711starting angle of <a href="#Arc">Arc</a> in degrees</td> 2712 </tr> <tr> <td><a name="SkPath_arcTo_sweepAngle"> <code><strong>sweepAngle </strong></code> </a></td> <td> 2713sweep, in degrees. Positive is clockwise; treated modulo 360</td> 2714 </tr> <tr> <td><a name="SkPath_arcTo_forceMoveTo"> <code><strong>forceMoveTo </strong></code> </a></td> <td> 2715true to start a new contour with <a href="#Arc">Arc</a></td> 2716 </tr> 2717</table> 2718 2719### Example 2720 2721<div><fiddle-embed name="5f02890edaa10cb5e1a4243a82b6a382"><div><a href="#SkPath_arcTo">arcTo</a> continues a previous contour when <a href="#SkPath_arcTo_forceMoveTo">forceMoveTo</a> is false and when <a href="#Path">Path</a> 2722is not empty.</div></fiddle-embed></div> 2723 2724### See Also 2725 2726<a href="#SkPath_addArc">addArc</a> <a href="#SkCanvas_drawArc">SkCanvas::drawArc</a> <a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> 2727 2728--- 2729 2730<a name="SkPath_arcTo_2"></a> 2731 2732<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2733void arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius) 2734</pre> 2735 2736Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, after appending <a href="undocumented#Line">Line</a> if needed. <a href="#Arc">Arc</a> is implemented by <a href="#Conic">Conic</a> 2737weighted to describe part of <a href="undocumented#Circle">Circle</a>. <a href="#Arc">Arc</a> is contained by tangent from 2738last <a href="#Path">Path</a> point (x0, y0) 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="#Arc">Arc</a> 2739is part of <a href="undocumented#Circle">Circle</a> sized to <a href="#SkPath_arcTo_2_radius">radius</a>, positioned so it touches both tangent lines. 2740 2741### Example 2742 2743<div><fiddle-embed name="d9c6435f26f37b3d63c664a99028f77f"></fiddle-embed></div> 2744 2745If last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> does not start <a href="#Arc">Arc</a>, <a href="#SkPath_arcTo">arcTo</a> appends connecting <a href="undocumented#Line">Line</a> to <a href="#Path">Path</a>. 2746The 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="#Arc">Arc</a>. 2747 2748### Example 2749 2750<div><fiddle-embed name="01d2ddfd539ab86a86989e210640dffc"></fiddle-embed></div> 2751 2752<a href="#Arc">Arc</a> sweep is always less than 180 degrees. If <a href="#SkPath_arcTo_2_radius">radius</a> is zero, or if 2753tangents are nearly parallel, <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> from last <a href="#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>). 2754 2755<a href="#SkPath_arcTo">arcTo</a> appends at most one <a href="undocumented#Line">Line</a> and one <a href="#Conic">Conic</a>. 2756<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arct">PostScript Arct</a> and <a href="undocumented#HTML_Canvas_ArcTo">HTML Canvas ArcTo</a>. 2757 2758### Parameters 2759 2760<table> <tr> <td><a name="SkPath_arcTo_2_x1"> <code><strong>x1 </strong></code> </a></td> <td> 2761x common to pair of tangents</td> 2762 </tr> <tr> <td><a name="SkPath_arcTo_2_y1"> <code><strong>y1 </strong></code> </a></td> <td> 2763y common to pair of tangents</td> 2764 </tr> <tr> <td><a name="SkPath_arcTo_2_x2"> <code><strong>x2 </strong></code> </a></td> <td> 2765x end of second tangent</td> 2766 </tr> <tr> <td><a name="SkPath_arcTo_2_y2"> <code><strong>y2 </strong></code> </a></td> <td> 2767y end of second tangent</td> 2768 </tr> <tr> <td><a name="SkPath_arcTo_2_radius"> <code><strong>radius </strong></code> </a></td> <td> 2769distance from <a href="#Arc">Arc</a> to <a href="undocumented#Circle">Circle</a> center</td> 2770 </tr> 2771</table> 2772 2773### Example 2774 2775<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="#Conic">Conic</a> in <a href="#Path">Path</a>.</div> 2776 2777#### Example Output 2778 2779~~~~ 2780move to (156,20) 2781line (156,20),(79.2893,20) 2782conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683 2783~~~~ 2784 2785</fiddle-embed></div> 2786 2787### See Also 2788 2789<a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> 2790 2791--- 2792 2793<a name="SkPath_arcTo_3"></a> 2794 2795<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2796void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius) 2797</pre> 2798 2799Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, after appending <a href="undocumented#Line">Line</a> if needed. <a href="#Arc">Arc</a> is implemented by <a href="#Conic">Conic</a> 2800weighted to describe part of <a href="undocumented#Circle">Circle</a>. <a href="#Arc">Arc</a> is contained by tangent from 2801last <a href="#Path">Path</a> point 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="#Arc">Arc</a> 2802is part of <a href="undocumented#Circle">Circle</a> sized to <a href="#SkPath_arcTo_3_radius">radius</a>, positioned so it touches both tangent lines. 2803 2804If last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> does not start <a href="#Arc">Arc</a>, <a href="#SkPath_arcTo">arcTo</a> appends connecting <a href="undocumented#Line">Line</a> to <a href="#Path">Path</a>. 2805The 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="#Arc">Arc</a>. 2806 2807<a href="#Arc">Arc</a> sweep is always less than 180 degrees. If <a href="#SkPath_arcTo_3_radius">radius</a> is zero, or if 2808tangents are nearly parallel, <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to <a href="#SkPath_arcTo_3_p1">p1</a>. 2809 2810<a href="#SkPath_arcTo">arcTo</a> appends at most one <a href="undocumented#Line">Line</a> and one <a href="#Conic">Conic</a>. 2811<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arct">PostScript Arct</a> and <a href="undocumented#HTML_Canvas_ArcTo">HTML Canvas ArcTo</a>. 2812 2813### Parameters 2814 2815<table> <tr> <td><a name="SkPath_arcTo_3_p1"> <code><strong>p1 </strong></code> </a></td> <td> 2816<a href="SkPoint_Reference#Point">Point</a> common to pair of tangents</td> 2817 </tr> <tr> <td><a name="SkPath_arcTo_3_p2"> <code><strong>p2 </strong></code> </a></td> <td> 2818end of second tangent</td> 2819 </tr> <tr> <td><a name="SkPath_arcTo_3_radius"> <code><strong>radius </strong></code> </a></td> <td> 2820distance from <a href="#Arc">Arc</a> to <a href="undocumented#Circle">Circle</a> center</td> 2821 </tr> 2822</table> 2823 2824### Example 2825 2826<div><fiddle-embed name="0c056264a361579c18e5d02d3172d4d4"><div>Because tangent lines are parallel, <a href="#SkPath_arcTo">arcTo</a> appends line from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to 2827<a href="#SkPath_arcTo_3_p1">p1</a>, but does not append a circular <a href="#Conic">Conic</a>.</div> 2828 2829#### Example Output 2830 2831~~~~ 2832move to (156,20) 2833line (156,20),(200,20) 2834~~~~ 2835 2836</fiddle-embed></div> 2837 2838### See Also 2839 2840<a href="#SkPath_conicTo">conicTo</a><sup><a href="#SkPath_conicTo_2">[2]</a></sup> 2841 2842--- 2843 2844## <a name="SkPath_ArcSize"></a> Enum SkPath::ArcSize 2845 2846<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2847enum <a href="#SkPath_ArcSize">ArcSize</a> { 2848<a href="#SkPath_kSmall_ArcSize">kSmall ArcSize</a>, 2849<a href="#SkPath_kLarge_ArcSize">kLarge ArcSize</a>, 2850};</pre> 2851 2852Four <a href="undocumented#Oval">Oval</a> parts with radii (rx, ry) start at last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and ends at (x, y). 2853<a href="#SkPath_ArcSize">ArcSize</a> and <a href="#SkPath_Direction">Direction</a> select one of the four <a href="undocumented#Oval">Oval</a> parts. 2854 2855### Constants 2856 2857<table> 2858 <tr> 2859 <td><a name="SkPath_kSmall_ArcSize"> <code><strong>SkPath::kSmall_ArcSize </strong></code> </a></td><td>0</td><td>smaller of <a href="#Arc">Arc</a> pair</td> 2860 </tr> 2861 <tr> 2862 <td><a name="SkPath_kLarge_ArcSize"> <code><strong>SkPath::kLarge_ArcSize </strong></code> </a></td><td>1</td><td>larger of <a href="#Arc">Arc</a> pair</td> 2863 </tr> 2864</table> 2865 2866### Example 2867 2868<div><fiddle-embed name="8e40c546eecd9cc213200717240898ba"><div><a href="#Arc">Arc</a> begins at top of <a href="undocumented#Oval">Oval</a> pair and ends at bottom. <a href="#Arc">Arc</a> can take four routes to get there. 2869Two routes are large, and two routes are counterclockwise. The one route both large 2870and counterclockwise is blue.</div></fiddle-embed></div> 2871 2872### See Also 2873 2874<a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_Direction">Direction</a> 2875 2876 2877 2878<a name="SkPath_arcTo_4"></a> 2879 2880<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2881void arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, 2882 SkScalar x, SkScalar y) 2883</pre> 2884 2885Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> is implemented by one or more <a href="#Conic">Conics</a> weighted to 2886describe 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="#Arc">Arc</a> 2887curves from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to (<a href="#SkPath_arcTo_4_x">x</a>, <a href="#SkPath_arcTo_4_y">y</a>), choosing one of four possible routes: 2888clockwise or counterclockwise, and smaller or larger. 2889 2890<a href="#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 2891either radii are zero, or if last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</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 2892(<a href="#SkPath_arcTo_4_rx">rx</a>, <a href="#SkPath_arcTo_4_ry">ry</a>) to fit last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</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 2893too small. 2894 2895<a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. 2896<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_4_sweep">sweep</a>-flag" value 2897is opposite the integer value of <a href="#SkPath_arcTo_4_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_4_sweep">sweep</a>-flag" uses 1 for clockwise, 2898while <a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. 2899 2900### Parameters 2901 2902<table> <tr> <td><a name="SkPath_arcTo_4_rx"> <code><strong>rx </strong></code> </a></td> <td> 2903radius in <a href="#SkPath_arcTo_4_x">x</a> before <a href="#SkPath_arcTo_4_x">x</a>-axis rotation</td> 2904 </tr> <tr> <td><a name="SkPath_arcTo_4_ry"> <code><strong>ry </strong></code> </a></td> <td> 2905radius in <a href="#SkPath_arcTo_4_y">y</a> before <a href="#SkPath_arcTo_4_x">x</a>-axis rotation</td> 2906 </tr> <tr> <td><a name="SkPath_arcTo_4_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> 2907<a href="#SkPath_arcTo_4_x">x</a>-axis rotation in degrees; positive values are clockwise</td> 2908 </tr> <tr> <td><a name="SkPath_arcTo_4_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> 2909chooses smaller or larger <a href="#Arc">Arc</a></td> 2910 </tr> <tr> <td><a name="SkPath_arcTo_4_sweep"> <code><strong>sweep </strong></code> </a></td> <td> 2911chooses clockwise or counterclockwise <a href="#Arc">Arc</a></td> 2912 </tr> <tr> <td><a name="SkPath_arcTo_4_x"> <code><strong>x </strong></code> </a></td> <td> 2913end of <a href="#Arc">Arc</a></td> 2914 </tr> <tr> <td><a name="SkPath_arcTo_4_y"> <code><strong>y </strong></code> </a></td> <td> 2915end of <a href="#Arc">Arc</a></td> 2916 </tr> 2917</table> 2918 2919### Example 2920 2921<div><fiddle-embed name="6b6ea44f659b27918f3a6fa621bf6173"></fiddle-embed></div> 2922 2923### See Also 2924 2925<a href="#SkPath_rArcTo">rArcTo</a> <a href="#SkPath_ArcSize">ArcSize</a> <a href="#SkPath_Direction">Direction</a> 2926 2927--- 2928 2929<a name="SkPath_arcTo_5"></a> 2930 2931<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2932void arcTo(const SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, const SkPoint xy) 2933</pre> 2934 2935Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> is implemented by one or more <a href="#Conic">Conic</a> weighted to describe part of <a href="undocumented#Oval">Oval</a> 2936with radii (<a href="#SkPath_arcTo_5_r">r</a>.fX, <a href="#SkPath_arcTo_5_r">r</a>.fY) rotated by <a href="#SkPath_arcTo_5_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> curves from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> to 2937(<a href="#SkPath_arcTo_5_xy">xy</a>.fX, <a href="#SkPath_arcTo_5_xy">xy</a>.fY), choosing one of four possible routes: clockwise or counterclockwise, 2938and smaller or larger. 2939 2940<a href="#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 radii are zero, 2941or if last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> equals (x, y). <a href="#SkPath_arcTo">arcTo</a> scales radii <a href="#SkPath_arcTo_5_r">r</a> to fit last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and 2942<a href="#SkPath_arcTo_5_xy">xy</a> if both are greater than zero but too small to describe an arc. 2943 2944<a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. 2945<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_5_sweep">sweep</a>-flag" value is 2946opposite the integer value of <a href="#SkPath_arcTo_5_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_arcTo_5_sweep">sweep</a>-flag" uses 1 for clockwise, while 2947<a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. 2948 2949### Parameters 2950 2951<table> <tr> <td><a name="SkPath_arcTo_5_r"> <code><strong>r </strong></code> </a></td> <td> 2952radii in x and y before x-axis rotation</td> 2953 </tr> <tr> <td><a name="SkPath_arcTo_5_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> 2954x-axis rotation in degrees; positive values are clockwise</td> 2955 </tr> <tr> <td><a name="SkPath_arcTo_5_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> 2956chooses smaller or larger <a href="#Arc">Arc</a></td> 2957 </tr> <tr> <td><a name="SkPath_arcTo_5_sweep"> <code><strong>sweep </strong></code> </a></td> <td> 2958chooses clockwise or counterclockwise <a href="#Arc">Arc</a></td> 2959 </tr> <tr> <td><a name="SkPath_arcTo_5_xy"> <code><strong>xy </strong></code> </a></td> <td> 2960end of <a href="#Arc">Arc</a></td> 2961 </tr> 2962</table> 2963 2964### Example 2965 2966<div><fiddle-embed name="3f76a1007416181a4848c1a87fc81dbd"></fiddle-embed></div> 2967 2968### See Also 2969 2970<a href="#SkPath_rArcTo">rArcTo</a> <a href="#SkPath_ArcSize">ArcSize</a> <a href="#SkPath_Direction">Direction</a> 2971 2972--- 2973 2974<a name="SkPath_rArcTo"></a> 2975## rArcTo 2976 2977<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 2978void rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, 2979 SkScalar dx, SkScalar dy) 2980</pre> 2981 2982Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, relative to last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a>. <a href="#Arc">Arc</a> is implemented by one or 2983more <a href="#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 2984<a href="#SkPath_rArcTo_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> curves from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> (x0, y0) to end <a href="SkPoint_Reference#Point">Point</a>: 2985 2986(x0 + <a href="#SkPath_rArcTo_dx">dx</a>, y0 + <a href="#SkPath_rArcTo_dy">dy</a>), 2987choosing one of four possible routes: clockwise or 2988counterclockwise, and smaller or larger. If <a href="#Path">Path</a> is empty, the start <a href="#Arc">Arc</a> <a href="SkPoint_Reference#Point">Point</a> 2989is (0, 0). 2990 2991<a href="#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> 2992if either radii are zero, or if last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> equals end <a href="SkPoint_Reference#Point">Point</a>. 2993<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="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and end <a href="SkPoint_Reference#Point">Point</a> if both are 2994greater than zero but too small to describe an arc. 2995 2996<a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. 2997<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_rArcTo_sweep">sweep</a>-flag" value is 2998opposite the integer value of <a href="#SkPath_rArcTo_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "<a href="#SkPath_rArcTo_sweep">sweep</a>-flag" uses 1 for clockwise, while 2999<a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. 3000 3001### Parameters 3002 3003<table> <tr> <td><a name="SkPath_rArcTo_rx"> <code><strong>rx </strong></code> </a></td> <td> 3004radius in x before x-axis rotation</td> 3005 </tr> <tr> <td><a name="SkPath_rArcTo_ry"> <code><strong>ry </strong></code> </a></td> <td> 3006radius in y before x-axis rotation</td> 3007 </tr> <tr> <td><a name="SkPath_rArcTo_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> 3008x-axis rotation in degrees; positive values are clockwise</td> 3009 </tr> <tr> <td><a name="SkPath_rArcTo_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> 3010chooses smaller or larger <a href="#Arc">Arc</a></td> 3011 </tr> <tr> <td><a name="SkPath_rArcTo_sweep"> <code><strong>sweep </strong></code> </a></td> <td> 3012chooses clockwise or counterclockwise <a href="#Arc">Arc</a></td> 3013 </tr> <tr> <td><a name="SkPath_rArcTo_dx"> <code><strong>dx </strong></code> </a></td> <td> 3014x offset end of <a href="#Arc">Arc</a> from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a></td> 3015 </tr> <tr> <td><a name="SkPath_rArcTo_dy"> <code><strong>dy </strong></code> </a></td> <td> 3016y offset end of <a href="#Arc">Arc</a> from last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a></td> 3017 </tr> 3018</table> 3019 3020### Example 3021 3022<div><fiddle-embed name="3f76a1007416181a4848c1a87fc81dbd"></fiddle-embed></div> 3023 3024### See Also 3025 3026<a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkPath_ArcSize">ArcSize</a> <a href="#SkPath_Direction">Direction</a> 3027 3028--- 3029 3030<a name="SkPath_close"></a> 3031## close 3032 3033<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3034void close() 3035</pre> 3036 3037Append <a href="#SkPath_kClose_Verb">kClose Verb</a> to <a href="#Path">Path</a>. A closed <a href="#Contour">Contour</a> connects the first and last <a href="SkPoint_Reference#Point">Point</a> 3038with <a href="undocumented#Line">Line</a>, forming a continuous loop. Open and closed <a href="#Contour">Contour</a> draw the same 3039with <a href="#SkPaint_kFill_Style">SkPaint::kFill Style</a>. With <a href="#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>, open <a href="#Contour">Contour</a> draws 3040<a href="#Stroke_Cap">Paint Stroke Cap</a> at <a href="#Contour">Contour</a> start and end; closed <a href="#Contour">Contour</a> draws 3041<a href="#Stroke_Join">Paint Stroke Join</a> at <a href="#Contour">Contour</a> start and end. 3042 3043<a href="#SkPath_close">close</a> has no effect if <a href="#Path">Path</a> is empty or last <a href="#Path">Path</a> <a href="#SkPath_Verb">Verb</a> is <a href="#SkPath_kClose_Verb">kClose Verb</a>. 3044 3045### Example 3046 3047<div><fiddle-embed name="9235f6309271d6420fa5c45dc28664c5"></fiddle-embed></div> 3048 3049### See Also 3050 3051--- 3052 3053<a name="SkPath_IsInverseFillType"></a> 3054## IsInverseFillType 3055 3056<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3057static bool IsInverseFillType(FillType fill) 3058</pre> 3059 3060Returns true if <a href="#SkPath_IsInverseFillType_fill">fill</a> is inverted and <a href="#Path">Path</a> with <a href="#SkPath_IsInverseFillType_fill">fill</a> represents area outside 3061of its geometric bounds. 3062 3063| <a href="#SkPath_FillType">FillType</a> | is inverse | 3064| --- | --- | 3065| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | false | 3066| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | false | 3067| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | true | 3068| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | true | 3069 3070### Parameters 3071 3072<table> <tr> <td><a name="SkPath_IsInverseFillType_fill"> <code><strong>fill </strong></code> </a></td> <td> 3073one of: <a href="#SkPath_kWinding_FillType">kWinding FillType</a>, <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, 3074<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a></td> 3075 </tr> 3076</table> 3077 3078### Return Value 3079 3080true if <a href="#Path">Path</a> fills outside its bounds 3081 3082### Example 3083 3084<div><fiddle-embed name="1453856a9d0c73e8192bf298c4143563"> 3085 3086#### Example Output 3087 3088~~~~ 3089IsInverseFillType(kWinding_FillType) == false 3090IsInverseFillType(kEvenOdd_FillType) == false 3091IsInverseFillType(kInverseWinding_FillType) == true 3092IsInverseFillType(kInverseEvenOdd_FillType) == true 3093~~~~ 3094 3095</fiddle-embed></div> 3096 3097### See Also 3098 3099<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_ConvertToNonInverseFillType">ConvertToNonInverseFillType</a> 3100 3101--- 3102 3103<a name="SkPath_ConvertToNonInverseFillType"></a> 3104## ConvertToNonInverseFillType 3105 3106<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3107static FillType ConvertToNonInverseFillType(FillType fill) 3108</pre> 3109 3110Returns equivalent <a href="#Fill_Type">Fill Type</a> representing <a href="#Path">Path</a> <a href="#SkPath_ConvertToNonInverseFillType_fill">fill</a> inside its bounds. 3111. 3112 3113| <a href="#SkPath_FillType">FillType</a> | inside <a href="#SkPath_FillType">FillType</a> | 3114| --- | --- | 3115| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | 3116| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | 3117| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | 3118| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | 3119 3120### Parameters 3121 3122<table> <tr> <td><a name="SkPath_ConvertToNonInverseFillType_fill"> <code><strong>fill </strong></code> </a></td> <td> 3123one of: <a href="#SkPath_kWinding_FillType">kWinding FillType</a>, <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>, 3124<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>, <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a></td> 3125 </tr> 3126</table> 3127 3128### Return Value 3129 3130<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 3131 3132### Example 3133 3134<div><fiddle-embed name="adfae398bbe9e37495f8220ad544c8f8"> 3135 3136#### Example Output 3137 3138~~~~ 3139ConvertToNonInverseFillType(kWinding_FillType) == kWinding_FillType 3140ConvertToNonInverseFillType(kEvenOdd_FillType) == kEvenOdd_FillType 3141ConvertToNonInverseFillType(kInverseWinding_FillType) == kWinding_FillType 3142ConvertToNonInverseFillType(kInverseEvenOdd_FillType) == kEvenOdd_FillType 3143~~~~ 3144 3145</fiddle-embed></div> 3146 3147### See Also 3148 3149<a href="#SkPath_FillType">FillType</a> <a href="#SkPath_getFillType">getFillType</a> <a href="#SkPath_setFillType">setFillType</a> <a href="#SkPath_IsInverseFillType">IsInverseFillType</a> 3150 3151--- 3152 3153<a name="SkPath_ConvertConicToQuads"></a> 3154## ConvertConicToQuads 3155 3156<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3157static int ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w, 3158 SkPoint pts[], int pow2) 3159</pre> 3160 3161Approximates <a href="#Conic">Conic</a> with <a href="#Quad">Quad</a> array. <a href="#Conic">Conic</a> is constructed from start <a href="SkPoint_Reference#Point">Point</a> <a href="#SkPath_ConvertConicToQuads_p0">p0</a>, 3162control <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>. 3163<a href="#Quad">Quad</a> array is stored in <a href="#SkPath_ConvertConicToQuads_pts">pts</a>; this storage is supplied by caller. 3164Maximum <a href="#Quad">Quad</a> count is 2 to the <a href="#SkPath_ConvertConicToQuads_pow2">pow2</a>. 3165Every third point in array shares last <a href="SkPoint_Reference#Point">Point</a> of previous <a href="#Quad">Quad</a> and first <a href="SkPoint_Reference#Point">Point</a> of 3166next <a href="#Quad">Quad</a>. Maximum <a href="#SkPath_ConvertConicToQuads_pts">pts</a> storage size is given by: 3167(1 + 2 * (1 << <a href="#SkPath_ConvertConicToQuads_pow2">pow2</a>)) * sizeof(SkPoint). 3168 3169Returns <a href="#Quad">Quad</a> count used the approximation, which may be smaller 3170than the number requested. 3171<a href="#Conic_Weight">Conic Weight</a> determines the amount of influence <a href="#Conic">Conic</a> control point has on the curve. 3172<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 3173a hyperbolic section. <a href="#SkPath_ConvertConicToQuads_w">w</a> equal to one represents a parabolic section. 3174 3175Two <a href="#Quad">Quad</a> curves are sufficient to approximate an elliptical <a href="#Conic">Conic</a> with a sweep 3176of up to 90 degrees; in this case, set <a href="#SkPath_ConvertConicToQuads_pow2">pow2</a> to one. 3177 3178### Parameters 3179 3180<table> <tr> <td><a name="SkPath_ConvertConicToQuads_p0"> <code><strong>p0 </strong></code> </a></td> <td> 3181<a href="#Conic">Conic</a> start <a href="SkPoint_Reference#Point">Point</a></td> 3182 </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_p1"> <code><strong>p1 </strong></code> </a></td> <td> 3183<a href="#Conic">Conic</a> control <a href="SkPoint_Reference#Point">Point</a></td> 3184 </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_p2"> <code><strong>p2 </strong></code> </a></td> <td> 3185<a href="#Conic">Conic</a> end <a href="SkPoint_Reference#Point">Point</a></td> 3186 </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_w"> <code><strong>w </strong></code> </a></td> <td> 3187<a href="#Conic">Conic</a> weight</td> 3188 </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_pts"> <code><strong>pts </strong></code> </a></td> <td> 3189storage for <a href="#Quad">Quad</a> array</td> 3190 </tr> <tr> <td><a name="SkPath_ConvertConicToQuads_pow2"> <code><strong>pow2 </strong></code> </a></td> <td> 3191<a href="#Quad">Quad</a> count, as power of two, normally 0 to 5 (1 to 32 <a href="#Quad">Quad</a> curves)</td> 3192 </tr> 3193</table> 3194 3195### Return Value 3196 3197number of <a href="#Quad">Quad</a> curves written to <a href="#SkPath_ConvertConicToQuads_pts">pts</a> 3198 3199### Example 3200 3201<div><fiddle-embed name="3ba94448a4ba48f926e643baeb5b1016"><div>A pair of <a href="#Quad">Quad</a> curves are drawn in red on top of the elliptical <a href="#Conic">Conic</a> curve in black. 3202The middle curve is nearly circular. The top-right curve is parabolic, which can 3203be drawn exactly with a single <a href="#Quad">Quad</a>.</div></fiddle-embed></div> 3204 3205### See Also 3206 3207<a href="#Conic">Conic</a> <a href="#Quad">Quad</a> 3208 3209--- 3210 3211<a name="SkPath_isRect"></a> 3212## isRect 3213 3214<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3215bool isRect(SkRect* rect, bool* isClosed = nullptr, Direction* direction = nullptr) const 3216</pre> 3217 3218Returns true if <a href="#Path">Path</a> is equivalent to <a href="SkRect_Reference#Rect">Rect</a> when filled. 3219If 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. 3220If 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. 3221 3222<a href="#SkPath_isRect_rect">rect</a> may be smaller than the <a href="#Path">Path</a> bounds. <a href="#Path">Path</a> bounds may include <a href="#SkPath_kMove_Verb">kMove Verb</a> points 3223that do not alter the area drawn by the returned <a href="#SkPath_isRect_rect">rect</a>. 3224 3225### Parameters 3226 3227<table> <tr> <td><a name="SkPath_isRect_rect"> <code><strong>rect </strong></code> </a></td> <td> 3228storage for bounds of <a href="SkRect_Reference#Rect">Rect</a>; may be nullptr</td> 3229 </tr> <tr> <td><a name="SkPath_isRect_isClosed"> <code><strong>isClosed </strong></code> </a></td> <td> 3230storage set to true if <a href="#Path">Path</a> is closed; may be nullptr</td> 3231 </tr> <tr> <td><a name="SkPath_isRect_direction"> <code><strong>direction </strong></code> </a></td> <td> 3232storage set to <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_isRect_direction">direction</a>; may be nullptr</td> 3233 </tr> 3234</table> 3235 3236### Return Value 3237 3238true if <a href="#Path">Path</a> contains <a href="SkRect_Reference#Rect">Rect</a> 3239 3240### Example 3241 3242<div><fiddle-embed name="063a5f0a8de1fe998d227393e0866557"><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 3243following <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 3244side of <a href="#SkPath_isRect_rect">rect</a> is made up of consecutive line segments.</div> 3245 3246#### Example Output 3247 3248~~~~ 3249empty is not rect 3250addRect is rect (10, 20, 30, 40); is closed; direction CW 3251moveTo is rect (10, 20, 30, 40); is closed; direction CW 3252lineTo is not rect 3253addPoly is rect (0, 0, 80, 80); is not closed; direction CCW 3254~~~~ 3255 3256</fiddle-embed></div> 3257 3258### See Also 3259 3260<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> 3261 3262--- 3263 3264<a name="SkPath_isNestedFillRects"></a> 3265## isNestedFillRects 3266 3267<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3268bool isNestedFillRects(SkRect rect[2], Direction dirs[2] = nullptr) const 3269</pre> 3270 3271Returns true if <a href="#Path">Path</a> is equivalent to nested <a href="SkRect_Reference#Rect">Rect</a> pair when filled. 3272If false, <a href="#SkPath_isNestedFillRects_rect">rect</a> and <a href="#SkPath_isNestedFillRects_dirs">dirs</a> are unchanged. 3273If true, <a href="#SkPath_isNestedFillRects_rect">rect</a> and <a href="#SkPath_isNestedFillRects_dirs">dirs</a> are written to if not nullptr: 3274setting <a href="#SkPath_isNestedFillRects_rect">rect</a>[0] to outer <a href="SkRect_Reference#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_rect">rect</a>[1] to inner <a href="SkRect_Reference#Rect">Rect</a>; 3275setting <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[0] to <a href="#SkPath_Direction">Direction</a> of outer <a href="SkRect_Reference#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[1] to <a href="#SkPath_Direction">Direction</a> of inner 3276<a href="SkRect_Reference#Rect">Rect</a>. 3277 3278### Parameters 3279 3280<table> <tr> <td><a name="SkPath_isNestedFillRects_rect"> <code><strong>rect </strong></code> </a></td> <td> 3281storage for <a href="SkRect_Reference#Rect">Rect</a> pair; may be nullptr</td> 3282 </tr> <tr> <td><a name="SkPath_isNestedFillRects_dirs"> <code><strong>dirs </strong></code> </a></td> <td> 3283storage for <a href="#SkPath_Direction">Direction</a> pair; may be nullptr</td> 3284 </tr> 3285</table> 3286 3287### Return Value 3288 3289true if <a href="#Path">Path</a> contains nested <a href="SkRect_Reference#Rect">Rect</a> pair 3290 3291### Example 3292 3293<div><fiddle-embed name="77e4394caf9fa083c19c21c2462efe14"> 3294 3295#### Example Output 3296 3297~~~~ 3298outer (7.5, 17.5, 32.5, 42.5); direction CW 3299inner (12.5, 22.5, 27.5, 37.5); direction CCW 3300~~~~ 3301 3302</fiddle-embed></div> 3303 3304### See Also 3305 3306<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> 3307 3308--- 3309 3310<a name="SkPath_addRect"></a> 3311## addRect 3312 3313<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3314void addRect(const SkRect& rect, Direction dir = kCW_Direction) 3315</pre> 3316 3317Add <a href="SkRect_Reference#Rect">Rect</a> to <a href="#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>, 3318starting with top-left corner of <a href="SkRect_Reference#Rect">Rect</a>; followed by top-right, bottom-right, 3319and bottom-left if <a href="#SkPath_addRect_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>; or followed by bottom-left, 3320bottom-right, and top-right if <a href="#SkPath_addRect_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>. 3321 3322### Parameters 3323 3324<table> <tr> <td><a name="SkPath_addRect_rect"> <code><strong>rect </strong></code> </a></td> <td> 3325<a href="SkRect_Reference#Rect">Rect</a> to add as a closed contour</td> 3326 </tr> <tr> <td><a name="SkPath_addRect_dir"> <code><strong>dir </strong></code> </a></td> <td> 3327<a href="#SkPath_Direction">Direction</a> to wind added contour</td> 3328 </tr> 3329</table> 3330 3331### Example 3332 3333<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. 3334The right <a href="SkRect_Reference#Rect">Rect</a> dashes starting at the top-left corner, towards the bottom.</div></fiddle-embed></div> 3335 3336### See Also 3337 3338<a href="#SkCanvas_drawRect">SkCanvas::drawRect</a> <a href="#SkPath_Direction">Direction</a> 3339 3340--- 3341 3342<a name="SkPath_addRect_2"></a> 3343 3344<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3345void addRect(const SkRect& rect, Direction dir, unsigned start) 3346</pre> 3347 3348Add <a href="SkRect_Reference#Rect">Rect</a> to <a href="#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>. 3349If <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 3350<a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="SkRect_Reference#Rect">Rect</a> corners are added counterclockwise. 3351<a href="#SkPath_addRect_2_start">start</a> determines the first corner added. 3352 3353| <a href="#SkPath_addRect_2_start">start</a> | first corner | 3354| --- | --- | 3355| 0 | top-left | 3356| 1 | top-right | 3357| 2 | bottom-right | 3358| 3 | bottom-left | 3359 3360### Parameters 3361 3362<table> <tr> <td><a name="SkPath_addRect_2_rect"> <code><strong>rect </strong></code> </a></td> <td> 3363<a href="SkRect_Reference#Rect">Rect</a> to add as a closed contour</td> 3364 </tr> <tr> <td><a name="SkPath_addRect_2_dir"> <code><strong>dir </strong></code> </a></td> <td> 3365<a href="#SkPath_Direction">Direction</a> to wind added contour</td> 3366 </tr> <tr> <td><a name="SkPath_addRect_2_start"> <code><strong>start </strong></code> </a></td> <td> 3367initial corner of <a href="SkRect_Reference#Rect">Rect</a> to add</td> 3368 </tr> 3369</table> 3370 3371### Example 3372 3373<div><fiddle-embed name="9202430b3f4f5275af8eec5cc9d7baa8"><div>The arrow is just after the initial corner and points towards the next 3374corner appended to <a href="#Path">Path</a>.</div></fiddle-embed></div> 3375 3376### See Also 3377 3378<a href="#SkCanvas_drawRect">SkCanvas::drawRect</a> <a href="#SkPath_Direction">Direction</a> 3379 3380--- 3381 3382<a name="SkPath_addRect_3"></a> 3383 3384<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3385void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, 3386 Direction dir = kCW_Direction) 3387</pre> 3388 3389Add <a href="SkRect_Reference#Rect">Rect</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="#Path">Path</a>, 3390appending <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>, 3391starting with <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_left">left</a> corner of <a href="SkRect_Reference#Rect">Rect</a>; followed by <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_right">right</a>, <a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_right">right</a>, 3392and <a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_left">left</a> if <a href="#SkPath_addRect_3_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>; or followed by <a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_left">left</a>, 3393<a href="#SkPath_addRect_3_bottom">bottom</a>-<a href="#SkPath_addRect_3_right">right</a>, and <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_right">right</a> if <a href="#SkPath_addRect_3_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>. 3394 3395### Parameters 3396 3397<table> <tr> <td><a name="SkPath_addRect_3_left"> <code><strong>left </strong></code> </a></td> <td> 3398smaller x of <a href="SkRect_Reference#Rect">Rect</a></td> 3399 </tr> <tr> <td><a name="SkPath_addRect_3_top"> <code><strong>top </strong></code> </a></td> <td> 3400smaller y of <a href="SkRect_Reference#Rect">Rect</a></td> 3401 </tr> <tr> <td><a name="SkPath_addRect_3_right"> <code><strong>right </strong></code> </a></td> <td> 3402larger x of <a href="SkRect_Reference#Rect">Rect</a></td> 3403 </tr> <tr> <td><a name="SkPath_addRect_3_bottom"> <code><strong>bottom </strong></code> </a></td> <td> 3404larger y of <a href="SkRect_Reference#Rect">Rect</a></td> 3405 </tr> <tr> <td><a name="SkPath_addRect_3_dir"> <code><strong>dir </strong></code> </a></td> <td> 3406<a href="#SkPath_Direction">Direction</a> to wind added contour</td> 3407 </tr> 3408</table> 3409 3410### Example 3411 3412<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 <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_left">left</a> corner, and continue to the <a href="#SkPath_addRect_3_right">right</a>. 3413The <a href="#SkPath_addRect_3_right">right</a> <a href="SkRect_Reference#Rect">Rect</a> dashes start at the <a href="#SkPath_addRect_3_top">top</a>-<a href="#SkPath_addRect_3_left">left</a> corner, and continue down.</div></fiddle-embed></div> 3414 3415### See Also 3416 3417<a href="#SkCanvas_drawRect">SkCanvas::drawRect</a> <a href="#SkPath_Direction">Direction</a> 3418 3419--- 3420 3421<a name="SkPath_addOval"></a> 3422## addOval 3423 3424<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3425void addOval(const SkRect& oval, Direction dir = kCW_Direction) 3426</pre> 3427 3428Add <a href="undocumented#Oval">Oval</a> to path, 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>. 3429<a href="undocumented#Oval">Oval</a> is upright ellipse bounded by <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addOval_oval">oval</a> with radii equal to half <a href="#SkPath_addOval_oval">oval</a> width 3430and half <a href="#SkPath_addOval_oval">oval</a> height. <a href="undocumented#Oval">Oval</a> begins at (<a href="#SkPath_addOval_oval">oval</a>.fRight, <a href="#SkPath_addOval_oval">oval</a>.centerY()) and continues 3431clockwise 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>. 3432 3433This form is identical to 3434 3435### Parameters 3436 3437<table> <tr> <td><a name="SkPath_addOval_oval"> <code><strong>oval </strong></code> </a></td> <td> 3438bounds of ellipse added</td> 3439 </tr> <tr> <td><a name="SkPath_addOval_dir"> <code><strong>dir </strong></code> </a></td> <td> 3440<a href="#SkPath_Direction">Direction</a> to wind ellipse</td> 3441 </tr> 3442</table> 3443 3444### Example 3445 3446<div><fiddle-embed name="cac84cf68e63a453c2a8b64c91537704"></fiddle-embed></div> 3447 3448### See Also 3449 3450<a href="#SkCanvas_drawOval">SkCanvas::drawOval</a> <a href="#SkPath_Direction">Direction</a> <a href="undocumented#Oval">Oval</a> 3451 3452--- 3453 3454<a name="SkPath_addOval_2"></a> 3455 3456<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3457void addOval(const SkRect& oval, Direction dir, unsigned start) 3458</pre> 3459 3460Add <a href="undocumented#Oval">Oval</a> to <a href="#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>. 3461<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 3462and 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 3463clockwise 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>. 3464 3465| <a href="#SkPath_addOval_2_start">start</a> | <a href="SkPoint_Reference#Point">Point</a> | 3466| --- | --- | 3467| 0 | <a href="#SkPath_addOval_2_oval">oval</a>.centerX(), <a href="#SkPath_addOval_2_oval">oval</a>.fTop | 3468| 1 | <a href="#SkPath_addOval_2_oval">oval</a>.fRight, <a href="#SkPath_addOval_2_oval">oval</a>.centerY() | 3469| 2 | <a href="#SkPath_addOval_2_oval">oval</a>.centerX(), <a href="#SkPath_addOval_2_oval">oval</a>.fBottom | 3470| 3 | <a href="#SkPath_addOval_2_oval">oval</a>.fLeft, <a href="#SkPath_addOval_2_oval">oval</a>.centerY() | 3471 3472### Parameters 3473 3474<table> <tr> <td><a name="SkPath_addOval_2_oval"> <code><strong>oval </strong></code> </a></td> <td> 3475bounds of ellipse added</td> 3476 </tr> <tr> <td><a name="SkPath_addOval_2_dir"> <code><strong>dir </strong></code> </a></td> <td> 3477<a href="#SkPath_Direction">Direction</a> to wind ellipse</td> 3478 </tr> <tr> <td><a name="SkPath_addOval_2_start"> <code><strong>start </strong></code> </a></td> <td> 3479index of initial point of ellipse</td> 3480 </tr> 3481</table> 3482 3483### Example 3484 3485<div><fiddle-embed name="ab9753174060e4a551727ef3af12924d"></fiddle-embed></div> 3486 3487### See Also 3488 3489<a href="#SkCanvas_drawOval">SkCanvas::drawOval</a> <a href="#SkPath_Direction">Direction</a> <a href="undocumented#Oval">Oval</a> 3490 3491--- 3492 3493<a name="SkPath_addCircle"></a> 3494## addCircle 3495 3496<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3497void addCircle(SkScalar x, SkScalar y, SkScalar radius, Direction dir = kCW_Direction) 3498</pre> 3499 3500Add <a href="undocumented#Circle">Circle</a> centered at (<a href="#SkPath_addCircle_x">x</a>, <a href="#SkPath_addCircle_y">y</a>) of size <a href="#SkPath_addCircle_radius">radius</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, 3501four <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: 3502(<a href="#SkPath_addCircle_x">x</a> + <a href="#SkPath_addCircle_radius">radius</a>, <a href="#SkPath_addCircle_y">y</a>), 3503continuing 3504clockwise 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>. 3505 3506Has no effect if <a href="#SkPath_addCircle_radius">radius</a> is zero or negative. 3507 3508### Parameters 3509 3510<table> <tr> <td><a name="SkPath_addCircle_x"> <code><strong>x </strong></code> </a></td> <td> 3511center of <a href="undocumented#Circle">Circle</a></td> 3512 </tr> <tr> <td><a name="SkPath_addCircle_y"> <code><strong>y </strong></code> </a></td> <td> 3513center of <a href="undocumented#Circle">Circle</a></td> 3514 </tr> <tr> <td><a name="SkPath_addCircle_radius"> <code><strong>radius </strong></code> </a></td> <td> 3515distance from center to edge</td> 3516 </tr> <tr> <td><a name="SkPath_addCircle_dir"> <code><strong>dir </strong></code> </a></td> <td> 3517<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Circle">Circle</a></td> 3518 </tr> 3519</table> 3520 3521### Example 3522 3523<div><fiddle-embed name="bd5286cb9a5e5c32cd980f72b8f400fb"></fiddle-embed></div> 3524 3525### See Also 3526 3527<a href="#SkCanvas_drawCircle">SkCanvas::drawCircle</a><sup><a href="#SkCanvas_drawCircle_2">[2]</a></sup> <a href="#SkPath_Direction">Direction</a> <a href="undocumented#Circle">Circle</a> 3528 3529--- 3530 3531<a name="SkPath_addArc"></a> 3532## addArc 3533 3534<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3535void addArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle) 3536</pre> 3537 3538Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, as the start of new <a href="#Contour">Contour</a>. <a href="#Arc">Arc</a> added is part of ellipse 3539bounded 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 3540<a href="#SkPath_addArc_sweepAngle">sweepAngle</a> are measured in degrees, where zero degrees is aligned with the 3541positive x-axis, and positive sweeps extends <a href="#Arc">Arc</a> clockwise. 3542 3543If <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 3544zero, append <a href="undocumented#Oval">Oval</a> instead of <a href="#Arc">Arc</a>. Otherwise, <a href="#SkPath_addArc_sweepAngle">sweepAngle</a> values are treated 3545modulo 360, and <a href="#Arc">Arc</a> may or may not draw depending on numeric rounding. 3546 3547### Parameters 3548 3549<table> <tr> <td><a name="SkPath_addArc_oval"> <code><strong>oval </strong></code> </a></td> <td> 3550bounds of ellipse containing <a href="#Arc">Arc</a></td> 3551 </tr> <tr> <td><a name="SkPath_addArc_startAngle"> <code><strong>startAngle </strong></code> </a></td> <td> 3552starting angle of <a href="#Arc">Arc</a> in degrees</td> 3553 </tr> <tr> <td><a name="SkPath_addArc_sweepAngle"> <code><strong>sweepAngle </strong></code> </a></td> <td> 3554sweep, in degrees. Positive is clockwise; treated modulo 360</td> 3555 </tr> 3556</table> 3557 3558### Example 3559 3560<div><fiddle-embed name="9cf5122475624e4cf39f06c698f80b1a"><div>The middle row of the left and right columns draw differently from the entries 3561above and below because <a href="#SkPath_addArc_sweepAngle">sweepAngle</a> is outside of the range of +/-360, 3562and <a href="#SkPath_addArc_startAngle">startAngle</a> modulo 90 is not zero.</div></fiddle-embed></div> 3563 3564### See Also 3565 3566<a href="#Arc">Arc</a> <a href="#SkPath_arcTo">arcTo</a><sup><a href="#SkPath_arcTo_2">[2]</a></sup><sup><a href="#SkPath_arcTo_3">[3]</a></sup><sup><a href="#SkPath_arcTo_4">[4]</a></sup><sup><a href="#SkPath_arcTo_5">[5]</a></sup> <a href="#SkCanvas_drawArc">SkCanvas::drawArc</a> 3567 3568--- 3569 3570<a name="SkPath_addRoundRect"></a> 3571## addRoundRect 3572 3573<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3574void addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, Direction dir = kCW_Direction) 3575</pre> 3576 3577Append <a href="undocumented#Round_Rect">Round Rect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#Contour">Contour</a>. <a href="undocumented#Round_Rect">Round Rect</a> has bounds 3578equal 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 3579<a href="#SkPath_addRoundRect_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at top-left of the lower-left corner and 3580winds clockwise. If <a href="#SkPath_addRoundRect_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at the bottom-left 3581of the upper-left corner and winds counterclockwise. 3582 3583If 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 3584corners 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 3585<a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addRoundRect_rect">rect</a> to <a href="#Path">Path</a>. 3586 3587After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect. 3588 3589### Parameters 3590 3591<table> <tr> <td><a name="SkPath_addRoundRect_rect"> <code><strong>rect </strong></code> </a></td> <td> 3592bounds of <a href="undocumented#Round_Rect">Round Rect</a></td> 3593 </tr> <tr> <td><a name="SkPath_addRoundRect_rx"> <code><strong>rx </strong></code> </a></td> <td> 3594x-radius of rounded corners on the <a href="undocumented#Round_Rect">Round Rect</a></td> 3595 </tr> <tr> <td><a name="SkPath_addRoundRect_ry"> <code><strong>ry </strong></code> </a></td> <td> 3596y-radius of rounded corners on the <a href="undocumented#Round_Rect">Round Rect</a></td> 3597 </tr> <tr> <td><a name="SkPath_addRoundRect_dir"> <code><strong>dir </strong></code> </a></td> <td> 3598<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> 3599 </tr> 3600</table> 3601 3602### Example 3603 3604<div><fiddle-embed name="24736f685f265cf533f1700c042db353"><div>If either radius is zero, path contains <a href="SkRect_Reference#Rect">Rect</a> and is drawn red. 3605If sides are only radii, path contains <a href="undocumented#Oval">Oval</a> and is drawn blue. 3606All remaining path draws are convex, and are drawn in gray; no 3607paths constructed from <a href="#SkPath_addRoundRect">addRoundRect</a> are concave, so none are 3608drawn in green.</div></fiddle-embed></div> 3609 3610### See Also 3611 3612<a href="#SkPath_addRRect">addRRect</a><sup><a href="#SkPath_addRRect_2">[2]</a></sup> <a href="#SkCanvas_drawRoundRect">SkCanvas::drawRoundRect</a> 3613 3614--- 3615 3616<a name="SkPath_addRoundRect_2"></a> 3617 3618<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3619void addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW_Direction) 3620</pre> 3621 3622Append <a href="undocumented#Round_Rect">Round Rect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#Contour">Contour</a>. <a href="undocumented#Round_Rect">Round Rect</a> has bounds 3623equal 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 3624array. 3625 3626| <a href="#SkPath_addRoundRect_2_radii">radii</a> index | location | 3627| --- | --- | 3628| 0 | x-radius of top-left corner | 3629| 1 | y-radius of top-left corner | 3630| 2 | x-radius of top-right corner | 3631| 3 | y-radius of top-right corner | 3632| 4 | x-radius of bottom-right corner | 3633| 5 | y-radius of bottom-right corner | 3634| 6 | x-radius of bottom-left corner | 3635| 7 | y-radius of bottom-left corner | 3636 3637If <a href="#SkPath_addRoundRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at top-left of the lower-left corner 3638and winds clockwise. If <a href="#SkPath_addRoundRect_2_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="undocumented#Round_Rect">Round Rect</a> starts at the 3639bottom-left of the upper-left corner and winds counterclockwise. 3640 3641If 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 3642uniformly until the corners fit. If either radius of a corner is less than or 3643equal to zero, both are treated as zero. 3644 3645After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect. 3646 3647### Parameters 3648 3649<table> <tr> <td><a name="SkPath_addRoundRect_2_rect"> <code><strong>rect </strong></code> </a></td> <td> 3650bounds of <a href="undocumented#Round_Rect">Round Rect</a></td> 3651 </tr> <tr> <td><a name="SkPath_addRoundRect_2_radii"> <code><strong>radii </strong></code> </a></td> <td> 3652array of 8 <a href="undocumented#SkScalar">SkScalar</a> values, a radius pair for each corner</td> 3653 </tr> <tr> <td><a name="SkPath_addRoundRect_2_dir"> <code><strong>dir </strong></code> </a></td> <td> 3654<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> 3655 </tr> 3656</table> 3657 3658### Example 3659 3660<div><fiddle-embed name="c43d70606b4ee464d2befbcf448c5e73"></fiddle-embed></div> 3661 3662### See Also 3663 3664<a href="#SkPath_addRRect">addRRect</a><sup><a href="#SkPath_addRRect_2">[2]</a></sup> <a href="#SkCanvas_drawRoundRect">SkCanvas::drawRoundRect</a> 3665 3666--- 3667 3668<a name="SkPath_addRRect"></a> 3669## addRRect 3670 3671<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3672void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction) 3673</pre> 3674 3675Add <a href="#SkPath_addRRect_rrect">rrect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#Contour">Contour</a>. If 3676<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 3677winds 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 3678of the upper-left corner and winds counterclockwise. 3679 3680After appending, <a href="#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="undocumented#Round_Rect">Round Rect</a>. 3681 3682### Parameters 3683 3684<table> <tr> <td><a name="SkPath_addRRect_rrect"> <code><strong>rrect </strong></code> </a></td> <td> 3685bounds and radii of rounded rectangle</td> 3686 </tr> <tr> <td><a name="SkPath_addRRect_dir"> <code><strong>dir </strong></code> </a></td> <td> 3687<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> 3688 </tr> 3689</table> 3690 3691### Example 3692 3693<div><fiddle-embed name="d9ecd58081b5bc77a157636fcb345dc6"></fiddle-embed></div> 3694 3695### See Also 3696 3697<a href="#SkPath_addRoundRect">addRoundRect</a><sup><a href="#SkPath_addRoundRect_2">[2]</a></sup> <a href="#SkCanvas_drawRRect">SkCanvas::drawRRect</a> 3698 3699--- 3700 3701<a name="SkPath_addRRect_2"></a> 3702 3703<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3704void addRRect(const SkRRect& rrect, Direction dir, unsigned start) 3705</pre> 3706 3707Add <a href="#SkPath_addRRect_2_rrect">rrect</a> to <a href="#Path">Path</a>, creating a new closed <a href="#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> 3708winds 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. 3709<a href="#SkPath_addRRect_2_start">start</a> determines the first point of <a href="#SkPath_addRRect_2_rrect">rrect</a> to add. 3710 3711| <a href="#SkPath_addRRect_2_start">start</a> | location | 3712| --- | --- | 3713| 0 | right of top-left corner | 3714| 1 | left of top-right corner | 3715| 2 | bottom of top-right corner | 3716| 3 | top of bottom-right corner | 3717| 4 | left of bottom-right corner | 3718| 5 | right of bottom-left corner | 3719| 6 | top of bottom-left corner | 3720| 7 | bottom of top-left corner | 3721 3722After appending, <a href="#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="undocumented#Round_Rect">Round Rect</a>. 3723 3724### Parameters 3725 3726<table> <tr> <td><a name="SkPath_addRRect_2_rrect"> <code><strong>rrect </strong></code> </a></td> <td> 3727bounds and radii of rounded rectangle</td> 3728 </tr> <tr> <td><a name="SkPath_addRRect_2_dir"> <code><strong>dir </strong></code> </a></td> <td> 3729<a href="#SkPath_Direction">Direction</a> to wind <a href="undocumented#Round_Rect">Round Rect</a></td> 3730 </tr> <tr> <td><a name="SkPath_addRRect_2_start"> <code><strong>start </strong></code> </a></td> <td> 3731index of initial point of <a href="undocumented#Round_Rect">Round Rect</a></td> 3732 </tr> 3733</table> 3734 3735### Example 3736 3737<div><fiddle-embed name="f18740ffcb10a499007488948c2cd60d"></fiddle-embed></div> 3738 3739### See Also 3740 3741<a href="#SkPath_addRoundRect">addRoundRect</a><sup><a href="#SkPath_addRoundRect_2">[2]</a></sup> <a href="#SkCanvas_drawRRect">SkCanvas::drawRRect</a> 3742 3743--- 3744 3745<a name="SkPath_addPoly"></a> 3746## addPoly 3747 3748<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3749void addPoly(const SkPoint pts[], int count, bool close) 3750</pre> 3751 3752Add <a href="#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. 3753<a href="#Contour">Contour</a> added starts at <a href="#SkPath_addPoly_pts">pts</a>[0], then adds a line for every additional <a href="SkPoint_Reference#Point">Point</a> 3754in <a href="#SkPath_addPoly_pts">pts</a> array. If close is true,appends <a href="#SkPath_kClose_Verb">kClose Verb</a> to <a href="#Path">Path</a>, connecting 3755<a href="#SkPath_addPoly_pts">pts</a>[<a href="#SkPath_addPoly_count">count</a> - 1] and <a href="#SkPath_addPoly_pts">pts</a>[0]. 3756 3757If <a href="#SkPath_addPoly_count">count</a> is zero, append <a href="#SkPath_kMove_Verb">kMove Verb</a> to path. 3758Has no effect if <a href="#SkPath_addPoly_count">count</a> is less than one. 3759 3760### Parameters 3761 3762<table> <tr> <td><a name="SkPath_addPoly_pts"> <code><strong>pts </strong></code> </a></td> <td> 3763array of <a href="undocumented#Line">Line</a> sharing end and start <a href="SkPoint_Reference#Point">Point</a></td> 3764 </tr> <tr> <td><a name="SkPath_addPoly_count"> <code><strong>count </strong></code> </a></td> <td> 3765length of <a href="SkPoint_Reference#Point">Point</a> array</td> 3766 </tr> <tr> <td><a name="SkPath_addPoly_close"> <code><strong>close </strong></code> </a></td> <td> 3767true to add <a href="undocumented#Line">Line</a> connecting <a href="#Contour">Contour</a> end and start</td> 3768 </tr> 3769</table> 3770 3771### Example 3772 3773<div><fiddle-embed name="182b3999772f330f3b0b891b492634ae"></fiddle-embed></div> 3774 3775### See Also 3776 3777<a href="#SkCanvas_drawPoints">SkCanvas::drawPoints</a> 3778 3779--- 3780 3781## <a name="SkPath_AddPathMode"></a> Enum SkPath::AddPathMode 3782 3783<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3784enum <a href="#SkPath_AddPathMode">AddPathMode</a> { 3785<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>, 3786<a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>, 3787};</pre> 3788 3789<a href="#SkPath_AddPathMode">AddPathMode</a> chooses how <a href="#SkPath_addPath">addPath</a> appends. Adding one <a href="#Path">Path</a> to another can extend 3790the last <a href="#Contour">Contour</a> or start a new <a href="#Contour">Contour</a>. 3791 3792### Constants 3793 3794<table> 3795 <tr> 3796 <td><a name="SkPath_kAppend_AddPathMode"> <code><strong>SkPath::kAppend_AddPathMode </strong></code> </a></td><td>Path Verbs, Points, and Conic_Weights are appended to destination unaltered.</td><td>Since <a href="#Path">Path</a> <a href="#Verb_Array">Verb Array</a> begins with <a href="#SkPath_kMove_Verb">kMove Verb</a> if src is not empty, this 3797starts a new <a href="#Contour">Contour</a>.</td> 3798 </tr> 3799 <tr> 3800 <td><a name="SkPath_kExtend_AddPathMode"> <code><strong>SkPath::kExtend_AddPathMode </strong></code> </a></td><td>If destination is closed or empty, start a new Contour. If destination</td><td>is not empty, add <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point</a> to added <a href="#Path">Path</a> first <a href="SkPoint_Reference#Point">Point</a>. Skip added 3801<a href="#Path">Path</a> initial <a href="#SkPath_kMove_Verb">kMove Verb</a>, then append remining <a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a>.</td> 3802 </tr> 3803</table> 3804 3805### Example 3806 3807<div><fiddle-embed name="801b02e74c64aafdb734f2e5cf3e5ab0"><div>test is built from path, open on the top row, and closed on the bottom row. 3808The left column uses <a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>; the right uses <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>. 3809The top right composition is made up of one contour; the other three have two.</div></fiddle-embed></div> 3810 3811### See Also 3812 3813<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_reverseAddPath">reverseAddPath</a> 3814 3815 3816 3817<a name="SkPath_addPath"></a> 3818## addPath 3819 3820<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3821void addPath(const SkPath& src, SkScalar dx, SkScalar dy, AddPathMode mode = kAppend_AddPathMode) 3822</pre> 3823 3824Append <a href="#SkPath_addPath_src">src</a> to <a href="#Path">Path</a>, offset by (<a href="#SkPath_addPath_dx">dx</a>, <a href="#SkPath_addPath_dy">dy</a>). 3825 3826If <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="#Point_Array">Point Array</a>, and <a href="#Weight">Conic Weights</a> are 3827added 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 3828<a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a>. 3829 3830### Parameters 3831 3832<table> <tr> <td><a name="SkPath_addPath_src"> <code><strong>src </strong></code> </a></td> <td> 3833<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a> to add</td> 3834 </tr> <tr> <td><a name="SkPath_addPath_dx"> <code><strong>dx </strong></code> </a></td> <td> 3835offset added to <a href="#SkPath_addPath_src">src</a> <a href="#Point_Array">Point Array</a> x coordinates</td> 3836 </tr> <tr> <td><a name="SkPath_addPath_dy"> <code><strong>dy </strong></code> </a></td> <td> 3837offset added to <a href="#SkPath_addPath_src">src</a> <a href="#Point_Array">Point Array</a> y coordinates</td> 3838 </tr> <tr> <td><a name="SkPath_addPath_mode"> <code><strong>mode </strong></code> </a></td> <td> 3839<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a> or <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a></td> 3840 </tr> 3841</table> 3842 3843### Example 3844 3845<div><fiddle-embed name="c416bddfe286628974e1c7f0fd66f3f4"></fiddle-embed></div> 3846 3847### See Also 3848 3849<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkPath_reverseAddPath">reverseAddPath</a> 3850 3851--- 3852 3853<a name="SkPath_addPath_2"></a> 3854 3855<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3856void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode) 3857</pre> 3858 3859Append <a href="#SkPath_addPath_2_src">src</a> to <a href="#Path">Path</a>. 3860 3861If <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="#Point_Array">Point Array</a>, and <a href="#Weight">Conic Weights</a> are 3862added 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 3863<a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a>. 3864 3865### Parameters 3866 3867<table> <tr> <td><a name="SkPath_addPath_2_src"> <code><strong>src </strong></code> </a></td> <td> 3868<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a> to add</td> 3869 </tr> <tr> <td><a name="SkPath_addPath_2_mode"> <code><strong>mode </strong></code> </a></td> <td> 3870<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a> or <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a></td> 3871 </tr> 3872</table> 3873 3874### Example 3875 3876<div><fiddle-embed name="84b2d1c0fc29f1b35e855b6fc6672f9e"></fiddle-embed></div> 3877 3878### See Also 3879 3880<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_reverseAddPath">reverseAddPath</a> 3881 3882--- 3883 3884<a name="SkPath_addPath_3"></a> 3885 3886<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3887void addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend_AddPathMode) 3888</pre> 3889 3890Append <a href="#SkPath_addPath_3_src">src</a> to <a href="#Path">Path</a>, transformed by <a href="#SkPath_addPath_3_matrix">matrix</a>. Transformed curves may have different 3891<a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a>. 3892 3893If <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="#Point_Array">Point Array</a>, and <a href="#Weight">Conic Weights</a> are 3894added 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 3895<a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a>. 3896 3897### Parameters 3898 3899<table> <tr> <td><a name="SkPath_addPath_3_src"> <code><strong>src </strong></code> </a></td> <td> 3900<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a> to add</td> 3901 </tr> <tr> <td><a name="SkPath_addPath_3_matrix"> <code><strong>matrix </strong></code> </a></td> <td> 3902transform applied to <a href="#SkPath_addPath_3_src">src</a></td> 3903 </tr> <tr> <td><a name="SkPath_addPath_3_mode"> <code><strong>mode </strong></code> </a></td> <td> 3904<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a> or <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a></td> 3905 </tr> 3906</table> 3907 3908### Example 3909 3910<div><fiddle-embed name="3a90a91030f7289d5df0671d342dbbad"></fiddle-embed></div> 3911 3912### See Also 3913 3914<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkPath_reverseAddPath">reverseAddPath</a> 3915 3916--- 3917 3918<a name="SkPath_reverseAddPath"></a> 3919## reverseAddPath 3920 3921<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3922void reverseAddPath(const SkPath& src) 3923</pre> 3924 3925Append <a href="#SkPath_reverseAddPath_src">src</a> to <a href="#Path">Path</a>, from back to front. 3926Reversed <a href="#SkPath_reverseAddPath_src">src</a> always appends a new <a href="#Contour">Contour</a> to <a href="#Path">Path</a>. 3927 3928### Parameters 3929 3930<table> <tr> <td><a name="SkPath_reverseAddPath_src"> <code><strong>src </strong></code> </a></td> <td> 3931<a href="#Path">Path</a> <a href="#Verb">Verbs</a>, <a href="#Point">Points</a>, and <a href="#Weight">Conic Weights</a> to add</td> 3932 </tr> 3933</table> 3934 3935### Example 3936 3937<div><fiddle-embed name="5e8513f073db09acde3ff616f6426e3d"></fiddle-embed></div> 3938 3939### See Also 3940 3941<a href="#SkPath_AddPathMode">AddPathMode</a> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> 3942 3943--- 3944 3945<a name="SkPath_offset"></a> 3946## offset 3947 3948<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3949void offset(SkScalar dx, SkScalar dy, SkPath* dst) const 3950</pre> 3951 3952Offset <a href="#Point_Array">Point Array</a> by (<a href="#SkPath_offset_dx">dx</a>, <a href="#SkPath_offset_dy">dy</a>). Offset <a href="#Path">Path</a> replaces <a href="#SkPath_offset_dst">dst</a>. 3953If <a href="#SkPath_offset_dst">dst</a> is nullptr, <a href="#Path">Path</a> is replaced by offset data. 3954 3955### Parameters 3956 3957<table> <tr> <td><a name="SkPath_offset_dx"> <code><strong>dx </strong></code> </a></td> <td> 3958offset added to <a href="#Point_Array">Point Array</a> x coordinates</td> 3959 </tr> <tr> <td><a name="SkPath_offset_dy"> <code><strong>dy </strong></code> </a></td> <td> 3960offset added to <a href="#Point_Array">Point Array</a> y coordinates</td> 3961 </tr> <tr> <td><a name="SkPath_offset_dst"> <code><strong>dst </strong></code> </a></td> <td> 3962overwritten, translated copy of <a href="#Path">Path</a>; may be nullptr</td> 3963 </tr> 3964</table> 3965 3966### Example 3967 3968<div><fiddle-embed name="1d1892196ba5bda257df4f3351abd084"></fiddle-embed></div> 3969 3970### See Also 3971 3972<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> 3973 3974--- 3975 3976<a name="SkPath_offset_2"></a> 3977 3978<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 3979void offset(SkScalar dx, SkScalar dy) 3980</pre> 3981 3982Offset <a href="#Point_Array">Point Array</a> by (<a href="#SkPath_offset_2_dx">dx</a>, <a href="#SkPath_offset_2_dy">dy</a>). <a href="#Path">Path</a> is replaced by offset data. 3983 3984### Parameters 3985 3986<table> <tr> <td><a name="SkPath_offset_2_dx"> <code><strong>dx </strong></code> </a></td> <td> 3987offset added to <a href="#Point_Array">Point Array</a> x coordinates</td> 3988 </tr> <tr> <td><a name="SkPath_offset_2_dy"> <code><strong>dy </strong></code> </a></td> <td> 3989offset added to <a href="#Point_Array">Point Array</a> y coordinates</td> 3990 </tr> 3991</table> 3992 3993### Example 3994 3995<div><fiddle-embed name="5188d77585715db30bef228f2dfbcccd"></fiddle-embed></div> 3996 3997### See Also 3998 3999<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_transform">transform</a><sup><a href="#SkPath_transform_2">[2]</a></sup> <a href="#SkCanvas_translate">SkCanvas::translate()</a> 4000 4001--- 4002 4003<a name="SkPath_transform"></a> 4004## transform 4005 4006<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4007void transform(const SkMatrix& matrix, SkPath* dst) const 4008</pre> 4009 4010Transform <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and weight by <a href="#SkPath_transform_matrix">matrix</a>. 4011transform may change <a href="#Verb">Verbs</a> and increase their number. 4012Transformed <a href="#Path">Path</a> replaces <a href="#SkPath_transform_dst">dst</a>; if <a href="#SkPath_transform_dst">dst</a> is nullptr, original data 4013is replaced. 4014 4015### Parameters 4016 4017<table> <tr> <td><a name="SkPath_transform_matrix"> <code><strong>matrix </strong></code> </a></td> <td> 4018<a href="SkMatrix_Reference#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td> 4019 </tr> <tr> <td><a name="SkPath_transform_dst"> <code><strong>dst </strong></code> </a></td> <td> 4020overwritten, transformed copy of <a href="#Path">Path</a>; may be nullptr</td> 4021 </tr> 4022</table> 4023 4024### Example 4025 4026<div><fiddle-embed name="99761add116ce3b0730557224c1b0105"></fiddle-embed></div> 4027 4028### See Also 4029 4030<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkCanvas_concat">SkCanvas::concat()</a> <a href="SkMatrix_Reference#SkMatrix">SkMatrix</a> 4031 4032--- 4033 4034<a name="SkPath_transform_2"></a> 4035 4036<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4037void transform(const SkMatrix& matrix) 4038</pre> 4039 4040Transform <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and weight by <a href="#SkPath_transform_2_matrix">matrix</a>. 4041transform may change <a href="#Verb">Verbs</a> and increase their number. 4042<a href="#Path">Path</a> is replaced by transformed data. 4043 4044### Parameters 4045 4046<table> <tr> <td><a name="SkPath_transform_2_matrix"> <code><strong>matrix </strong></code> </a></td> <td> 4047<a href="SkMatrix_Reference#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td> 4048 </tr> 4049</table> 4050 4051### Example 4052 4053<div><fiddle-embed name="c40979a3b92a30cfb7bae36abcc1d805"></fiddle-embed></div> 4054 4055### See Also 4056 4057<a href="#SkPath_addPath">addPath</a><sup><a href="#SkPath_addPath_2">[2]</a></sup><sup><a href="#SkPath_addPath_3">[3]</a></sup> <a href="#SkPath_offset">offset</a><sup><a href="#SkPath_offset_2">[2]</a></sup> <a href="#SkCanvas_concat">SkCanvas::concat()</a> <a href="SkMatrix_Reference#SkMatrix">SkMatrix</a> 4058 4059--- 4060 4061## <a name="Last_Point"></a> Last Point 4062 4063<a href="#Path">Path</a> is defined cumulatively, often by adding a segment to the end of last 4064<a href="#Contour">Contour</a>. <a href="#Last_Point">Last Point</a> of <a href="#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>. 4065<a href="#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>. 4066 4067<a name="SkPath_getLastPt"></a> 4068## getLastPt 4069 4070<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4071bool getLastPt(SkPoint* lastPt) const 4072</pre> 4073 4074Returns <a href="#Last_Point">Last Point</a> on <a href="#Path">Path</a> in <a href="#SkPath_getLastPt_lastPt">lastPt</a>. Returns false if <a href="#Point_Array">Point Array</a> is empty, 4075storing (0, 0) if <a href="#SkPath_getLastPt_lastPt">lastPt</a> is not nullptr. 4076 4077### Parameters 4078 4079<table> <tr> <td><a name="SkPath_getLastPt_lastPt"> <code><strong>lastPt </strong></code> </a></td> <td> 4080storage for final <a href="SkPoint_Reference#Point">Point</a> in <a href="#Point_Array">Point Array</a>; may be nullptr</td> 4081 </tr> 4082</table> 4083 4084### Return Value 4085 4086true if <a href="#Point_Array">Point Array</a> contains one or more <a href="#Point">Points</a> 4087 4088### Example 4089 4090<div><fiddle-embed name="df8160dd7ac8aa4b40fce7286fe49952"> 4091 4092#### Example Output 4093 4094~~~~ 4095last point: 35.2786, 52.9772 4096~~~~ 4097 4098</fiddle-embed></div> 4099 4100### See Also 4101 4102<a href="#SkPath_setLastPt">setLastPt</a><sup><a href="#SkPath_setLastPt_2">[2]</a></sup> 4103 4104--- 4105 4106<a name="SkPath_setLastPt"></a> 4107## setLastPt 4108 4109<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4110void setLastPt(SkScalar x, SkScalar y) 4111</pre> 4112 4113Set <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="#Point_Array">Point Array</a> is empty, append <a href="#SkPath_kMove_Verb">kMove Verb</a> to 4114<a href="#Verb_Array">Verb Array</a> and (<a href="#SkPath_setLastPt_x">x</a>, <a href="#SkPath_setLastPt_y">y</a>) to <a href="#Point_Array">Point Array</a>. 4115 4116### Parameters 4117 4118<table> <tr> <td><a name="SkPath_setLastPt_x"> <code><strong>x </strong></code> </a></td> <td> 4119set <a href="#SkPath_setLastPt_x">x</a>-coordinate of <a href="#Last_Point">Last Point</a></td> 4120 </tr> <tr> <td><a name="SkPath_setLastPt_y"> <code><strong>y </strong></code> </a></td> <td> 4121set <a href="#SkPath_setLastPt_y">y</a>-coordinate of <a href="#Last_Point">Last Point</a></td> 4122 </tr> 4123</table> 4124 4125### Example 4126 4127<div><fiddle-embed name="542c5afaea5f57baa11d0561dd402e18"></fiddle-embed></div> 4128 4129### See Also 4130 4131<a href="#SkPath_getLastPt">getLastPt</a> 4132 4133--- 4134 4135<a name="SkPath_setLastPt_2"></a> 4136 4137<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4138void setLastPt(const SkPoint& p) 4139</pre> 4140 4141Set the last point on the path. If no points have been added, 4142 4143### Parameters 4144 4145<table> <tr> <td><a name="SkPath_setLastPt_2_p"> <code><strong>p </strong></code> </a></td> <td> 4146set value of <a href="#Last_Point">Last Point</a></td> 4147 </tr> 4148</table> 4149 4150### Example 4151 4152<div><fiddle-embed name="6fa5e8f9513b3225e106778592e27e94"></fiddle-embed></div> 4153 4154### See Also 4155 4156<a href="#SkPath_getLastPt">getLastPt</a> 4157 4158--- 4159 4160## <a name="SkPath_SegmentMask"></a> Enum SkPath::SegmentMask 4161 4162<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4163enum <a href="#SkPath_SegmentMask">SegmentMask</a> { 4164<a href="#SkPath_kLine_SegmentMask">kLine SegmentMask</a> = 1 << 0, 4165<a href="#SkPath_kQuad_SegmentMask">kQuad SegmentMask</a> = 1 << 1, 4166<a href="#SkPath_kConic_SegmentMask">kConic SegmentMask</a> = 1 << 2, 4167<a href="#SkPath_kCubic_SegmentMask">kCubic SegmentMask</a> = 1 << 3, 4168};</pre> 4169 4170<a href="#SkPath_SegmentMask">SegmentMask</a> constants correspond to each drawing <a href="#SkPath_Verb">Verb</a> type in <a href="#Path">Path</a>; for 4171instance, if <a href="#Path">Path</a> only contains <a href="#Line">Lines</a>, only the <a href="#SkPath_kLine_SegmentMask">kLine SegmentMask</a> bit is set. 4172 4173### Constants 4174 4175<table> 4176 <tr> 4177 <td><a name="SkPath_kLine_SegmentMask"> <code><strong>SkPath::kLine_SegmentMask </strong></code> </a></td><td>1</td><td>Set if <a href="#Verb_Array">Verb Array</a> contains <a href="#SkPath_kLine_Verb">kLine Verb</a>.</td> 4178 </tr> 4179 <tr> 4180 <td><a name="SkPath_kQuad_SegmentMask"> <code><strong>SkPath::kQuad_SegmentMask </strong></code> </a></td><td>2</td><td>Set if <a href="#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="#Quad">Quad</a>.</td> 4181 </tr> 4182 <tr> 4183 <td><a name="SkPath_kConic_SegmentMask"> <code><strong>SkPath::kConic_SegmentMask </strong></code> </a></td><td>4</td><td>Set if <a href="#Verb_Array">Verb Array</a> contains <a href="#SkPath_kConic_Verb">kConic Verb</a>.</td> 4184 </tr> 4185 <tr> 4186 <td><a name="SkPath_kCubic_SegmentMask"> <code><strong>SkPath::kCubic_SegmentMask </strong></code> </a></td><td>8</td><td>Set if <a href="#Verb_Array">Verb Array</a> contains <a href="#SkPath_kCubic_Verb">kCubic Verb</a>.</td> 4187 </tr> 4188</table> 4189 4190### Example 4191 4192<div><fiddle-embed name="0972a1bd6e012c7519d3998afc32e69f"><div>When <a href="#SkPath_conicTo">conicTo</a> has a weight of one, <a href="#Quad">Quad</a> is added to <a href="#Path">Path</a>.</div> 4193 4194#### Example Output 4195 4196~~~~ 4197Path kConic_SegmentMask is clear 4198Path kQuad_SegmentMask is set 4199~~~~ 4200 4201</fiddle-embed></div> 4202 4203### See Also 4204 4205<a href="#SkPath_getSegmentMasks">getSegmentMasks</a> <a href="#SkPath_Verb">Verb</a> 4206 4207 4208 4209<a name="SkPath_getSegmentMasks"></a> 4210## getSegmentMasks 4211 4212<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4213uint32_t getSegmentMasks() const 4214</pre> 4215 4216Returns a mask, where each set bit corresponds to a <a href="#SkPath_SegmentMask">SegmentMask</a> constant 4217if <a href="#Path">Path</a> contains one or more <a href="#Verb">Verbs</a> of that type. 4218Returns zero if <a href="#Path">Path</a> contains no <a href="#Line">Lines</a>, or <a href="#Curve">Curves</a>: <a href="#Quad">Quads</a>, <a href="#Conic">Conics</a>, or <a href="#Cubic">Cubics</a>. 4219 4220<a href="#SkPath_getSegmentMasks">getSegmentMasks</a> returns a cached result; it is very fast. 4221 4222### Return Value 4223 4224<a href="#SkPath_SegmentMask">SegmentMask</a> bits or zero 4225 4226### Example 4227 4228<div><fiddle-embed name="dd9f620b419c8ca18cd306c881aadb5f"> 4229 4230#### Example Output 4231 4232~~~~ 4233mask quad set 4234~~~~ 4235 4236</fiddle-embed></div> 4237 4238### See Also 4239 4240<a href="#SkPath_getSegmentMasks">getSegmentMasks</a> <a href="#SkPath_Verb">Verb</a> 4241 4242--- 4243 4244<a name="SkPath_contains"></a> 4245## contains 4246 4247<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4248bool contains(SkScalar x, SkScalar y) const 4249</pre> 4250 4251Returns true if the point (<a href="#SkPath_contains_x">x</a>, <a href="#SkPath_contains_y">y</a>) is contained by <a href="#Path">Path</a>, taking into 4252account <a href="#SkPath_FillType">FillType</a>. 4253 4254| <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 | 4255| --- | --- | 4256| <a href="#SkPath_kWinding_FillType">kWinding FillType</a> | a non-zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>. | 4257| <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a> | an odd number of <a href="#Contour">Contours</a>. | 4258| <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a> | a zero sum of <a href="#Contour">Contour</a> <a href="#Direction">Directions</a>. | 4259| <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a> | and even number of <a href="#Contour">Contours</a>. | 4260 4261### Parameters 4262 4263<table> <tr> <td><a name="SkPath_contains_x"> <code><strong>x </strong></code> </a></td> <td> 4264<a href="#SkPath_contains_x">x</a>-coordinate of containment test</td> 4265 </tr> <tr> <td><a name="SkPath_contains_y"> <code><strong>y </strong></code> </a></td> <td> 4266<a href="#SkPath_contains_y">y</a>-coordinate of containment test</td> 4267 </tr> 4268</table> 4269 4270### Return Value 4271 4272true if <a href="SkPoint_Reference#Point">Point</a> is in <a href="#Path">Path</a> 4273 4274### Example 4275 4276<div><fiddle-embed name="c0216b3f7ebd80b9589ae5728f08fc80"></fiddle-embed></div> 4277 4278### See Also 4279 4280<a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> <a href="#Fill_Type">Fill Type</a> <a href="undocumented#Op">Op</a> 4281 4282--- 4283 4284<a name="SkPath_dump"></a> 4285## dump 4286 4287<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4288void dump(SkWStream* stream, bool forceClose, bool dumpAsHex) const 4289</pre> 4290 4291Writes text representation of <a href="#Path">Path</a> to <a href="#SkPath_dump_stream">stream</a>. If <a href="#SkPath_dump_stream">stream</a> is nullptr, writes to 4292standard output. Set <a href="#SkPath_dump_forceClose">forceClose</a> to true to get edges used to fill <a href="#Path">Path</a>. 4293Set <a href="#SkPath_dump_dumpAsHex">dumpAsHex</a> true to generate exact binary representations 4294of floating point numbers used in <a href="#Point_Array">Point Array</a> and <a href="#Weight">Conic Weights</a>. 4295 4296### Parameters 4297 4298<table> <tr> <td><a name="SkPath_dump_stream"> <code><strong>stream </strong></code> </a></td> <td> 4299writable <a href="undocumented#Stream">Stream</a> receiving <a href="#Path">Path</a> text representation; may be nullptr</td> 4300 </tr> <tr> <td><a name="SkPath_dump_forceClose"> <code><strong>forceClose </strong></code> </a></td> <td> 4301true if missing <a href="#SkPath_kClose_Verb">kClose Verb</a> is output</td> 4302 </tr> <tr> <td><a name="SkPath_dump_dumpAsHex"> <code><strong>dumpAsHex </strong></code> </a></td> <td> 4303true if <a href="undocumented#SkScalar">SkScalar</a> values are written as hexadecimal</td> 4304 </tr> 4305</table> 4306 4307### Example 4308 4309<div><fiddle-embed name="8036d764452a62f9953af50846f0f3c0"> 4310 4311#### Example Output 4312 4313~~~~ 4314path.setFillType(SkPath::kWinding_FillType); 4315path.moveTo(0, 0); 4316path.quadTo(20, 30, 40, 50); 4317path.setFillType(SkPath::kWinding_FillType); 4318path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4319path.quadTo(SkBits2Float(0x41a00000), SkBits2Float(0x41f00000), SkBits2Float(0x42200000), SkBits2Float(0x42480000)); // 20, 30, 40, 50 4320path.setFillType(SkPath::kWinding_FillType); 4321path.moveTo(0, 0); 4322path.quadTo(20, 30, 40, 50); 4323path.lineTo(0, 0); 4324path.close(); 4325path.setFillType(SkPath::kWinding_FillType); 4326path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4327path.quadTo(SkBits2Float(0x41a00000), SkBits2Float(0x41f00000), SkBits2Float(0x42200000), SkBits2Float(0x42480000)); // 20, 30, 40, 50 4328path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4329path.close(); 4330~~~~ 4331 4332</fiddle-embed></div> 4333 4334### See Also 4335 4336<a href="#SkRect_dump">SkRect::dump()</a><sup><a href="#SkRect_dump_2">[2]</a></sup> <a href="#SkRRect_dump">SkRRect::dump()</a> <a href="#SkPathMeasure_dump">SkPathMeasure::dump()</a> 4337 4338--- 4339 4340<a name="SkPath_dump_2"></a> 4341 4342<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4343void dump() const 4344</pre> 4345 4346Writes text representation of <a href="#Path">Path</a> to standard output. The representation may be 4347directly compiled as C++ code. Floating point values are written 4348with limited precision; it may not be possible to reconstruct original <a href="#Path">Path</a> 4349from output. 4350 4351### Example 4352 4353<div><fiddle-embed name="92e0032f85181795d1f8b5a2c8e4e4b7"> 4354 4355#### Example Output 4356 4357~~~~ 4358path.setFillType(SkPath::kWinding_FillType); 4359path.moveTo(0, 0); 4360path.lineTo(0.857143f, 0.666667f); 4361path is not equal to copy 4362~~~~ 4363 4364</fiddle-embed></div> 4365 4366### See Also 4367 4368<a href="#SkPath_dumpHex">dumpHex</a> <a href="#SkRect_dump">SkRect::dump()</a><sup><a href="#SkRect_dump_2">[2]</a></sup> <a href="#SkRRect_dump">SkRRect::dump()</a> <a href="#SkPathMeasure_dump">SkPathMeasure::dump()</a> <a href="#SkPath_writeToMemory">writeToMemory</a> 4369 4370--- 4371 4372<a name="SkPath_dumpHex"></a> 4373## dumpHex 4374 4375<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4376void dumpHex() const 4377</pre> 4378 4379Writes text representation of <a href="#Path">Path</a> to standard output. The representation may be 4380directly compiled as C++ code. Floating point values are written 4381in hexadecimal to preserve their exact bit pattern. The output reconstructs the 4382original <a href="#Path">Path</a>. 4383 4384Use instead of <a href="#SkPath_dump_2">dump</a> when submitting <a href="http://bug.skia.org">bug reports against Skia</a> . 4385 4386### Example 4387 4388<div><fiddle-embed name="72a92fe058e8b3be6c8a30fad7fd1266"> 4389 4390#### Example Output 4391 4392~~~~ 4393path.setFillType(SkPath::kWinding_FillType); 4394path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0 4395path.lineTo(SkBits2Float(0x3f5b6db7), SkBits2Float(0x3f2aaaab)); // 0.857143f, 0.666667f 4396path is equal to copy 4397~~~~ 4398 4399</fiddle-embed></div> 4400 4401### See Also 4402 4403<a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup> 4404 4405--- 4406 4407<a name="SkPath_writeToMemory"></a> 4408## writeToMemory 4409 4410<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4411size_t writeToMemory(void* buffer) const 4412</pre> 4413 4414Writes <a href="#Path">Path</a> to <a href="#SkPath_writeToMemory_buffer">buffer</a>, returning the number of bytes written. 4415Pass nullptr to obtain the storage size. 4416 4417Writes <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Conic Weight</a>, and 4418additionally writes computed information like <a href="#SkPath_Convexity">Convexity</a> and bounds. 4419 4420Use only be used in concert with <a href="#SkPath_readFromMemory">readFromMemory</a>; 4421the format used for <a href="#Path">Path</a> in memory is not guaranteed. 4422 4423### Parameters 4424 4425<table> <tr> <td><a name="SkPath_writeToMemory_buffer"> <code><strong>buffer </strong></code> </a></td> <td> 4426storage for <a href="#Path">Path</a>; may be nullptr</td> 4427 </tr> 4428</table> 4429 4430### Return Value 4431 4432size of storage required for <a href="#Path">Path</a>; always a multiple of 4 4433 4434### Example 4435 4436<div><fiddle-embed name="e5f16eda6a1c2d759556285f72598445"> 4437 4438#### Example Output 4439 4440~~~~ 4441path is equal to copy 4442~~~~ 4443 4444</fiddle-embed></div> 4445 4446### See Also 4447 4448<a href="#SkPath_serialize">serialize</a> <a href="#SkPath_readFromMemory">readFromMemory</a> <a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup> <a href="#SkPath_dumpHex">dumpHex</a> 4449 4450--- 4451 4452<a name="SkPath_serialize"></a> 4453## serialize 4454 4455<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4456sk_sp<SkData> serialize() const 4457</pre> 4458 4459Write <a href="#Path">Path</a> to buffer, returning the buffer written to, wrapped in <a href="undocumented#Data">Data</a>. 4460 4461<a href="#SkPath_serialize">serialize</a> writes <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Conic Weight</a>, and 4462additionally writes computed information like <a href="#SkPath_Convexity">Convexity</a> and bounds. 4463 4464<a href="#SkPath_serialize">serialize</a> should only be used in concert with <a href="#SkPath_readFromMemory">readFromMemory</a>. 4465The format used for <a href="#Path">Path</a> in memory is not guaranteed. 4466 4467### Return Value 4468 4469<a href="#Path">Path</a> data wrapped in <a href="undocumented#Data">Data</a> buffer 4470 4471### Example 4472 4473<div><fiddle-embed name="2c6aff73608cd198659db6d1eeaaae4f"> 4474 4475#### Example Output 4476 4477~~~~ 4478path is equal to copy 4479~~~~ 4480 4481</fiddle-embed></div> 4482 4483### See Also 4484 4485<a href="#SkPath_writeToMemory">writeToMemory</a> <a href="#SkPath_readFromMemory">readFromMemory</a> <a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup> <a href="#SkPath_dumpHex">dumpHex</a> 4486 4487--- 4488 4489<a name="SkPath_readFromMemory"></a> 4490## readFromMemory 4491 4492<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4493size_t readFromMemory(const void* buffer, size_t length) 4494</pre> 4495 4496Initializes <a href="#Path">Path</a> from <a href="#SkPath_readFromMemory_buffer">buffer</a> of size <a href="#SkPath_readFromMemory_length">length</a>. Returns zero if the <a href="#SkPath_readFromMemory_buffer">buffer</a> is 4497data is inconsistent, or the <a href="#SkPath_readFromMemory_length">length</a> is too small. 4498 4499Reads <a href="#Fill_Type">Fill Type</a>, <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Conic_Weight">Conic Weight</a>, and 4500additionally reads computed information like <a href="#SkPath_Convexity">Convexity</a> and bounds. 4501 4502Used only in concert with <a href="#SkPath_writeToMemory">writeToMemory</a>; 4503the format used for <a href="#Path">Path</a> in memory is not guaranteed. 4504 4505### Parameters 4506 4507<table> <tr> <td><a name="SkPath_readFromMemory_buffer"> <code><strong>buffer </strong></code> </a></td> <td> 4508storage for <a href="#Path">Path</a></td> 4509 </tr> <tr> <td><a name="SkPath_readFromMemory_length"> <code><strong>length </strong></code> </a></td> <td> 4510<a href="#SkPath_readFromMemory_buffer">buffer</a> size in bytes; must be multiple of 4</td> 4511 </tr> 4512</table> 4513 4514### Return Value 4515 4516number of bytes read, or zero on failure 4517 4518### Example 4519 4520<div><fiddle-embed name="9c6edd836c573a0fd232d2b8aa11a678"> 4521 4522#### Example Output 4523 4524~~~~ 4525length = 60; returned by readFromMemory = 0 4526length = 68; returned by readFromMemory = 64 4527~~~~ 4528 4529</fiddle-embed></div> 4530 4531### See Also 4532 4533<a href="#SkPath_writeToMemory">writeToMemory</a> 4534 4535--- 4536 4537# <a name="Generation_ID"></a> Generation ID 4538<a href="#Generation_ID">Generation ID</a> provides a quick way to check if <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, or 4539<a href="#Conic_Weight">Conic Weight</a> has changed. <a href="#Generation_ID">Generation ID</a> is not a hash; identical <a href="#Path">Paths</a> will 4540not necessarily have matching <a href="SkPath_Reference#Generation_ID">Generation IDs</a>. 4541 4542Empty <a href="#Path">Paths</a> have a <a href="#Generation_ID">Generation ID</a> of one. 4543 4544<a name="SkPath_getGenerationID"></a> 4545## getGenerationID 4546 4547<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4548uint32_t getGenerationID() const 4549</pre> 4550 4551Returns a non-zero, globally unique value. A different value is returned 4552if <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, or <a href="#Conic_Weight">Conic Weight</a> changes. 4553 4554Setting <a href="#Fill_Type">Fill Type</a> does not change <a href="#Generation_ID">Generation ID</a>. 4555 4556Each time the path is modified, a different <a href="#Generation_ID">Generation ID</a> will be returned. 4557 4558### Return Value 4559 4560non-zero, globally unique value 4561 4562### Example 4563 4564<div><fiddle-embed name="a0f166715d6479f91258d854e63e586d"> 4565 4566#### Example Output 4567 4568~~~~ 4569empty genID = 1 45701st lineTo genID = 2 4571empty genID = 1 45722nd lineTo genID = 3 4573~~~~ 4574 4575</fiddle-embed></div> 4576 4577### See Also 4578 4579<a href="#SkPath_equal_operator">operator==(const SkPath& a, const SkPath& b)</a> 4580 4581--- 4582 4583<a name="SkPath_isValid"></a> 4584## isValid 4585 4586<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4587bool isValid() const 4588</pre> 4589 4590Returns if <a href="#Path">Path</a> data is consistent. Corrupt <a href="#Path">Path</a> data is detected if 4591internal values are out of range or internal storage does not match 4592array dimensions. 4593 4594### Return Value 4595 4596true if <a href="#Path">Path</a> data is consistent 4597 4598--- 4599 4600<a name="SkPath_pathRefIsValid"></a> 4601## pathRefIsValid 4602 4603<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4604bool pathRefIsValid() const 4605</pre> 4606 4607Returns if <a href="#Path">Path</a> data is consistent. 4608 4609To be deprecated soon. 4610 4611### Return Value 4612 4613true if <a href="#Path">Path</a> data is consistent 4614 4615--- 4616 4617# <a name="SkPath::Iter"></a> Class SkPath::Iter 4618Iterates through <a href="#Verb_Array">Verb Array</a>, and associated <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Conic Weight</a>. 4619Provides options to treat open <a href="#Contour">Contours</a> as closed, and to ignore 4620degenerate data. 4621 4622<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4623class <a href="#SkPath_Iter_Iter">Iter</a> { 4624public: 4625<a href="#SkPath_Iter_Iter">Iter()</a>; 4626<a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a>; 4627void <a href="#SkPath_Iter_setPath">setPath(const SkPath& path, bool forceClose)</a>; 4628<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_Iter_next">next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)</a>; 4629<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_Iter_conicWeight">conicWeight</a> const; 4630bool <a href="#SkPath_Iter_isCloseLine">isCloseLine</a> const; 4631bool <a href="#SkPath_Iter_isClosedContour">isClosedContour</a> const; 4632};</pre> 4633 4634### Example 4635 4636<div><fiddle-embed name="3ca8417e2a1466bf5b3ac97780a8070c"><div>Ignoring the actual <a href="#Verb">Verbs</a> and replacing them with <a href="#Quad">Quads</a> rounds the 4637path of the glyph.</div></fiddle-embed></div> 4638 4639### See Also 4640 4641<a href="#SkPath_RawIter">RawIter</a> 4642 4643<a name="SkPath_Iter_Iter"></a> 4644## Iter 4645 4646<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4647Iter() 4648</pre> 4649 4650Initializes <a href="#SkPath_Iter_Iter">Iter</a> with an empty <a href="#Path">Path</a>. <a href="#SkPath_Iter_next">next</a> on <a href="#SkPath_Iter_Iter">Iter</a> returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. 4651Call <a href="#SkPath_Iter_setPath">setPath</a> to initialize <a href="#SkPath_Iter_Iter">Iter</a> at a later time. 4652 4653### Return Value 4654 4655<a href="#SkPath_Iter_Iter">Iter</a> of empty <a href="#Path">Path</a> 4656 4657### Example 4658 4659<div><fiddle-embed name="01648775cb9b354b2f1836dad82a25ab"> 4660 4661#### Example Output 4662 4663~~~~ 4664iter is done 4665iter is done 4666~~~~ 4667 4668</fiddle-embed></div> 4669 4670### See Also 4671 4672<a href="#SkPath_Iter_setPath">setPath</a> 4673 4674--- 4675 4676<a name="SkPath_Iter_Iter_2"></a> 4677 4678<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4679Iter(const SkPath& path, bool forceClose) 4680</pre> 4681 4682Sets <a href="#SkPath_Iter_Iter">Iter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_Iter_Iter_2_path">path</a>. 4683If <a href="#SkPath_Iter_Iter_2_forceClose">forceClose</a> is true, <a href="#SkPath_Iter_Iter">Iter</a> will add <a href="#SkPath_kLine_Verb">kLine Verb</a> and <a href="#SkPath_kClose_Verb">kClose Verb</a> after each 4684open <a href="#Contour">Contour</a>. <a href="#SkPath_Iter_Iter_2_path">path</a> is not altered. 4685 4686### Parameters 4687 4688<table> <tr> <td><a name="SkPath_Iter_Iter_2_path"> <code><strong>path </strong></code> </a></td> <td> 4689<a href="#Path">Path</a> to iterate</td> 4690 </tr> <tr> <td><a name="SkPath_Iter_Iter_2_forceClose"> <code><strong>forceClose </strong></code> </a></td> <td> 4691true if open <a href="#Contour">Contours</a> generate <a href="#SkPath_kClose_Verb">kClose Verb</a></td> 4692 </tr> 4693</table> 4694 4695### Return Value 4696 4697<a href="#SkPath_Iter_Iter">Iter</a> of <a href="#SkPath_Iter_Iter_2_path">path</a> 4698 4699### Example 4700 4701<div><fiddle-embed name="13044dbf68885c0f15322c0633b633a3"> 4702 4703#### Example Output 4704 4705~~~~ 4706open: 4707kMove_Verb {0, 0}, 4708kQuad_Verb {0, 0}, {10, 20}, {30, 40}, 4709kDone_Verb 4710closed: 4711kMove_Verb {0, 0}, 4712kQuad_Verb {0, 0}, {10, 20}, {30, 40}, 4713kLine_Verb {30, 40}, {0, 0}, 4714kClose_Verb {0, 0}, 4715kDone_Verb 4716~~~~ 4717 4718</fiddle-embed></div> 4719 4720### See Also 4721 4722<a href="#SkPath_Iter_setPath">setPath</a> 4723 4724--- 4725 4726<a name="SkPath_Iter_setPath"></a> 4727## setPath 4728 4729<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4730void setPath(const SkPath& path, bool forceClose) 4731</pre> 4732 4733Sets <a href="#SkPath_Iter_Iter">Iter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_Iter_setPath_path">path</a>. 4734If <a href="#SkPath_Iter_setPath_forceClose">forceClose</a> is true, <a href="#SkPath_Iter_Iter">Iter</a> will add <a href="#SkPath_kLine_Verb">kLine Verb</a> and <a href="#SkPath_kClose_Verb">kClose Verb</a> after each 4735open <a href="#Contour">Contour</a>. <a href="#SkPath_Iter_setPath_path">path</a> is not altered. 4736 4737### Parameters 4738 4739<table> <tr> <td><a name="SkPath_Iter_setPath_path"> <code><strong>path </strong></code> </a></td> <td> 4740<a href="#Path">Path</a> to iterate</td> 4741 </tr> <tr> <td><a name="SkPath_Iter_setPath_forceClose"> <code><strong>forceClose </strong></code> </a></td> <td> 4742true if open <a href="#Contour">Contours</a> generate <a href="#SkPath_kClose_Verb">kClose Verb</a></td> 4743 </tr> 4744</table> 4745 4746### Example 4747 4748<div><fiddle-embed name="6c9688008cea8937ad5cc188b38ecf16"> 4749 4750#### Example Output 4751 4752~~~~ 4753quad open: 4754kMove_Verb {0, 0}, 4755kQuad_Verb {0, 0}, {10, 20}, {30, 40}, 4756kDone_Verb 4757conic closed: 4758kMove_Verb {0, 0}, 4759kConic_Verb {0, 0}, {1, 2}, {3, 4}, weight = 0.5 4760kLine_Verb {3, 4}, {0, 0}, 4761kClose_Verb {0, 0}, 4762kDone_Verb 4763~~~~ 4764 4765</fiddle-embed></div> 4766 4767### See Also 4768 4769<a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a> 4770 4771--- 4772 4773<a name="SkPath_Iter_next"></a> 4774## next 4775 4776<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4777Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false) 4778</pre> 4779 4780Returns next <a href="#SkPath_Verb">Verb</a> in <a href="#Verb_Array">Verb Array</a>, and advances <a href="#SkPath_Iter_Iter">Iter</a>. 4781When <a href="#Verb_Array">Verb Array</a> is exhausted, returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. 4782 4783Zero to four <a href="#Point">Points</a> are stored in <a href="#SkPath_Iter_next_pts">pts</a>, depending on the returned <a href="#SkPath_Verb">Verb</a>. 4784 4785If <a href="#SkPath_Iter_next_doConsumeDegenerates">doConsumeDegenerates</a> is true, skip consecutive <a href="#SkPath_kMove_Verb">kMove Verb</a> entries, returning 4786only the last in the series; and skip very small <a href="#Line">Lines</a>, <a href="#Quad">Quads</a>, and <a href="#Conic">Conics</a>; and 4787skip <a href="#SkPath_kClose_Verb">kClose Verb</a> following <a href="#SkPath_kMove_Verb">kMove Verb</a>. 4788if <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="#Line">Lines</a>, <a href="#Quad">Quads</a>, and 4789<a href="#Conic">Conics</a> with zero lengths. 4790 4791### Parameters 4792 4793<table> <tr> <td><a name="SkPath_Iter_next_pts"> <code><strong>pts </strong></code> </a></td> <td> 4794storage for <a href="SkPoint_Reference#Point">Point</a> data describing returned <a href="#SkPath_Verb">Verb</a></td> 4795 </tr> <tr> <td><a name="SkPath_Iter_next_doConsumeDegenerates"> <code><strong>doConsumeDegenerates </strong></code> </a></td> <td> 4796if true, skip degenerate <a href="#Verb">Verbs</a></td> 4797 </tr> <tr> <td><a name="SkPath_Iter_next_exact"> <code><strong>exact </strong></code> </a></td> <td> 4798skip zero length curves</td> 4799 </tr> 4800</table> 4801 4802### Return Value 4803 4804next <a href="#SkPath_Verb">Verb</a> from <a href="#Verb_Array">Verb Array</a> 4805 4806### Example 4807 4808<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> 4809followed 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>. 4810 4811skip degenerate if <a href="#SkPath_Iter_next_exact">exact</a> skips the same as skip degenerate, but shows 4812the very small <a href="undocumented#Line">Line</a>. 4813 4814skip none shows all of the <a href="#Verb">Verbs</a> and <a href="#Point">Points</a> in <a href="#Path">Path</a>.</div> 4815 4816#### Example Output 4817 4818~~~~ 4819skip degenerate: 4820kMove_Verb {20, 20}, 4821kQuad_Verb {20, 20}, {10, 20}, {30, 40}, 4822kDone_Verb 4823skip degenerate if exact: 4824kMove_Verb {20, 20}, 4825kQuad_Verb {20, 20}, {10, 20}, {30, 40}, 4826kMove_Verb {30, 30}, 4827kLine_Verb {30, 30}, {30.00001, 30}, 4828kDone_Verb 4829skip none: 4830kMove_Verb {10, 10}, 4831kMove_Verb {20, 20}, 4832kQuad_Verb {20, 20}, {10, 20}, {30, 40}, 4833kMove_Verb {1, 1}, 4834kClose_Verb {1, 1}, 4835kMove_Verb {30, 30}, 4836kLine_Verb {30, 30}, {30, 30}, 4837kMove_Verb {30, 30}, 4838kLine_Verb {30, 30}, {30.00001, 30}, 4839kDone_Verb 4840~~~~ 4841 4842</fiddle-embed></div> 4843 4844### See Also 4845 4846<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_IsLineDegenerate">IsLineDegenerate</a> <a href="#SkPath_IsCubicDegenerate">IsCubicDegenerate</a> <a href="#SkPath_IsQuadDegenerate">IsQuadDegenerate</a> 4847 4848--- 4849 4850<a name="SkPath_Iter_conicWeight"></a> 4851## conicWeight 4852 4853<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4854SkScalar conicWeight() const 4855</pre> 4856 4857Returns <a href="#Conic_Weight">Conic Weight</a> if <a href="#SkPath_Iter_next">next</a> returned <a href="#SkPath_kConic_Verb">kConic Verb</a>. 4858 4859If <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>, 4860result is undefined. 4861 4862### Return Value 4863 4864<a href="#Conic_Weight">Conic Weight</a> for <a href="#Conic">Conic</a> <a href="#Point">Points</a> returned by <a href="#SkPath_Iter_next">next</a> 4865 4866### Example 4867 4868<div><fiddle-embed name="f97cc1191cf2eef161d6b97fcba67b02"> 4869 4870#### Example Output 4871 4872~~~~ 4873first verb is move 4874next verb is conic 4875conic points: {0,0}, {1,2}, {3,4} 4876conic weight: 0.5 4877~~~~ 4878 4879</fiddle-embed></div> 4880 4881### See Also 4882 4883<a href="#Conic_Weight">Conic Weight</a> 4884 4885--- 4886 4887<a name="SkPath_Iter_isCloseLine"></a> 4888## isCloseLine 4889 4890<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4891bool isCloseLine() const 4892</pre> 4893 4894Returns true if last <a href="#SkPath_kLine_Verb">kLine Verb</a> returned by <a href="#SkPath_Iter_next">next</a> was generated 4895by <a href="#SkPath_kClose_Verb">kClose Verb</a>. When true, the end point returned by <a href="#SkPath_Iter_next">next</a> is 4896also the start point of <a href="#Contour">Contour</a>. 4897 4898If <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>, 4899result is undefined. 4900 4901### Return Value 4902 4903true if last <a href="#SkPath_kLine_Verb">kLine Verb</a> was generated by <a href="#SkPath_kClose_Verb">kClose Verb</a> 4904 4905### Example 4906 4907<div><fiddle-embed name="345e0646a010f7dce571078d1321f4df"> 4908 4909#### Example Output 4910 4911~~~~ 49121st verb is move 4913moveTo point: {6,7} 49142nd verb is conic 49153rd verb is line 4916line points: {3,4}, {6,7} 4917line generated by close 49184th verb is close 4919~~~~ 4920 4921</fiddle-embed></div> 4922 4923### See Also 4924 4925<a href="#SkPath_close">close</a> 4926 4927--- 4928 4929<a name="SkPath_Iter_isClosedContour"></a> 4930## isClosedContour 4931 4932<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4933bool isClosedContour() const 4934</pre> 4935 4936Returns true if subsequent calls to <a href="#SkPath_Iter_next">next</a> return <a href="#SkPath_kClose_Verb">kClose Verb</a> before returning 4937<a href="#SkPath_kMove_Verb">kMove Verb</a>. if true, <a href="#Contour">Contour</a> <a href="#SkPath_Iter_Iter">Iter</a> is processing may end with <a href="#SkPath_kClose_Verb">kClose Verb</a>, or 4938<a href="#SkPath_Iter_Iter">Iter</a> may have been initialized with force close set to true. 4939 4940### Return Value 4941 4942true if <a href="#Contour">Contour</a> is closed 4943 4944### Example 4945 4946<div><fiddle-embed name="145ead5d4f5fb9ba0a0320cb6a5bf3e8"> 4947 4948#### Example Output 4949 4950~~~~ 4951without close(), forceClose is false: isClosedContour returns false 4952with close(), forceClose is false: isClosedContour returns true 4953without close(), forceClose is true : isClosedContour returns true 4954with close(), forceClose is true : isClosedContour returns true 4955~~~~ 4956 4957</fiddle-embed></div> 4958 4959### See Also 4960 4961<a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a> 4962 4963--- 4964 4965# <a name="SkPath::RawIter"></a> Class SkPath::RawIter 4966Iterates through <a href="#Verb_Array">Verb Array</a>, and associated <a href="#Point_Array">Point Array</a> and <a href="#Conic_Weight">Conic Weight</a>. 4967<a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> are returned unaltered. 4968 4969<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4970class <a href="#SkPath_RawIter_RawIter">RawIter</a> { 4971public: 4972<a href="#SkPath_RawIter_RawIter">RawIter()</a>; 4973<a href="#SkPath_RawIter_RawIter_2">RawIter(const SkPath& path)</a>; 4974void <a href="#SkPath_RawIter_setPath">setPath(const SkPath& path)</a>; 4975<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_next">next(SkPoint pts[4])</a>; 4976<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_peek">peek</a> const; 4977<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_RawIter_conicWeight">conicWeight</a> const; 4978}</pre> 4979 4980<a name="SkPath_RawIter_RawIter"></a> 4981## RawIter 4982 4983<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4984RawIter() 4985</pre> 4986 4987Initializes <a href="#SkPath_RawIter_RawIter">RawIter</a> with an empty <a href="#Path">Path</a>. <a href="#SkPath_RawIter_next">next</a> on <a href="#SkPath_RawIter_RawIter">RawIter</a> returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. 4988Call <a href="#SkPath_RawIter_setPath">setPath</a> to initialize <a href="#SkPath_Iter">Iter</a> at a later time. 4989 4990### Return Value 4991 4992<a href="#SkPath_RawIter_RawIter">RawIter</a> of empty <a href="#Path">Path</a> 4993 4994--- 4995 4996<a name="SkPath_RawIter_RawIter_2"></a> 4997 4998<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 4999RawIter(const SkPath& path) 5000</pre> 5001 5002Sets <a href="#SkPath_RawIter_RawIter">RawIter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_RawIter_RawIter_2_path">path</a>. 5003 5004### Parameters 5005 5006<table> <tr> <td><a name="SkPath_RawIter_RawIter_2_path"> <code><strong>path </strong></code> </a></td> <td> 5007<a href="#Path">Path</a> to iterate</td> 5008 </tr> 5009</table> 5010 5011### Return Value 5012 5013<a href="#SkPath_RawIter_RawIter">RawIter</a> of <a href="#SkPath_RawIter_RawIter_2_path">path</a> 5014 5015--- 5016 5017<a name="SkPath_RawIter_setPath"></a> 5018## setPath 5019 5020<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 5021void setPath(const SkPath& path) 5022</pre> 5023 5024Sets <a href="#SkPath_Iter">Iter</a> to return elements of <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> in <a href="#SkPath_RawIter_setPath_path">path</a>. 5025 5026### Parameters 5027 5028<table> <tr> <td><a name="SkPath_RawIter_setPath_path"> <code><strong>path </strong></code> </a></td> <td> 5029<a href="#Path">Path</a> to iterate</td> 5030 </tr> 5031</table> 5032 5033--- 5034 5035<a name="SkPath_RawIter_next"></a> 5036## next 5037 5038<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 5039Verb next(SkPoint pts[4]) 5040</pre> 5041 5042Returns next <a href="#SkPath_Verb">Verb</a> in <a href="#Verb_Array">Verb Array</a>, and advances <a href="#SkPath_RawIter_RawIter">RawIter</a>. 5043When <a href="#Verb_Array">Verb Array</a> is exhausted, returns <a href="#SkPath_kDone_Verb">kDone Verb</a>. 5044Zero to four <a href="#Point">Points</a> are stored in <a href="#SkPath_RawIter_next_pts">pts</a>, depending on the returned <a href="#SkPath_Verb">Verb</a>. 5045 5046### Parameters 5047 5048<table> <tr> <td><a name="SkPath_RawIter_next_pts"> <code><strong>pts </strong></code> </a></td> <td> 5049storage for <a href="SkPoint_Reference#Point">Point</a> data describing returned <a href="#SkPath_Verb">Verb</a></td> 5050 </tr> 5051</table> 5052 5053### Return Value 5054 5055next <a href="#SkPath_Verb">Verb</a> from <a href="#Verb_Array">Verb Array</a> 5056 5057### Example 5058 5059<div><fiddle-embed name="944a80c7ff8c04e1fecc4aec4a47ea60"> 5060 5061#### Example Output 5062 5063~~~~ 5064kMove_Verb {50, 60}, 5065kQuad_Verb {50, 60}, {10, 20}, {30, 40}, 5066kClose_Verb {50, 60}, 5067kMove_Verb {50, 60}, 5068kLine_Verb {50, 60}, {30, 30}, 5069kConic_Verb {30, 30}, {1, 2}, {3, 4}, weight = 0.5 5070kCubic_Verb {3, 4}, {-1, -2}, {-3, -4}, {-5, -6}, 5071kDone_Verb 5072~~~~ 5073 5074</fiddle-embed></div> 5075 5076### See Also 5077 5078<a href="#SkPath_RawIter_peek">peek</a> 5079 5080--- 5081 5082<a name="SkPath_RawIter_peek"></a> 5083## peek 5084 5085<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 5086Verb peek() const 5087</pre> 5088 5089Returns next <a href="#SkPath_Verb">Verb</a>, but does not advance <a href="#SkPath_RawIter_RawIter">RawIter</a>. 5090 5091### Return Value 5092 5093next <a href="#SkPath_Verb">Verb</a> from <a href="#Verb_Array">Verb Array</a> 5094 5095### Example 5096 5097<div><fiddle-embed name="eb5fa5bea23059ce538e883502f828f5"> 5098 5099#### Example Output 5100 5101~~~~ 5102#Volatile 5103peek Move == verb Move 5104peek Quad == verb Quad 5105peek Conic == verb Conic 5106peek Cubic == verb Cubic 5107peek Done == verb Done 5108peek Done == verb Done 5109~~~~ 5110 5111</fiddle-embed></div> 5112 5113### See Also 5114 5115<a href="#SkPath_RawIter_next">next</a> 5116 5117--- 5118 5119<a name="SkPath_RawIter_conicWeight"></a> 5120## conicWeight 5121 5122<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> 5123SkScalar conicWeight() const 5124</pre> 5125 5126Returns <a href="#Conic_Weight">Conic Weight</a> if <a href="#SkPath_RawIter_next">next</a> returned <a href="#SkPath_kConic_Verb">kConic Verb</a>. 5127 5128If <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>, 5129result is undefined. 5130 5131### Return Value 5132 5133<a href="#Conic_Weight">Conic Weight</a> for <a href="#Conic">Conic</a> <a href="#Point">Points</a> returned by <a href="#SkPath_RawIter_next">next</a> 5134 5135### Example 5136 5137<div><fiddle-embed name="9747e8177a50ea551471ba0b706f544b"> 5138 5139#### Example Output 5140 5141~~~~ 5142first verb is move 5143next verb is conic 5144conic points: {0,0}, {1,2}, {3,4} 5145conic weight: 0.5 5146~~~~ 5147 5148</fiddle-embed></div> 5149 5150### See Also 5151 5152<a href="#Conic_Weight">Conic Weight</a> 5153 5154--- 5155 5156