2017-07-28 19:18:29 +00:00
SkPath Reference
===
# <a name="Path"></a> Path
2018-02-01 14:37:32 +00:00
## <a name="Overview"></a> Overview
2018-02-15 22:31:24 +00:00
## <a name="Overview_Subtopic"></a> Overview Subtopic
2018-02-01 14:37:32 +00:00
| name | description |
| --- | --- |
2018-02-06 14:41:53 +00:00
| < a href = "#Class_or_Struct" > Class or Struct< / a > | embedded struct and class members |
| < a href = "#Constant" > Constant< / a > | enum and enum class, const values |
2018-02-15 22:31:24 +00:00
| < a href = "#Constructor" > Constructor< / a > | functions that construct < a href = "#SkPath" > SkPath< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#Member_Function" > Member Function< / a > | static functions and member methods |
| < a href = "#Operator" > Operator< / a > | operator overloading methods |
| < a href = "#Related_Function" > Related Function< / a > | similar methods grouped together |
2018-02-15 22:31:24 +00:00
< a href = "#Path" > Path< / a > contains < a href = "undocumented#Line" > Lines< / a > and < a href = "undocumented#Curve" > Curves< / a > which can be stroked or filled. < a href = "#Contour" > Contour< / a > is
composed of a series of connected < a href = "undocumented#Line" > Lines< / a > and < a href = "undocumented#Curve" > Curves< / a > . < a href = "#Path" > Path< / a > may contain zero,
2017-08-25 15:51:49 +00:00
one, or more < a href = "#Contour" > Contours< / a > .
2018-02-15 22:31:24 +00:00
Each < a href = "undocumented#Line" > Line< / a > and < a href = "undocumented#Curve" > Curve< / a > are described by < a href = "#Verb" > Verb< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and optional < a href = "#Conic_Weight" > Conic Weight< / a > .
2017-08-25 15:51:49 +00:00
2018-02-15 22:31:24 +00:00
Each pair of connected < a href = "undocumented#Line" > Lines< / a > and < a href = "undocumented#Curve" > Curves< / a > share common < a href = "SkPoint_Reference#Point" > Point< / a > ; for instance, < a href = "#Path" > Path< / a >
containing two connected < a href = "undocumented#Line" > Lines< / a > are described the < a href = "#Verb" > Verb< / a > sequence:
2017-11-27 15:44:06 +00:00
< 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
2017-07-28 19:18:29 +00:00
with three entries, sharing
2017-08-04 16:48:24 +00:00
the 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 > .
2017-07-28 19:18:29 +00:00
2017-10-04 18:31:33 +00:00
< 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
2018-02-15 22:31:24 +00:00
< a href = "undocumented#Line" > Lines< / a > and < a href = "undocumented#Curve" > Curves< / a > with as many < a href = "#Verb" > Verbs< / a > and < a href = "SkPoint_Reference#Point" > Points< / a > required
2017-08-25 15:51:49 +00:00
for an exact description. Once added to < a href = "#Path" > Path< / a > , these components may lose their
2017-09-01 19:51:02 +00:00
identity; although < a href = "#Path" > Path< / a > can be inspected to determine if it describes a single
2017-10-04 18:31:33 +00:00
< a href = "SkRect_Reference#Rect" > Rect< / a > , < a href = "undocumented#Oval" > Oval< / a > , < a href = "undocumented#Round_Rect" > Round Rect< / a > , and so on.
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< 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
not 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 >
2018-03-05 18:26:16 +00:00
is stroked and filled, but since it is not closed, < a href = "#Quad" > Quad< / a > does not stroke a loop.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#Path" > Path< / a > contains a < a href = "#Fill_Type" > Fill Type< / a > which determines whether overlapping < a href = "#Contour" > Contours< / a >
form fills or holes. < a href = "#Fill_Type" > Fill Type< / a > also determines whether area inside or outside
2018-02-15 22:31:24 +00:00
< a href = "undocumented#Line" > Lines< / a > and < a href = "undocumented#Curve" > Curves< / a > is filled.
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< div > < fiddle-embed name = "36a995442c081ee779ecab2962d36e69" > < div > < a href = "#Path" > Path< / a > is drawn filled, then stroked, then stroked and filled.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#Path" > Path< / a > contents are never shared. Copying < a href = "#Path" > Path< / a > by value effectively creates
a new < a href = "#Path" > Path< / a > independent of the original. Internally, the copy does not duplicate
2017-07-28 19:18:29 +00:00
its contents until it is edited, to reduce memory use and improve performance.
## <a name="Contour"></a> Contour
2018-02-15 22:31:24 +00:00
< a href = "#Contour" > Contour< / a > contains one or more < a href = "#Verb" > Verbs< / a > , and as many < a href = "SkPoint_Reference#Point" > Points< / a > as
2017-08-25 15:51:49 +00:00
are required to satisfy < a href = "#Verb_Array" > Verb Array< / a > . First < a href = "#Verb" > Verb< / a > in < a href = "#Path" > Path< / a > is always
< 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 > .
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< 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 >
2018-01-04 21:11:51 +00:00
also starts a new < a href = "#Contour" > Contour< / a > . Since < a href = "#SkPath_conicTo" > SkPath::conicTo< / a > is not preceded by
2017-11-27 15:44:06 +00:00
< 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 >
2018-03-05 18:26:16 +00:00
of the second < a href = "#Contour" > Contour< / a > .
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
If 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
2018-01-04 21:11:51 +00:00
< a href = "#Contour" > Contour< / a > with first < a href = "SkPoint_Reference#Point" > Point< / a > . A closed < a href = "#Contour" > Contour< / a > , stroked, draws
2018-02-15 22:31:24 +00:00
< a href = "SkPaint_Reference#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 >
2017-11-27 15:44:06 +00:00
as 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 >
2018-02-15 22:31:24 +00:00
remains open. An open < a href = "#Contour" > Contour< / a > , stroked, draws < a href = "SkPaint_Reference#Stroke_Cap" > Paint Stroke Cap< / a > at
2017-11-27 15:44:06 +00:00
< a href = "#Last_Point" > Last Point< / a > and first < a href = "SkPoint_Reference#Point" > Point< / a > .
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
## <a name="Contour_Zero_Length"></a> Contour Zero Length
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< 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 > ,
plus, 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 > .
2018-02-15 22:31:24 +00:00
Even if < a href = "#Contour" > Contour< / a > length is zero, stroked < a href = "undocumented#Line" > Lines< / a > are drawn if < a href = "SkPaint_Reference#Stroke_Cap" > Paint Stroke Cap< / a >
2017-07-28 19:18:29 +00:00
makes them visible.
### Example
< div > < fiddle-embed name = "62848df605af6258653d9e16b27d8f7f" > < / fiddle-embed > < / div >
# <a name="SkPath"></a> Class SkPath
2017-08-29 21:36:51 +00:00
< 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
2018-01-04 21:11:51 +00:00
outline a figure. < a href = "#Path" > Path< / a > always starts with a move verb to a Cartesian_Coordinate,
2017-11-27 15:44:06 +00:00
and may be followed by additional verbs that add lines or curves.
2018-01-26 17:56:22 +00:00
Adding a close verb makes the geometry into a continuous loop, a closed contour.
2017-09-01 19:51:02 +00:00
< a href = "#Path" > Paths< / a > may contain any number of contours, each beginning with a move verb.
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > contours may contain only a move verb, or may also contain lines,
2017-09-01 19:51:02 +00:00
< 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
2017-08-29 21:36:51 +00:00
closed.
When used to draw a filled area, < a href = "#Path" > Path< / a > describes whether the fill is inside or
outside the geometry. < a href = "#Path" > Path< / a > also describes the winding rule used to fill
overlapping contours.
Internally, < a href = "#Path" > Path< / a > lazily computes metrics likes bounds and convexity. Call
2018-01-04 21:11:51 +00:00
< a href = "#SkPath_updateBoundsCache" > SkPath::updateBoundsCache< / a > to make < a href = "#Path" > Path< / a > thread safe.
2017-07-28 19:18:29 +00:00
2018-02-06 14:41:53 +00:00
## <a name="Related_Function"></a> Related Function
2018-01-22 12:55:48 +00:00
| name | description |
2018-02-01 14:37:32 +00:00
| --- | --- |
| < a href = "#Arc" > Arc< / a > | part of < a href = "undocumented#Oval" > Oval< / a > or < a href = "undocumented#Circle" > Circle< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#Build" > Build< / a > | adds points and verbs to path |
2018-01-22 12:55:48 +00:00
| < a href = "#Conic" > Conic< / a > | conic section defined by three points and a weight |
2018-02-15 22:31:24 +00:00
| < a href = "#Conic_Weight" > Conic Weight< / a > | strength of < a href = "#Conic" > Conic< / a > control < a href = "SkPoint_Reference#Point" > Point< / a > |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_Convexity" > Convexity< / a > | if < a href = "#Path" > Path< / a > is concave or convex |
2018-02-01 14:37:32 +00:00
| < a href = "#Cubic" > Cubic< / a > | Bezier_Curve described by third-order polynomial |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_Direction" > Direction< / a > | < a href = "#Path" > Path< / a > contour orientation |
| < a href = "#Fill_Type" > Fill Type< / a > | < a href = "#Path" > Path< / a > fill rule, normal and inverted |
2018-02-01 14:37:32 +00:00
| < a href = "#Generation_ID" > Generation ID< / a > | value reflecting contents change |
2018-02-06 14:41:53 +00:00
| < a href = "#Interpolate" > Interpolate< / a > | weighted average of < a href = "#Path" > Path< / a > pair |
2018-01-22 12:55:48 +00:00
| < a href = "#Last_Point" > Last Point< / a > | final < a href = "SkPoint_Reference#Point" > Point< / a > in < a href = "#Contour" > Contour< / a > |
| < a href = "#Point_Array" > Point Array< / a > | end points and control points for lines and curves |
2018-02-07 12:27:09 +00:00
| < a href = "#Property" > Property< / a > | metrics and attributes |
2018-02-01 14:37:32 +00:00
| < a href = "#Quad" > Quad< / a > | Bezier_Curve described by second-order polynomial |
2018-02-07 12:27:09 +00:00
| < a href = "#Transform" > Transform< / a > | modify all points |
| < a href = "#Utility" > Utility< / a > | rarely called management functions |
2018-02-01 14:37:32 +00:00
| < a href = "#SkPath_Verb" > Verb< / a > | line and curve type |
2018-01-22 12:55:48 +00:00
| < a href = "#Verb_Array" > Verb Array< / a > | line and curve type for points |
2018-02-06 14:41:53 +00:00
| < a href = "#Volatile" > Volatile< / a > | caching attribute |
2018-01-22 12:55:48 +00:00
2018-02-06 14:41:53 +00:00
## <a name="Constant"></a> Constant
2017-07-28 19:18:29 +00:00
2018-01-22 12:55:48 +00:00
| name | description |
2018-02-01 14:37:32 +00:00
| --- | --- |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_AddPathMode" > AddPathMode< / a > | sets < a href = "#SkPath_addPath" > addPath< / a > options |
| < a href = "#SkPath_ArcSize" > ArcSize< / a > | used by < a href = "#SkPath_arcTo" > arcTo< / a > variation |
| < a href = "#SkPath_Convexity" > Convexity< / a > | returns if < a href = "#Path" > Path< / a > is convex or concave |
| < a href = "#SkPath_Direction" > Direction< / a > | sets < a href = "#Contour" > Contour< / a > clockwise or counterclockwise |
| < a href = "#SkPath_FillType" > FillType< / a > | sets winding rule and inverse fill |
| < a href = "#SkPath_SegmentMask" > SegmentMask< / a > | returns < a href = "#SkPath_Verb" > Verb< / a > types in < a href = "#Path" > Path< / a > |
2018-02-15 22:31:24 +00:00
| < a href = "#SkPath_Verb" > Verb< / a > | controls how < a href = "#Path" > Path< / a > < a href = "SkPoint_Reference#Point" > Points< / a > are interpreted |
2017-07-28 19:18:29 +00:00
2018-02-06 14:41:53 +00:00
## <a name="Class_or_Struct"></a> Class or Struct
2017-07-28 19:18:29 +00:00
2018-01-22 12:55:48 +00:00
| name | description |
2018-02-01 14:37:32 +00:00
| --- | --- |
| < a href = "#SkPath_Iter" > Iter< / a > | < a href = "#Path" > Path< / a > data iterator |
| < a href = "#SkPath_RawIter" > RawIter< / a > | < a href = "#Path" > Path< / a > raw data iterator |
2017-07-28 19:18:29 +00:00
2018-02-06 14:41:53 +00:00
## <a name="Constructor"></a> Constructor
2017-07-28 19:18:29 +00:00
2018-01-22 12:55:48 +00:00
| name | description |
2018-02-01 14:37:32 +00:00
| --- | --- |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_empty_constructor" > SkPath()< / a > | constructs with default values |
| < a href = "#SkPath_copy_const_SkPath" > SkPath(const SkPath& path)< / a > | makes a shallow copy |
2018-02-15 22:31:24 +00:00
| < a href = "#SkPath_reset" > reset< / a > | removes < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Weights< / a > ; frees memory |
| < a href = "#SkPath_rewind" > rewind< / a > | removes < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Weights< / a > , keeping memory |
2018-02-01 14:37:32 +00:00
| < a href = "#SkPath_destructor" > ~SkPath()< / a > | decreases < a href = "undocumented#Reference_Count" > Reference Count< / a > of owned objects |
2017-07-28 19:18:29 +00:00
2018-02-06 14:41:53 +00:00
## <a name="Operator"></a> Operator
2017-07-28 19:18:29 +00:00
2018-01-22 12:55:48 +00:00
| name | description |
2018-02-01 14:37:32 +00:00
| --- | --- |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_notequal_operator" > operator!=(const SkPath& a, const SkPath& b)< / a > | compares paths for inequality |
| < a href = "#SkPath_copy_operator" > operator=(const SkPath& path)< / a > | makes a shallow copy |
| < a href = "#SkPath_equal_operator" > operator==(const SkPath& a, const SkPath& b)< / a > | compares paths for equality |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_swap" > swap< / a > | exchanges < a href = "#Path" > Path< / a > pair |
2017-07-28 19:18:29 +00:00
2018-02-06 14:41:53 +00:00
## <a name="Member_Function"></a> Member Function
2017-07-28 19:18:29 +00:00
2018-01-22 12:55:48 +00:00
| name | description |
2018-02-01 14:37:32 +00:00
| --- | --- |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_ConvertConicToQuads" > ConvertConicToQuads< / a > | approximates < a href = "#Conic" > Conic< / a > with < a href = "#Quad" > Quad< / a > array |
| < a href = "#SkPath_ConvertToNonInverseFillType" > ConvertToNonInverseFillType< / a > | returns < a href = "#Fill_Type" > Fill Type< / a > representing inside geometry |
| < a href = "#SkPath_IsCubicDegenerate" > IsCubicDegenerate< / a > | returns if < a href = "#Cubic" > Cubic< / a > is very small |
| < a href = "#SkPath_IsInverseFillType" > IsInverseFillType< / a > | returns if < a href = "#Fill_Type" > Fill Type< / a > represents outside geometry |
| < a href = "#SkPath_IsLineDegenerate" > IsLineDegenerate< / a > | returns if < a href = "undocumented#Line" > Line< / a > is very small |
| < a href = "#SkPath_IsQuadDegenerate" > IsQuadDegenerate< / a > | returns if < a href = "#Quad" > Quad< / a > is very small |
| < a href = "#SkPath_addArc" > addArc< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "#Arc" > Arc< / a > |
| < a href = "#SkPath_addCircle" > addCircle< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "undocumented#Circle" > Circle< / a > |
| < a href = "#SkPath_addOval" > addOval< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "undocumented#Oval" > Oval< / a > |
| < a href = "#SkPath_addPath" > addPath< / a > | adds contents of < a href = "#Path" > Path< / a > |
| < a href = "#SkPath_addPoly" > addPoly< / a > | adds one < a href = "#Contour" > Contour< / a > containing connected lines |
| < a href = "#SkPath_addRRect" > addRRect< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "undocumented#Round_Rect" > Round Rect< / a > |
| < a href = "#SkPath_addRect" > addRect< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "SkRect_Reference#Rect" > Rect< / a > |
| < 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 |
| < a href = "#SkPath_arcTo" > arcTo< / a > | appends < a href = "#Arc" > Arc< / a > |
| < a href = "#SkPath_close" > close< / a > | makes last < a href = "#Contour" > Contour< / a > a loop |
| < a href = "#SkPath_computeTightBounds" > computeTightBounds< / a > | returns extent of geometry |
| < a href = "#SkPath_conicTo" > conicTo< / a > | appends < a href = "#Conic" > Conic< / a > |
| < a href = "#SkPath_conservativelyContainsRect" > conservativelyContainsRect< / a > | returns true if < a href = "SkRect_Reference#Rect" > Rect< / a > may be inside |
| < a href = "#SkPath_contains" > contains< / a > | returns if < a href = "SkPoint_Reference#Point" > Point< / a > is in fill area |
| < a href = "#SkPath_countPoints" > countPoints< / a > | returns < a href = "#Point_Array" > Point Array< / a > length |
| < a href = "#SkPath_countVerbs" > countVerbs< / a > | returns < a href = "#Verb_Array" > Verb Array< / a > length |
| < a href = "#SkPath_cubicTo" > cubicTo< / a > | appends < a href = "#Cubic" > Cubic< / a > |
| < a href = "#SkPath_dump_2" > dump< / a > | sends text representation using floats to standard output |
| < a href = "#SkPath_dumpHex" > dumpHex< / a > | sends text representation using hexadecimal to standard output |
| < a href = "#SkPath_getBounds" > getBounds< / a > | returns maximum and minimum of < a href = "#Point_Array" > Point Array< / a > |
| < a href = "#SkPath_getConvexity" > getConvexity< / a > | returns geometry convexity, computing if necessary |
| < a href = "#SkPath_getConvexityOrUnknown" > getConvexityOrUnknown< / a > | returns geometry convexity if known |
| < a href = "#SkPath_getFillType" > getFillType< / a > | returns < a href = "#Fill_Type" > Fill Type< / a > : winding, even-odd, inverse |
2018-01-26 17:56:22 +00:00
| < a href = "#SkPath_getGenerationID" > getGenerationID< / a > | returns unique ID |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_getLastPt" > getLastPt< / a > | returns < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_getPoint" > getPoint< / a > | returns entry from < a href = "#Point_Array" > Point Array< / a > |
| < a href = "#SkPath_getPoints" > getPoints< / a > | returns < a href = "#Point_Array" > Point Array< / a > |
| < a href = "#SkPath_getSegmentMasks" > getSegmentMasks< / a > | returns types in < a href = "#Verb_Array" > Verb Array< / a > |
| < a href = "#SkPath_getVerbs" > getVerbs< / a > | returns < a href = "#Verb_Array" > Verb Array< / a > |
| < a href = "#SkPath_incReserve" > incReserve< / a > | reserves space for additional data |
| < a href = "#SkPath_interpolate" > interpolate< / a > | interpolates between < a href = "#Path" > Path< / a > pair |
| < a href = "#SkPath_isConvex" > isConvex< / a > | returns if geometry is convex |
| < a href = "#SkPath_isEmpty" > isEmpty< / a > | returns if verb count is zero |
| < a href = "#SkPath_isFinite" > isFinite< / a > | returns if all < a href = "SkPoint_Reference#Point" > Point< / a > values are finite |
2018-02-15 22:31:24 +00:00
| < a href = "#SkPath_isInterpolatable" > isInterpolatable< / a > | returns if pair contains equal counts of < a href = "#Verb_Array" > Verb Array< / a > and < a href = "#Conic_Weight" > Weights< / a > |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_isInverseFillType" > isInverseFillType< / a > | returns if < a href = "#Fill_Type" > Fill Type< / a > fills outside geometry |
| < a href = "#SkPath_isLastContourClosed" > isLastContourClosed< / a > | returns if final < a href = "#Contour" > Contour< / a > forms a loop |
| < a href = "#SkPath_isLine" > isLine< / a > | returns if describes < a href = "undocumented#Line" > Line< / a > |
| < a href = "#SkPath_isNestedFillRects" > isNestedFillRects< / a > | returns if describes < a href = "SkRect_Reference#Rect" > Rect< / a > pair, one inside the other |
| < a href = "#SkPath_isOval" > isOval< / a > | returns if describes < a href = "undocumented#Oval" > Oval< / a > |
| < a href = "#SkPath_isRRect" > isRRect< / a > | returns if describes < a href = "undocumented#Round_Rect" > Round Rect< / a > |
| < a href = "#SkPath_isRect" > isRect< / a > | returns if describes < a href = "SkRect_Reference#Rect" > Rect< / a > |
| < a href = "#SkPath_isValid" > isValid< / a > | returns if data is internally consistent |
| < a href = "#SkPath_isVolatile" > isVolatile< / a > | returns if < a href = "undocumented#Device" > Device< / a > should not cache |
| < a href = "#SkPath_lineTo" > lineTo< / a > | appends < a href = "undocumented#Line" > Line< / a > |
| < a href = "#SkPath_moveTo" > moveTo< / a > | starts < a href = "#Contour" > Contour< / a > |
| < a href = "#SkPath_offset" > offset< / a > | translates < a href = "#Point_Array" > Point Array< / a > |
| < a href = "#SkPath_quadTo" > quadTo< / a > | appends < a href = "#Quad" > Quad< / a > |
| < a href = "#SkPath_rArcTo" > rArcTo< / a > | appends < a href = "#Arc" > Arc< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rConicTo" > rConicTo< / a > | appends < a href = "#Conic" > Conic< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rCubicTo" > rCubicTo< / a > | appends < a href = "#Cubic" > Cubic< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rLineTo" > rLineTo< / a > | appends < a href = "undocumented#Line" > Line< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rMoveTo" > rMoveTo< / a > | starts < a href = "#Contour" > Contour< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rQuadTo" > rQuadTo< / a > | appends < a href = "#Quad" > Quad< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_readFromMemory" > readFromMemory< / a > | Initializes from buffer |
2018-02-15 22:31:24 +00:00
| < a href = "#SkPath_reset" > reset< / a > | removes < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Weights< / a > ; frees memory |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_reverseAddPath" > reverseAddPath< / a > | adds contents of < a href = "#Path" > Path< / a > back to front |
2018-02-15 22:31:24 +00:00
| < a href = "#SkPath_rewind" > rewind< / a > | removes < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Weights< / a > , keeping memory |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_serialize" > serialize< / a > | copies data to buffer |
| < a href = "#SkPath_setConvexity" > setConvexity< / a > | sets if geometry is convex to avoid future computation |
| < a href = "#SkPath_setFillType" > setFillType< / a > | sets < a href = "#Fill_Type" > Fill Type< / a > : winding, even-odd, inverse |
| < a href = "#SkPath_setIsVolatile" > setIsVolatile< / a > | sets if < a href = "undocumented#Device" > Device< / a > should not cache |
| < a href = "#SkPath_setLastPt" > setLastPt< / a > | replaces < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_swap" > swap< / a > | exchanges < a href = "#Path" > Path< / a > pair |
| < a href = "#SkPath_toggleInverseFillType" > toggleInverseFillType< / a > | toggles < a href = "#Fill_Type" > Fill Type< / a > between inside and outside geometry |
2018-02-15 22:31:24 +00:00
| < 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 = "#Conic_Weight" > Weights< / a > |
2018-01-22 12:55:48 +00:00
| < a href = "#SkPath_updateBoundsCache" > updateBoundsCache< / a > | refreshes result of < a href = "#SkPath_getBounds" > getBounds< / a > |
| < a href = "#SkPath_writeToMemory" > writeToMemory< / a > | copies data to buffer |
2017-07-28 19:18:29 +00:00
## <a name="Verb"></a> Verb
2017-08-25 15:51:49 +00:00
## <a name="SkPath_Verb"></a> Enum SkPath::Verb
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-25 15:51:49 +00:00
enum < a href = "#Verb" > Verb< / a > {
2018-01-04 21:11:51 +00:00
< 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 > ,
< a href = "#SkPath_kCubic_Verb" > kCubic Verb< / a > ,
< a href = "#SkPath_kClose_Verb" > kClose Verb< / a > ,
< a href = "#SkPath_kDone_Verb" > kDone Verb< / a > ,
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< 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 > ;
2017-08-25 15:51:49 +00:00
manage < a href = "#Contour" > Contour< / a > , and terminate < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
### Constants
< table >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2017-11-27 15:44:06 +00:00
< 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 > .
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-01-04 21:11:51 +00:00
< 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 > .
2017-11-27 15:44:06 +00:00
< 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 > ,
2018-03-05 18:26:16 +00:00
and control < a href = "SkPoint_Reference#Point" > Point< / a > to end < a href = "SkPoint_Reference#Point" > Point< / a > .
< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2017-11-27 15:44:06 +00:00
< 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 > .
2018-01-04 21:11:51 +00:00
< a href = "#Conic" > Conic< / a > is a elliptical, parabolic, or hyperbolic section within tangents
2017-11-27 15:44:06 +00:00
from < 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
2017-08-29 21:36:51 +00:00
by < a href = "#Conic_Weight" > Conic Weight< / a > . < a href = "#Conic_Weight" > Conic Weight< / a > less than one is elliptical; equal to one is
2018-03-05 18:26:16 +00:00
parabolic (and identical to < a href = "#Quad" > Quad< / a > ); greater than one hyperbolic.
< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-02-15 22:31:24 +00:00
< 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 = "SkPoint_Reference#Point" > Points< / a > , and end < a href = "SkPoint_Reference#Point" > Point< / a > .
2018-01-04 21:11:51 +00:00
< a href = "#Cubic" > Cubic< / a > is a third-order Bezier_Curve section within tangents from < a href = "#Last_Point" > Last Point< / a >
2018-03-05 18:26:16 +00:00
to first control < a href = "SkPoint_Reference#Point" > Point< / a > , and from second control < a href = "SkPoint_Reference#Point" > Point< / a > to end < a href = "SkPoint_Reference#Point" > Point< / a > .
< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
2018-02-15 22:31:24 +00:00
Each < a href = "#Verb" > Verb< / a > has zero or more < a href = "SkPoint_Reference#Point" > Points< / a > stored in < a href = "#Path" > Path< / a > .
< a href = "#Path" > Path< / a > iterator returns complete curve descriptions, duplicating shared < a href = "SkPoint_Reference#Point" > Points< / a >
2017-07-28 19:18:29 +00:00
for consecutive entries.
< / table >
2018-02-15 22:31:24 +00:00
| < a href = "#Verb" > Verb< / a > | Allocated < a href = "SkPoint_Reference#Point" > Points< / a > | Iterated < a href = "SkPoint_Reference#Point" > Points< / a > | < a href = "#Conic_Weight" > Weights< / a > |
2017-07-28 19:18:29 +00:00
| --- | --- | --- | --- |
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > | 1 | 1 | 0 |
| < a href = "#SkPath_kLine_Verb" > kLine Verb< / a > | 1 | 2 | 0 |
| < a href = "#SkPath_kQuad_Verb" > kQuad Verb< / a > | 2 | 3 | 0 |
| < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > | 2 | 3 | 1 |
| < a href = "#SkPath_kCubic_Verb" > kCubic Verb< / a > | 3 | 4 | 0 |
| < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > | 0 | 1 | 0 |
| < a href = "#SkPath_kDone_Verb" > kDone Verb< / a > | -- | 0 | 0 |
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "799096fdc1298aa815934a74e76570ca" >
#### Example Output
~~~~
verb count: 7
verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConic_Verb
~~~~
< / fiddle-embed > < / div >
## <a name="Direction"></a> Direction
2017-08-25 15:51:49 +00:00
## <a name="SkPath_Direction"></a> Enum SkPath::Direction
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-25 15:51:49 +00:00
enum < a href = "#Direction" > Direction< / a > {
2018-01-04 21:11:51 +00:00
< a href = "#SkPath_kCW_Direction" > kCW Direction< / a > ,
< a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > ,
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#Direction" > Direction< / a > describes whether < a href = "#Contour" > Contour< / a > is clockwise or counterclockwise.
2018-01-26 17:56:22 +00:00
When < a href = "#Path" > Path< / a > contains multiple overlapping < a href = "#Contour" > Contours< / a > , < a href = "#Direction" > Direction< / a > together with
2017-08-25 15:51:49 +00:00
< a href = "#Fill_Type" > Fill Type< / a > determines whether overlaps are filled or form holes.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#Direction" > Direction< / a > also determines how < a href = "#Contour" > Contour< / a > is measured. For instance, dashing
measures along < a href = "#Path" > Path< / a > to determine where to start and stop stroke; < a href = "#Direction" > Direction< / a >
2017-07-28 19:18:29 +00:00
will change dashed results as it steps clockwise or counterclockwise.
2018-01-04 21:11:51 +00:00
Closed < 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
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_kCW_Direction" > kCW Direction< / a > travel clockwise; the same added with < a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a >
2017-07-28 19:18:29 +00:00
travel counterclockwise.
### Constants
< table >
< tr >
2017-10-26 11:58:48 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2017-10-26 11:58:48 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "0de03d9c939b6238318b7366866e8722" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_empty_constructor" > < / a >
2017-07-28 19:18:29 +00:00
## SkPath
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
SkPath()
< / pre >
2018-02-15 22:31:24 +00:00
By default, < a href = "#Path" > Path< / a > has no < a href = "#Verb" > Verbs< / a > , no < a href = "SkPoint_Reference#Point" > Points< / a > , and no < a href = "#Conic_Weight" > Weights< / a > .
2017-08-25 15:51:49 +00:00
< a href = "#Fill_Type" > Fill Type< / a > is set to < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > .
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
empty < a href = "#Path" > Path< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "0a0026fca638d1cd75c0ab884e3ee1c6" >
#### Example Output
~~~~
path is empty
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_reset" > reset< / a > < a href = "#SkPath_rewind" > rewind< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_copy_const_SkPath" > < / a >
2017-07-28 19:18:29 +00:00
## SkPath
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
SkPath(const SkPath& path)
< / pre >
2017-08-29 21:36:51 +00:00
Copy constructor makes two paths identical by value. Internally, < a href = "#SkPath_copy_const_SkPath_path" > path< / a > and
2017-08-25 15:51:49 +00:00
the returned result share pointer values. The underlying < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a >
2018-02-15 22:31:24 +00:00
and < a href = "#Conic_Weight" > Weights< / a > are copied when modified.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
Creating a < a href = "#Path" > Path< / a > copy is very efficient and never allocates memory.
< a href = "#Path" > Paths< / a > are always copied by value from the interface; the underlying shared
2017-07-28 19:18:29 +00:00
pointers are not exposed.
### Parameters
2017-08-29 21:36:51 +00:00
< table > < tr > < td > < a name = "SkPath_copy_const_SkPath_path" > < code > < strong > path < / strong > < / code > < / a > < / td > < td >
< a href = "#Path" > Path< / a > to copy by value< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-30 12:58:10 +00:00
copy of < a href = "#Path" > Path< / a >
2017-07-28 19:18:29 +00:00
### Example
2017-08-29 21:36:51 +00:00
< 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
2018-03-05 18:26:16 +00:00
of each other.
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
path verbs: 2
path2 verbs: 3
after reset
path verbs: 0
path2 verbs: 3
~~~~
< / fiddle-embed > < / div >
### See Also
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_copy_operator" > operator=(const SkPath& path)< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_destructor" > < / a >
2017-07-28 19:18:29 +00:00
## ~SkPath
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
~SkPath()
< / pre >
2017-08-25 15:51:49 +00:00
Releases ownership of any shared data and deletes data if < a href = "#Path" > Path< / a > is sole owner.
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
### See Also
2017-11-27 15:44:06 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-11-27 15:44:06 +00:00
< a name = "SkPath_copy_operator" > < / a >
2017-07-28 19:18:29 +00:00
## operator=
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
SkPath& operator=(const SkPath& path)
< / pre >
2017-08-25 15:51:49 +00:00
< a href = "#Path" > Path< / a > assignment makes two paths identical by value. Internally, assignment
2018-02-15 22:31:24 +00:00
shares pointer values. The underlying < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > and < a href = "#Conic_Weight" > Weights< / a >
2017-07-28 19:18:29 +00:00
are copied when modified.
2017-08-25 15:51:49 +00:00
Copying < a href = "#Path" > Paths< / a > by assignment is very efficient and never allocates memory.
< a href = "#Path" > Paths< / a > are always copied by value from the interface; the underlying shared
2017-07-28 19:18:29 +00:00
pointers are not exposed.
### Parameters
2017-11-27 15:44:06 +00:00
< table > < tr > < td > < a name = "SkPath_copy_operator_path" > < code > < strong > path < / strong > < / code > < / a > < / td > < td >
2018-02-15 22:31:24 +00:00
< a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , < a href = "#Conic_Weight" > Weights< / a > , and < a href = "#Fill_Type" > Fill Type< / a > to copy< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > copied by value
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "bba288f5f77fc8e37e89d2ec08e0ac60" >
#### Example Output
~~~~
path1 bounds = 10, 20, 30, 40
path2 bounds = 10, 20, 30, 40
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_swap" > swap< / a > < a href = "#SkPath_copy_const_SkPath" > SkPath(const SkPath& path)< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_equal_operator" > < / a >
2017-07-28 19:18:29 +00:00
## operator==
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-29 21:36:51 +00:00
bool operator==(const SkPath& a, const SkPath& b)
2017-07-28 19:18:29 +00:00
< / pre >
2018-02-15 22:31:24 +00:00
Compares < 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 = "#Conic_Weight" > Weights< / a >
2017-07-28 19:18:29 +00:00
are equivalent.
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_equal_operator_a" > < code > < strong > a < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > to compare< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_equal_operator_b" > < code > < strong > b < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > to compare< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#Path" > Path< / a > pair are equivalent
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< div > < fiddle-embed name = "31883f51bb357f2ac5990d88f8b82e02" > < div > Rewind removes < a href = "#Verb_Array" > Verb Array< / a > but leaves storage; since storage is not compared,
2018-03-05 18:26:16 +00:00
< a href = "#Path" > Path< / a > pair are equivalent.
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
empty one == two
moveTo one != two
rewind one == two
reset one == two
~~~~
< / fiddle-embed > < / div >
---
2017-11-27 15:44:06 +00:00
< a name = "SkPath_notequal_operator" > < / a >
2017-07-28 19:18:29 +00:00
## operator!=
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-29 21:36:51 +00:00
bool operator!=(const SkPath& a, const SkPath& b)
2017-07-28 19:18:29 +00:00
< / pre >
2018-02-15 22:31:24 +00:00
Compares < 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 = "#Conic_Weight" > Weights< / a >
2017-07-28 19:18:29 +00:00
are not equivalent.
### Parameters
2017-11-27 15:44:06 +00:00
< table > < tr > < td > < a name = "SkPath_notequal_operator_a" > < code > < strong > a < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > to compare< / td >
2017-11-27 15:44:06 +00:00
< / tr > < tr > < td > < a name = "SkPath_notequal_operator_b" > < code > < strong > b < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > to compare< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#Path" > Path< / a > pair are not equivalent
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< div > < fiddle-embed name = "0c6870ba1cea85ce6da5abd489c23d83" > < div > < a href = "#Path" > Path< / a > pair are equal though their convexity is not equal.
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
empty one == two
addRect one == two
setConvexity one == two
convexity !=
~~~~
< / fiddle-embed > < / div >
---
2018-02-06 14:41:53 +00:00
## <a name="Property"></a> Property
| name | description |
| --- | --- |
| < a href = "#SkPath_IsCubicDegenerate" > IsCubicDegenerate< / a > | returns if < a href = "#Cubic" > Cubic< / a > is very small |
| < a href = "#SkPath_IsInverseFillType" > IsInverseFillType< / a > | returns if < a href = "#Fill_Type" > Fill Type< / a > represents outside geometry |
| < a href = "#SkPath_IsLineDegenerate" > IsLineDegenerate< / a > | returns if < a href = "undocumented#Line" > Line< / a > is very small |
| < a href = "#SkPath_IsQuadDegenerate" > IsQuadDegenerate< / a > | returns if < a href = "#Quad" > Quad< / a > is very small |
| < a href = "#SkPath_computeTightBounds" > computeTightBounds< / a > | returns extent of geometry |
| < a href = "#SkPath_conservativelyContainsRect" > conservativelyContainsRect< / a > | returns true if < a href = "SkRect_Reference#Rect" > Rect< / a > may be inside |
| < a href = "#SkPath_contains" > contains< / a > | returns if < a href = "SkPoint_Reference#Point" > Point< / a > is in fill area |
| < a href = "#SkPath_getBounds" > getBounds< / a > | returns maximum and minimum of < a href = "#Point_Array" > Point Array< / a > |
| < a href = "#SkPath_getLastPt" > getLastPt< / a > | returns < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_isEmpty" > isEmpty< / a > | returns if verb count is zero |
| < a href = "#SkPath_isFinite" > isFinite< / a > | returns if all < a href = "SkPoint_Reference#Point" > Point< / a > values are finite |
2018-02-15 22:31:24 +00:00
| < a href = "#SkPath_isInterpolatable" > isInterpolatable< / a > | returns if pair contains equal counts of < a href = "#Verb_Array" > Verb Array< / a > and < a href = "#Conic_Weight" > Weights< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_isLastContourClosed" > isLastContourClosed< / a > | returns if final < a href = "#Contour" > Contour< / a > forms a loop |
| < a href = "#SkPath_isLine" > isLine< / a > | returns if describes < a href = "undocumented#Line" > Line< / a > |
| < a href = "#SkPath_isNestedFillRects" > isNestedFillRects< / a > | returns if describes < a href = "SkRect_Reference#Rect" > Rect< / a > pair, one inside the other |
| < a href = "#SkPath_isOval" > isOval< / a > | returns if describes < a href = "undocumented#Oval" > Oval< / a > |
| < a href = "#SkPath_isRRect" > isRRect< / a > | returns if describes < a href = "undocumented#Round_Rect" > Round Rect< / a > |
| < a href = "#SkPath_isRect" > isRect< / a > | returns if describes < a href = "SkRect_Reference#Rect" > Rect< / a > |
| < a href = "#SkPath_isValid" > isValid< / a > | returns if data is internally consistent |
| < a href = "#SkPath_isVolatile" > isVolatile< / a > | returns if < a href = "undocumented#Device" > Device< / a > should not cache |
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isInterpolatable" > < / a >
2017-07-28 19:18:29 +00:00
## isInterpolatable
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isInterpolatable(const SkPath& compare) const
< / pre >
2018-02-15 22:31:24 +00:00
Return true if < a href = "#Path" > Paths< / a > contain equal < a href = "#Verb" > Verbs< / a > and equal < a href = "#Conic_Weight" > Weights< / a > .
If < a href = "#Path" > Paths< / a > contain one or more < a href = "#Conic" > Conics< / a > , the < a href = "#Conic_Weight" > Weights< / a > must match.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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
2018-01-26 17:56:22 +00:00
trivial to interpolate a pair of < a href = "#Path" > Paths< / a > containing < a href = "#Conic" > Conics< / a > with different
2018-01-04 21:11:51 +00:00
< a href = "#Conic_Weight" > Conic Weight< / a > values.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_isInterpolatable_compare" > < code > < strong > compare < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > to < a href = "#SkPath_isInterpolatable_compare" > compare< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-02-15 22:31:24 +00:00
true if < a href = "#Path" > Paths< / a > < a href = "#Verb_Array" > Verb Array< / a > and < a href = "#Conic_Weight" > Weights< / a > are equivalent
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "c81fc7dfaf785c3fb77209c7f2ebe5b8" >
#### Example Output
~~~~
paths are interpolatable
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_isInterpolatable" > isInterpolatable< / a >
2017-07-28 19:18:29 +00:00
---
2018-02-06 14:41:53 +00:00
## <a name="Interpolate"></a> Interpolate
| name | description |
| --- | --- |
| < a href = "#SkPath_interpolate" > interpolate< / a > | interpolates between < a href = "#Path" > Path< / a > pair |
2017-08-25 17:14:33 +00:00
< a name = "SkPath_interpolate" > < / a >
2017-07-28 19:18:29 +00:00
## interpolate
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const
< / pre >
2018-02-06 14:41:53 +00:00
< a href = "#Interpolate" > Interpolate< / a > between < a href = "#Path" > Paths< / a > with < a href = "#Point_Array" > Point Array< / a > of equal size.
2018-02-15 22:31:24 +00:00
Copy < a href = "#Verb_Array" > Verb Array< / a > and < a href = "#Conic_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
2018-01-03 13:37:53 +00:00
average 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:
2018-03-05 18:26:16 +00:00
(< 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 > )
.
2017-10-26 11:58:48 +00:00
2018-01-04 21:11:51 +00:00
< 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
one (this < a href = "#Point_Array" > Point Array< / a > ); will work with values outside of this
2017-08-29 21:36:51 +00:00
range.
< 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
2018-01-04 21:11:51 +00:00
the 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 >
2017-08-25 15:51:49 +00:00
compatibility prior to calling < a href = "#SkPath_interpolate" > interpolate< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_interpolate_ending" > < code > < strong > ending < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Point_Array" > Point Array< / a > averaged with this < a href = "#Point_Array" > Point Array< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_interpolate_weight" > < code > < strong > weight < / strong > < / code > < / a > < / td > < td >
2018-01-04 21:11:51 +00:00
contribution of this < a href = "#Point_Array" > Point Array< / a > , and
2018-01-03 13:37:53 +00:00
one minus contribution of < a href = "#SkPath_interpolate_ending" > ending< / a > < a href = "#Point_Array" > Point Array< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_interpolate_out" > < code > < strong > out < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > replaced by interpolated averages< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-02-15 22:31:24 +00:00
true if < a href = "#Path" > Paths< / a > contain same number of < a href = "SkPoint_Reference#Point" > Points< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "404f11c5c9c9ca8a64822d484552a473" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_isInterpolatable" > isInterpolatable< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_unique" > < / a >
2017-07-28 19:18:29 +00:00
## unique
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool unique() const
< / pre >
2018-02-06 14:41:53 +00:00
soonOnly valid for Android framework.
2017-07-28 19:18:29 +00:00
---
## <a name="Fill_Type"></a> Fill Type
2017-08-25 15:51:49 +00:00
## <a name="SkPath_FillType"></a> Enum SkPath::FillType
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-25 15:51:49 +00:00
enum < a href = "#SkPath_FillType" > FillType< / a > {
2018-01-04 21:11:51 +00:00
< a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > ,
< a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > ,
< a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > ,
< a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > ,
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-07-28 19:18:29 +00:00
2018-01-04 21:11:51 +00:00
< 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 >
2017-08-25 15:51:49 +00:00
fills if the sum of < a href = "#Contour" > Contour< / a > edges is not zero, where clockwise edges add one, and
counterclockwise edges subtract one. < a href = "#Path" > Path< / a > set to < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > fills if the
2018-01-04 21:11:51 +00:00
number of < a href = "#Contour" > Contour< / a > edges is odd. Each < a href = "#Fill_Type" > Fill Type< / a > has an inverse variant that
2017-07-28 19:18:29 +00:00
reverses the rule:
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > fills where the sum of < a href = "#Contour" > Contour< / a > edges is zero;
< a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > fills where the number of < a href = "#Contour" > Contour< / a > edges is even.
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "525ed591c31960de23068dba8ea11a75" > < div > The top row has two clockwise rectangles. The second row has one clockwise and
one counterclockwise rectangle. The even-odd variants draw the same. The
winding variants draw the top rectangle overlap, which has a winding of 2, the
2018-03-05 18:26:16 +00:00
same as the outer parts of the top rectangles, which have a winding of 1.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### Constants
< table >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "0ebf978b234a00e2c2573cfa7b04e776" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkPaint_Reference#SkPaint_Style" > SkPaint::Style< / a > < a href = "#SkPath_Direction" > Direction< / a > < a href = "#SkPath_getFillType" > getFillType< / a > < a href = "#SkPath_setFillType" > setFillType< / a >
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getFillType" > < / a >
2017-07-28 19:18:29 +00:00
## getFillType
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
FillType getFillType() const
< / pre >
2017-08-25 15:51:49 +00:00
Returns < 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
< a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > .
2017-07-28 19:18:29 +00:00
### Return Value
2018-01-04 21:11:51 +00:00
one of: < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > , < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > , < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > ,
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "2eb8f985d1e263e70b5c0aa4a8b68d8e" >
#### Example Output
~~~~
default path fill type is kWinding_FillType
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_FillType" > FillType< / a > < a href = "#SkPath_setFillType" > setFillType< / a > < a href = "#SkPath_isInverseFillType" > isInverseFillType< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_setFillType" > < / a >
2017-07-28 19:18:29 +00:00
## setFillType
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void setFillType(FillType ft)
< / pre >
2017-08-29 21:36:51 +00:00
Sets < a href = "#SkPath_FillType" > FillType< / a > , the rule used to fill < a href = "#Path" > Path< / a > . While there is no check
2017-08-25 15:51:49 +00:00
that < a href = "#SkPath_setFillType_ft" > ft< / a > is legal, values outside of < a href = "#SkPath_FillType" > FillType< / a > are not supported.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_setFillType_ft" > < code > < strong > ft < / strong > < / code > < / a > < / td > < td >
2018-01-04 21:11:51 +00:00
one of: < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > , < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > , < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > ,
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_FillType" > FillType< / a > < a href = "#SkPath_getFillType" > getFillType< / a > < a href = "#SkPath_toggleInverseFillType" > toggleInverseFillType< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isInverseFillType" > < / a >
2017-07-28 19:18:29 +00:00
## isInverseFillType
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isInverseFillType() const
< / pre >
2017-08-25 15:51:49 +00:00
Returns if < a href = "#SkPath_FillType" > FillType< / a > describes area outside < a href = "#Path" > Path< / a > geometry. The inverse fill area
2017-07-28 19:18:29 +00:00
extends indefinitely.
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#SkPath_FillType" > FillType< / a > is < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > or < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "2a2d39f5da611545caa18bbcea873ab2" >
#### Example Output
~~~~
default path fill type is inverse: false
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_FillType" > FillType< / a > < a href = "#SkPath_getFillType" > getFillType< / a > < a href = "#SkPath_setFillType" > setFillType< / a > < a href = "#SkPath_toggleInverseFillType" > toggleInverseFillType< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_toggleInverseFillType" > < / a >
2017-07-28 19:18:29 +00:00
## toggleInverseFillType
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void toggleInverseFillType()
< / pre >
2017-08-25 15:51:49 +00:00
Replace < a href = "#SkPath_FillType" > FillType< / a > with its inverse. The inverse of < a href = "#SkPath_FillType" > FillType< / a > describes the area
unmodified by the original < a href = "#SkPath_FillType" > FillType< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_FillType" > FillType< / a > | toggled < a href = "#SkPath_FillType" > FillType< / a > |
2017-07-28 19:18:29 +00:00
| --- | --- |
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > | < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > |
| < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > | < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > |
| < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > | < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > |
| < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > | < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > |
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_FillType" > FillType< / a > < a href = "#SkPath_getFillType" > getFillType< / a > < a href = "#SkPath_setFillType" > setFillType< / a > < a href = "#SkPath_isInverseFillType" > isInverseFillType< / a >
2017-07-28 19:18:29 +00:00
---
## <a name="Convexity"></a> Convexity
2017-08-25 15:51:49 +00:00
## <a name="SkPath_Convexity"></a> Enum SkPath::Convexity
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-10-11 14:37:52 +00:00
enum < a href = "#Convexity" > Convexity< / a > : uint8_t {
2018-01-04 21:11:51 +00:00
< a href = "#SkPath_kUnknown_Convexity" > kUnknown Convexity< / a > ,
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_kConvex_Convexity" > kConvex Convexity< / a > ,
2018-01-04 21:11:51 +00:00
< a href = "#SkPath_kConcave_Convexity" > kConcave Convexity< / a > ,
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-07-28 19:18:29 +00:00
2018-01-26 17:56:22 +00:00
< 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
2018-01-04 21:11:51 +00:00
360 degrees, and < a href = "#Contour" > Contour< / a > angles all have same < a href = "#SkPath_Direction" > Direction< / a > . Convex < a href = "#Path" > Path< / a >
2017-08-04 16:48:24 +00:00
may have better performance and require fewer resources on < a href = "undocumented#GPU_Surface" > GPU Surface< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#Path" > Path< / a > is concave when either at least one < a href = "#SkPath_Direction" > Direction< / a > change is clockwise and
another is counterclockwise, or the sum of the changes in < a href = "#SkPath_Direction" > Direction< / a > is not 360
2017-07-28 19:18:29 +00:00
degrees.
2018-01-04 21:11:51 +00:00
Initially < 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
2017-11-27 15:44:06 +00:00
if needed by destination < a href = "SkSurface_Reference#Surface" > Surface< / a > .
2017-07-28 19:18:29 +00:00
### Constants
< table >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "b7d0c0732411db76fa37b05fc18712b3" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getConvexity" > < / a >
2017-07-28 19:18:29 +00:00
## getConvexity
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
Convexity getConvexity() const
< / pre >
2018-01-04 21:11:51 +00:00
Computes < a href = "#Convexity" > Convexity< / a > if required, and returns stored value.
2017-08-25 15:51:49 +00:00
< a href = "#Convexity" > Convexity< / a > is computed if stored value is < a href = "#SkPath_kUnknown_Convexity" > kUnknown Convexity< / a > ,
or if < a href = "#Path" > Path< / a > has been altered since < a href = "#Convexity" > Convexity< / a > was computed or set.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-30 12:58:10 +00:00
computed or stored < a href = "#Convexity" > Convexity< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "c8f5ac4040cb5026d234bf99e3f01e8e" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getConvexityOrUnknown" > < / a >
2017-07-28 19:18:29 +00:00
## getConvexityOrUnknown
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
Convexity getConvexityOrUnknown() const
< / pre >
2018-01-04 21:11:51 +00:00
Returns last computed < a href = "#Convexity" > Convexity< / a > , or < a href = "#SkPath_kUnknown_Convexity" > kUnknown Convexity< / a > if
2017-08-25 15:51:49 +00:00
< a href = "#Path" > Path< / a > has been altered since < a href = "#Convexity" > Convexity< / a > was computed or set.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-30 12:58:10 +00:00
stored < a href = "#Convexity" > Convexity< / a >
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< 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
2018-03-05 18:26:16 +00:00
that alters the path.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2017-08-25 15:51:49 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_setConvexity" > < / a >
2017-07-28 19:18:29 +00:00
## setConvexity
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void setConvexity(Convexity convexity)
< / pre >
2017-08-25 15:51:49 +00:00
Stores < a href = "#SkPath_setConvexity_convexity" > convexity< / a > so that it is later returned by < a href = "#SkPath_getConvexity" > getConvexity< / a > or < a href = "#SkPath_getConvexityOrUnknown" > getConvexityOrUnknown< / a > .
< a href = "#SkPath_setConvexity_convexity" > convexity< / a > may differ from < a href = "#SkPath_getConvexity" > getConvexity< / a > , although setting an incorrect value may
2017-07-28 19:18:29 +00:00
cause incorrect or inefficient drawing.
2017-08-25 15:51:49 +00:00
If < a href = "#SkPath_setConvexity_convexity" > convexity< / a > is < a href = "#SkPath_kUnknown_Convexity" > kUnknown Convexity< / a > : < a href = "#SkPath_getConvexity" > getConvexity< / a > will
compute < a href = "#Convexity" > Convexity< / a > , and < a href = "#SkPath_getConvexityOrUnknown" > getConvexityOrUnknown< / a > will return < a href = "#SkPath_kUnknown_Convexity" > kUnknown Convexity< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
If < a href = "#SkPath_setConvexity_convexity" > convexity< / a > is < a href = "#SkPath_kConvex_Convexity" > kConvex Convexity< / a > or < a href = "#SkPath_kConcave_Convexity" > kConcave Convexity< / a > , < a href = "#SkPath_getConvexity" > getConvexity< / a >
and < a href = "#SkPath_getConvexityOrUnknown" > getConvexityOrUnknown< / a > will return < a href = "#SkPath_setConvexity_convexity" > convexity< / a > until the path is
2017-07-28 19:18:29 +00:00
altered.
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_setConvexity_convexity" > < code > < strong > convexity < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
one of: < a href = "#SkPath_kUnknown_Convexity" > kUnknown Convexity< / a > , < a href = "#SkPath_kConvex_Convexity" > kConvex Convexity< / a > , or < a href = "#SkPath_kConcave_Convexity" > kConcave Convexity< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "6fe0d520507eeafe118b80f7f1d9b588" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isConvex" > < / a >
2017-07-28 19:18:29 +00:00
## isConvex
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isConvex() const
< / pre >
2017-08-25 15:51:49 +00:00
Computes < a href = "#Convexity" > Convexity< / a > if required, and returns true if value is < a href = "#SkPath_kConvex_Convexity" > kConvex Convexity< / a > .
If < a href = "#SkPath_setConvexity" > setConvexity< / a > was called with < a href = "#SkPath_kConvex_Convexity" > kConvex Convexity< / a > or < a href = "#SkPath_kConcave_Convexity" > kConcave Convexity< / a > , and
the path has not been altered, < a href = "#Convexity" > Convexity< / a > is not recomputed.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#Convexity" > Convexity< / a > stored or computed is < a href = "#SkPath_kConvex_Convexity" > kConvex Convexity< / a >
2017-07-28 19:18:29 +00:00
### Example
2018-01-04 21:11:51 +00:00
< div > < fiddle-embed name = "dfd2c40e1c2a7b539a94aec8d040d349" > < div > Concave shape is erroneously considered convex after a forced call to
2018-03-05 18:26:16 +00:00
< a href = "#SkPath_setConvexity" > setConvexity< / a > .
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2017-08-25 15:51:49 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isOval" > < / a >
2017-07-28 19:18:29 +00:00
## isOval
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2018-02-20 20:06:13 +00:00
bool isOval(SkRect* bounds) const
2017-07-28 19:18:29 +00:00
< / pre >
2018-02-20 20:06:13 +00:00
Returns true if this path is recognized as an oval or circle.
2017-07-28 19:18:29 +00:00
2018-02-20 20:06:13 +00:00
< a href = "#SkPath_isOval_bounds" > bounds< / a > receives < a href = "#SkPath_isOval_bounds" > bounds< / a > of < a href = "undocumented#Oval" > Oval< / a > .
2017-08-29 21:36:51 +00:00
2018-02-20 20:06:13 +00:00
< a href = "#SkPath_isOval_bounds" > bounds< / a > is unmodified if < a href = "undocumented#Oval" > Oval< / a > is not found.
2017-07-28 19:18:29 +00:00
### Parameters
2018-02-20 20:06:13 +00:00
< table > < tr > < td > < a name = "SkPath_isOval_bounds" > < code > < strong > bounds < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
storage for bounding < a href = "SkRect_Reference#Rect" > Rect< / a > of < a href = "undocumented#Oval" > Oval< / a > ; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-02-20 20:06:13 +00:00
true if < a href = "#Path" > Path< / a > is recognized as an oval or circle
2017-07-28 19:18:29 +00:00
### Example
2018-02-20 20:06:13 +00:00
< div > < fiddle-embed name = "a51256952b183ee0f7004f2c87cbbf5b" > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isRRect" > < / a >
2017-07-28 19:18:29 +00:00
## isRRect
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2018-02-20 20:06:13 +00:00
bool isRRect(SkRRect* rrect) const
2017-07-28 19:18:29 +00:00
< / pre >
2018-02-20 20:06:13 +00:00
Returns true if this path is recognized as a < a href = "undocumented#SkRRect" > SkRRect< / a > (but not an oval/circle or rect).
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_isRRect_rrect" > rrect< / a > receives bounds of < a href = "undocumented#Round_Rect" > Round Rect< / a > .
2018-02-20 20:06:13 +00:00
< a href = "#SkPath_isRRect_rrect" > rrect< / a > is unmodified if < a href = "undocumented#Round_Rect" > Round Rect< / a > is not found.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_isRRect_rrect" > < code > < strong > rrect < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
storage for bounding < a href = "SkRect_Reference#Rect" > Rect< / a > of < a href = "undocumented#Round_Rect" > Round Rect< / a > ; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-01-26 17:56:22 +00:00
true if < a href = "#Path" > Path< / a > contains only < a href = "undocumented#Round_Rect" > Round Rect< / a >
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< div > < fiddle-embed name = "2aa939b90d96aff436b145a96305132c" > < div > Draw rounded rectangle and its bounds.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_reset" > < / a >
2017-07-28 19:18:29 +00:00
## reset
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void reset()
< / pre >
2017-09-01 19:51:02 +00:00
Sets < a href = "#Path" > Path< / a > to its initial state.
2018-02-15 22:31:24 +00:00
Removes < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Weights< / a > , and sets < a href = "#SkPath_FillType" > FillType< / a > to < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > .
2017-08-25 15:51:49 +00:00
Internal storage associated with < a href = "#Path" > Path< / a > is released.
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "8cdca35d2964bbbecb93d79a13f71c65" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_rewind" > rewind< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_rewind" > < / a >
2017-07-28 19:18:29 +00:00
## rewind
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void rewind()
< / pre >
2017-09-01 19:51:02 +00:00
Sets < a href = "#Path" > Path< / a > to its initial state, preserving internal storage.
2018-02-15 22:31:24 +00:00
Removes < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Weights< / a > , and sets < a href = "#SkPath_FillType" > FillType< / a > to < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > .
2017-08-25 15:51:49 +00:00
Internal storage associated with < a href = "#Path" > Path< / a > is retained.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
Use < 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
2018-01-04 21:11:51 +00:00
is critical.
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "f1fedbb89da9c2a33a91805175663012" > < div > Although path1 retains its internal storage, it is indistinguishable from
2018-03-05 18:26:16 +00:00
a newly initialized path.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_reset" > reset< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isEmpty" > < / a >
2017-07-28 19:18:29 +00:00
## isEmpty
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isEmpty() const
< / pre >
2017-11-27 15:44:06 +00:00
Empty < 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 > .
2018-01-26 17:56:22 +00:00
< 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.
2017-07-28 19:18:29 +00:00
### Return Value
2018-01-26 17:56:22 +00:00
true if the path contains no < a href = "#SkPath_Verb" > Verb< / a > array
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "0b34e6d55d11586744adeb889d2a12f4" >
#### Example Output
~~~~
initial path is empty
after moveTo path is not empty
after rewind path is empty
after lineTo path is not empty
after reset path is empty
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_empty_constructor" > SkPath()< / a > < a href = "#SkPath_reset" > reset< / a > < a href = "#SkPath_rewind" > rewind< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isLastContourClosed" > < / a >
2017-07-28 19:18:29 +00:00
## isLastContourClosed
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isLastContourClosed() const
< / pre >
2017-08-25 15:51:49 +00:00
< 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,
2018-02-15 22:31:24 +00:00
closed < a href = "#Contour" > Contour< / a > draws < a href = "SkPaint_Reference#Stroke_Join" > Paint Stroke Join< / a > instead of < a href = "SkPaint_Reference#Stroke_Cap" > Paint Stroke Cap< / a > at first and last < a href = "SkPoint_Reference#Point" > Point< / a > .
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
true if the last < a href = "#Contour" > Contour< / a > ends with a < a href = "#SkPath_kClose_Verb" > kClose Verb< / a >
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< 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
2018-03-05 18:26:16 +00:00
false until < a href = "#Path" > Path< / a > has geometry followed by < a href = "#SkPath_close" > close< / a > .
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
initial last contour is not closed
after close last contour is not closed
after lineTo last contour is not closed
after close last contour is closed
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_close" > close< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isFinite" > < / a >
2017-07-28 19:18:29 +00:00
## isFinite
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isFinite() const
< / pre >
2017-11-27 15:44:06 +00:00
Returns true for finite < a href = "SkPoint_Reference#Point" > Point< / a > array values between negative < a href = "undocumented#SK_ScalarMax" > SK ScalarMax< / a > and
positive < a href = "undocumented#SK_ScalarMax" > SK ScalarMax< / a > . Returns false for any < a href = "SkPoint_Reference#Point" > Point< / a > array value of
2017-08-29 21:36:51 +00:00
< 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 > .
2017-07-28 19:18:29 +00:00
### Return Value
2017-11-27 15:44:06 +00:00
true if all < a href = "SkPoint_Reference#Point" > Point< / a > values are finite
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "dd4e4dd2aaa8039b2430729c6b3af817" >
#### Example Output
~~~~
initial path is finite
after line path is finite
after scale path is not finite
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-04 16:48:24 +00:00
< a href = "undocumented#SkScalar" > SkScalar< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isVolatile" > < / a >
2017-07-28 19:18:29 +00:00
## isVolatile
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isVolatile() const
< / pre >
Returns true if the path is volatile; it will not be altered or discarded
2018-01-04 21:11:51 +00:00
by the caller after it is drawn. < a href = "#Path" > Paths< / a > by default have volatile set false, allowing
2017-11-27 15:44:06 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
may not speed repeated drawing.
### Return Value
2017-08-29 21:36:51 +00:00
true if caller will alter < a href = "#Path" > Path< / a > after drawing
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "c722ebe8ac991d77757799ce29e509e1" >
#### Example Output
~~~~
volatile by default is false
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_setIsVolatile" > setIsVolatile< / a >
2017-07-28 19:18:29 +00:00
---
2018-02-06 14:41:53 +00:00
## <a name="Volatile"></a> Volatile
| name | description |
| --- | --- |
| < a href = "#SkPath_setIsVolatile" > setIsVolatile< / a > | sets if < a href = "undocumented#Device" > Device< / a > should not cache |
2017-08-25 17:14:33 +00:00
< a name = "SkPath_setIsVolatile" > < / a >
2017-07-28 19:18:29 +00:00
## setIsVolatile
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void setIsVolatile(bool isVolatile)
< / pre >
2017-08-25 15:51:49 +00:00
Specify whether < a href = "#Path" > Path< / a > is volatile; whether it will be altered or discarded
2018-01-04 21:11:51 +00:00
by the caller after it is drawn. < a href = "#Path" > Paths< / a > by default have volatile set false, allowing
2017-08-04 16:48:24 +00:00
< a href = "undocumented#Device" > Device< / a > to attach a cache of data which speeds repeated drawing.
2017-07-28 19:18:29 +00:00
Mark temporary paths, discarded or modified after use, as volatile
2017-08-04 16:48:24 +00:00
to inform < a href = "undocumented#Device" > Device< / a > that the path need not be cached.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
Mark animating < a href = "#Path" > Path< / a > volatile to improve performance.
2017-09-01 19:51:02 +00:00
Mark unchanging < a href = "#Path" > Path< / a > non-volatile to improve repeated rendering.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "undocumented#Raster_Surface" > Raster Surface< / a > < a href = "#Path" > Path< / a > draws are affected by volatile for some shadows.
< a href = "undocumented#GPU_Surface" > GPU Surface< / a > < a href = "#Path" > Path< / a > draws are affected by volatile for some shadows and concave geometries.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_setIsVolatile_isVolatile" > < code > < strong > isVolatile < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
true if caller will alter < a href = "#Path" > Path< / a > after drawing< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "2049ff5141f0c80aac497618622b28af" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_isVolatile" > isVolatile< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_IsLineDegenerate" > < / a >
2017-07-28 19:18:29 +00:00
## IsLineDegenerate
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact)
< / pre >
2017-11-27 15:44:06 +00:00
Test if < a href = "undocumented#Line" > Line< / a > between < a href = "SkPoint_Reference#Point" > Point< / a > pair is degenerate.
2017-08-04 16:48:24 +00:00
< a href = "undocumented#Line" > Line< / a > with no length or that moves a very short distance is degenerate; it is
2018-01-04 21:11:51 +00:00
treated as a point.
2017-07-28 19:18:29 +00:00
2017-08-30 12:58:10 +00:00
< 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 > .
If false, returns true if < a href = "#SkPath_IsLineDegenerate_p1" > p1< / a > equals or nearly equals < a href = "#SkPath_IsLineDegenerate_p2" > p2< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_IsLineDegenerate_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
line start point< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsLineDegenerate_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
line end point< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsLineDegenerate_exact" > < code > < strong > exact < / strong > < / code > < / a > < / td > < td >
2017-08-30 12:58:10 +00:00
if false, allow nearly equals< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "undocumented#Line" > Line< / a > is degenerate; its length is effectively zero
2017-07-28 19:18:29 +00:00
### Example
2017-09-01 19:51:02 +00:00
< div > < fiddle-embed name = "97a031f9186ade586928563840ce9116" > < div > As single precision floats, 100 and 100.000001 have the same bit representation,
and are exactly equal. 100 and 100.0001 have different bit representations, and
2018-03-05 18:26:16 +00:00
are not exactly equal, but are nearly equal.
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
line from (100,100) to (100,100) is degenerate, nearly
line from (100,100) to (100,100) is degenerate, exactly
line from (100,100) to (100.0001,100.0001) is degenerate, nearly
line from (100,100) to (100.0001,100.0001) is not degenerate, exactly
~~~~
< / fiddle-embed > < / div >
### See Also
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_IsQuadDegenerate" > IsQuadDegenerate< / a > < a href = "#SkPath_IsCubicDegenerate" > IsCubicDegenerate< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_IsQuadDegenerate" > < / a >
2017-07-28 19:18:29 +00:00
## IsQuadDegenerate
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3, bool exact)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Test if < a href = "#Quad" > Quad< / a > is degenerate.
< a href = "#Quad" > Quad< / a > with no length or that moves a very short distance is degenerate; it is
2018-01-04 21:11:51 +00:00
treated as a point.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_IsQuadDegenerate_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
< a href = "#Quad" > Quad< / a > start point< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsQuadDegenerate_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
< a href = "#Quad" > Quad< / a > control point< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsQuadDegenerate_p3" > < code > < strong > p3 < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
< a href = "#Quad" > Quad< / a > end point< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsQuadDegenerate_exact" > < code > < strong > exact < / strong > < / code > < / a > < / td > < td >
2018-01-04 21:11:51 +00:00
if true, returns true only if < a href = "#SkPath_IsQuadDegenerate_p1" > p1< / a > , < a href = "#SkPath_IsQuadDegenerate_p2" > p2< / a > , and < a href = "#SkPath_IsQuadDegenerate_p3" > p3< / a > are equal;
2017-08-29 21:36:51 +00:00
if false, returns true if < a href = "#SkPath_IsQuadDegenerate_p1" > p1< / a > , < a href = "#SkPath_IsQuadDegenerate_p2" > p2< / a > , and < a href = "#SkPath_IsQuadDegenerate_p3" > p3< / a > are equal or nearly equal< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#Quad" > Quad< / a > is degenerate; its length is effectively zero
2017-07-28 19:18:29 +00:00
### Example
2017-09-01 19:51:02 +00:00
< div > < fiddle-embed name = "1d50896c528cd4581966646b7d96acff" > < div > As single precision floats: 100, 100.00001, and 100.00002 have different bit representations
2017-07-28 19:18:29 +00:00
but nearly the same value. Translating all three by 1000 gives them the same bit representation;
2018-03-05 18:26:16 +00:00
the fractional portion of the number can not be represented by the float and is lost.
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is degenerate, nearly
quad (1100,1100), (1100,1100), (1100,1100) is degenerate, nearly
quad (100,100), (100.00001,100.00001), (100.00002,100.00002) is not degenerate, exactly
quad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly
~~~~
< / fiddle-embed > < / div >
### See Also
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_IsLineDegenerate" > IsLineDegenerate< / a > < a href = "#SkPath_IsCubicDegenerate" > IsCubicDegenerate< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_IsCubicDegenerate" > < / a >
2017-07-28 19:18:29 +00:00
## IsCubicDegenerate
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
static bool IsCubicDegenerate(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3,
const SkPoint& p4, bool exact)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Test if < a href = "#Cubic" > Cubic< / a > is degenerate.
< a href = "#Cubic" > Cubic< / a > with no length or that moves a very short distance is degenerate; it is
2018-01-04 21:11:51 +00:00
treated as a point.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_IsCubicDegenerate_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
< a href = "#Cubic" > Cubic< / a > start point< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsCubicDegenerate_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
< a href = "#Cubic" > Cubic< / a > control point 1< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsCubicDegenerate_p3" > < code > < strong > p3 < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
< a href = "#Cubic" > Cubic< / a > control point 2< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsCubicDegenerate_p4" > < code > < strong > p4 < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
< a href = "#Cubic" > Cubic< / a > end point< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_IsCubicDegenerate_exact" > < code > < strong > exact < / strong > < / code > < / a > < / td > < td >
2018-01-04 21:11:51 +00:00
if true, returns true only if < a href = "#SkPath_IsCubicDegenerate_p1" > p1< / a > , < a href = "#SkPath_IsCubicDegenerate_p2" > p2< / a > , < a href = "#SkPath_IsCubicDegenerate_p3" > p3< / a > , and < a href = "#SkPath_IsCubicDegenerate_p4" > p4< / a > are equal;
2017-08-29 21:36:51 +00:00
if false, returns true if < a href = "#SkPath_IsCubicDegenerate_p1" > p1< / a > , < a href = "#SkPath_IsCubicDegenerate_p2" > p2< / a > , < a href = "#SkPath_IsCubicDegenerate_p3" > p3< / a > , and < a href = "#SkPath_IsCubicDegenerate_p4" > p4< / a > are equal or nearly equal< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#Cubic" > Cubic< / a > is degenerate; its length is effectively zero
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "c79d813f0b37062cb2f7a0c83f4a09f3" >
#### Example Output
~~~~
0.00024414062 is degenerate
0.00024414065 is length
~~~~
< / fiddle-embed > < / div >
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isLine" > < / a >
2017-07-28 19:18:29 +00:00
## isLine
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isLine(SkPoint line[2]) const
< / pre >
2018-01-26 17:56:22 +00:00
Returns true if < a href = "#Path" > Path< / a > contains only one < a href = "undocumented#Line" > Line< / a > ;
2018-01-04 21:11:51 +00:00
< 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 > .
2018-01-26 17:56:22 +00:00
If < 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
2017-08-04 16:48:24 +00:00
< a href = "undocumented#Line" > Line< / a > start point and < a href = "undocumented#Line" > Line< / a > end point.
2017-08-25 15:51:49 +00:00
Returns 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.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_isLine_line" > < code > < strong > line < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
storage for < a href = "undocumented#Line" > Line< / a > . May be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-01-26 17:56:22 +00:00
true if < a href = "#Path" > Path< / a > contains exactly one < a href = "undocumented#Line" > Line< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "1ad07d56e4258e041606d50cad969392" >
#### Example Output
~~~~
empty is not line
zero line is line (0,0) (0,0)
line is line (10,10) (20,20)
second move is not line
~~~~
< / fiddle-embed > < / div >
---
## <a name="Point_Array"></a> Point Array
2018-02-15 22:31:24 +00:00
< a href = "#Point_Array" > Point Array< / a > contains < a href = "SkPoint_Reference#Point" > Points< / a > satisfying the allocated < a href = "SkPoint_Reference#Point" > Points< / a > for
2017-08-25 15:51:49 +00:00
each < 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 >
2017-09-01 19:51:02 +00:00
and < a href = "#Quad" > Quad< / a > is described by < a href = "#Verb_Array" > Verb Array< / a > : Verb::kMoveTo, Verb::kLineTo, Verb::kQuadTo; and
2018-02-15 22:31:24 +00:00
one < a href = "SkPoint_Reference#Point" > Point< / a > for move, one < a href = "SkPoint_Reference#Point" > Point< / a > for < a href = "undocumented#Line" > Line< / a > , two < a href = "SkPoint_Reference#Point" > Points< / a > for < a href = "#Quad" > Quad< / a > ; totaling four < a href = "SkPoint_Reference#Point" > Points< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_getPoint" > getPoint< / a > , with < a href = "#SkPath_Iter" > Iter< / a > , or with < a href = "#SkPath_RawIter" > RawIter< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getPoints" > < / a >
2017-07-28 19:18:29 +00:00
## getPoints
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
int getPoints(SkPoint points[], int max) const
< / pre >
2017-08-25 15:51:49 +00:00
Returns 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.
< a href = "#SkPath_getPoints_points" > points< / a > may be nullptr; then, < a href = "#SkPath_getPoints_max" > max< / a > must be zero.
2018-01-04 21:11:51 +00:00
If < a href = "#SkPath_getPoints_max" > max< / a > is greater than number of < a href = "#SkPath_getPoints_points" > points< / a > , excess < a href = "#SkPath_getPoints_points" > points< / a > storage is unaltered.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_getPoints_points" > < code > < strong > points < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
storage for < a href = "#Path" > Path< / a > < a href = "SkPoint_Reference#Point" > Point< / a > array. May be nullptr< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_getPoints_max" > < code > < strong > max < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
maximum to copy; must be greater than or equal to zero< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-11-27 15:44:06 +00:00
< a href = "#Path" > Path< / a > < a href = "SkPoint_Reference#Point" > Point< / a > array length
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "9bc86efda08cbcd9c6f7c5f220294a24" >
#### Example Output
~~~~
no points point count: 3
zero max point count: 3
too small point count: 3 (0,0) (20,20)
just right point count: 3 (0,0) (20,20) (-10,-10)
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_countPoints" > countPoints< / a > < a href = "#SkPath_getPoint" > getPoint< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_countPoints" > < / a >
2017-07-28 19:18:29 +00:00
## countPoints
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
int countPoints() const
< / pre >
2017-08-25 15:51:49 +00:00
Returns the number of points in < a href = "#Path" > Path< / a > .
2018-01-04 21:11:51 +00:00
< a href = "SkPoint_Reference#Point" > Point< / a > count is initially zero.
2017-07-28 19:18:29 +00:00
### Return Value
2017-11-27 15:44:06 +00:00
< a href = "#Path" > Path< / a > < a href = "SkPoint_Reference#Point" > Point< / a > array length
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "bca6379ccef62cb081b10db7381deb27" >
#### Example Output
~~~~
empty point count: 0
zero line point count: 2
line point count: 2
second move point count: 3
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getPoints" > getPoints< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getPoint" > < / a >
2017-07-28 19:18:29 +00:00
## getPoint
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
SkPoint getPoint(int index) const
< / pre >
2017-11-27 15:44:06 +00:00
Returns < 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
2017-08-25 15:51:49 +00:00
0 to < a href = "#SkPath_countPoints" > countPoints< / a > - 1.
2018-01-04 21:11:51 +00:00
Returns (0, 0) if < a href = "#SkPath_getPoint_index" > index< / a > is out of range.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_getPoint_index" > < code > < strong > index < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "SkPoint_Reference#Point" > Point< / a > array element selector< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-11-27 15:44:06 +00:00
< a href = "SkPoint_Reference#Point" > Point< / a > array value or (0, 0)
2017-07-28 19:18:29 +00:00
### Example
2018-03-16 15:34:15 +00:00
< div > < fiddle-embed name = "abd6796f0e15bc7b4fe6f52f6cd2d1a5" >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
point 0: (-10,-10)
point 1: (10,10)
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_countPoints" > countPoints< / a > < a href = "#SkPath_getPoints" > getPoints< / a >
2017-07-28 19:18:29 +00:00
---
## <a name="Verb_Array"></a> Verb Array
2017-08-25 15:51:49 +00:00
< a href = "#Verb_Array" > Verb Array< / a > always starts with < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > .
If < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > is not the last entry, it is always followed by < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > ;
the quantity of < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > equals the < a href = "#Contour" > Contour< / a > count.
< a href = "#Verb_Array" > Verb Array< / a > does not include or count < a href = "#SkPath_kDone_Verb" > kDone Verb< / a > ; it is a convenience
returned when iterating through < a href = "#Verb_Array" > Verb Array< / a > .
2017-07-28 19:18:29 +00:00
2018-01-04 21:11:51 +00:00
< 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 > ,
2017-08-29 21:36:51 +00:00
or with < a href = "#SkPath_RawIter" > RawIter< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_countVerbs" > < / a >
2017-07-28 19:18:29 +00:00
## countVerbs
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
int countVerbs() const
< / pre >
2018-01-04 21:11:51 +00:00
Returns 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 > ,
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_kCubic_Verb" > kCubic Verb< / a > , and < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > ; added to < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
length of < a href = "#Verb_Array" > Verb Array< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "af0c66aea3ef81b709664c7007f48aae" >
#### Example Output
~~~~
empty verb count: 0
round rect verb count: 10
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_getVerbs" > getVerbs< / a > < a href = "#SkPath_Iter" > Iter< / a > < a href = "#SkPath_RawIter" > RawIter< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getVerbs" > < / a >
2017-07-28 19:18:29 +00:00
## getVerbs
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
int getVerbs(uint8_t verbs[], int max) const
< / pre >
2017-08-25 15:51:49 +00:00
Returns 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
< a href = "#SkPath_getVerbs_verbs" > verbs< / a > are copied as one byte per verb.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_getVerbs_verbs" > < code > < strong > verbs < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
storage for < a href = "#SkPath_getVerbs_verbs" > verbs< / a > , may be nullptr< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_getVerbs_max" > < code > < strong > max < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
maximum number to copy into < a href = "#SkPath_getVerbs_verbs" > verbs< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-25 15:51:49 +00:00
the actual number of < a href = "#SkPath_getVerbs_verbs" > verbs< / a > in the path
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "2ec66880966a6133ddd9331ce7323438" >
#### Example Output
~~~~
no verbs verb count: 3
zero max verb count: 3
too small verb count: 3 move line
just right verb count: 3 move line line
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_countVerbs" > countVerbs< / a > < a href = "#SkPath_getPoints" > getPoints< / a > < a href = "#SkPath_Iter" > Iter< / a > < a href = "#SkPath_RawIter" > RawIter< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_swap" > < / a >
2017-07-28 19:18:29 +00:00
## swap
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void swap(SkPath& other)
< / pre >
2018-02-15 22:31:24 +00:00
Exchanges the < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , < a href = "#Conic_Weight" > Weights< / a > , and < a href = "#Fill_Type" > Fill Type< / a > with < a href = "#SkPath_swap_other" > other< / a > .
2017-08-25 15:51:49 +00:00
Cached state is also exchanged. < a href = "#SkPath_swap" > swap< / a > internally exchanges pointers, so
2017-07-28 19:18:29 +00:00
it is lightweight and does not allocate memory.
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_swap" > swap< / a > usage has largely been replaced by < a href = "#SkPath_copy_operator" > operator=(const SkPath& path)< / a > .
2017-09-01 19:51:02 +00:00
< a href = "#Path" > Paths< / a > do not copy their content on assignment until they are written to,
2017-08-25 15:51:49 +00:00
making assignment as efficient as < a href = "#SkPath_swap" > swap< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_swap_other" > < code > < strong > other < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Path" > Path< / a > exchanged by value< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "4c5ebee2b5039e5faefa07ae63a15467" >
#### Example Output
~~~~
path1 bounds = 0, 0, 0, 0
path2 bounds = 10, 20, 30, 40
~~~~
< / fiddle-embed > < / div >
### See Also
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_copy_operator" > operator=(const SkPath& path)< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getBounds" > < / a >
2017-07-28 19:18:29 +00:00
## getBounds
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
const SkRect& getBounds() const
< / pre >
2018-01-04 21:11:51 +00:00
Returns minimum and maximum x and y values of < a href = "#Point_Array" > Point Array< / a > .
2018-01-26 17:56:22 +00:00
Returns (0, 0, 0, 0) if < a href = "#Path" > Path< / a > contains no points. Returned bounds width and height may
2017-08-25 15:51:49 +00:00
be larger or smaller than area affected when < a href = "#Path" > Path< / a > is drawn.
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
< a href = "SkRect_Reference#Rect" > Rect< / a > returned includes all < a href = "SkPoint_Reference#Point" > Points< / a > added to < a href = "#Path" > Path< / a > , including < a href = "SkPoint_Reference#Point" > Points< / a > associated with
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_kMove_Verb" > kMove Verb< / a > that define empty < a href = "#Contour" > Contours< / a > .
2017-07-28 19:18:29 +00:00
### Return Value
2018-02-15 22:31:24 +00:00
bounds of all < a href = "SkPoint_Reference#Point" > Points< / a > in < a href = "#Point_Array" > Point Array< / a >
2017-07-28 19:18:29 +00:00
### Example
2017-08-04 16:48:24 +00:00
< div > < fiddle-embed name = "9160aa6d1476bd87d927cfc8a4bf25e7" > < div > Bounds of upright < a href = "undocumented#Circle" > Circle< / a > can be predicted from center and radius.
2018-03-05 18:26:16 +00:00
Bounds of rotated < a href = "undocumented#Circle" > Circle< / a > includes control < a href = "SkPoint_Reference#Point" > Points< / a > outside of filled area.
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
empty bounds = 0, 0, 0, 0
circle bounds = 25, 20, 75, 70
rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_computeTightBounds" > computeTightBounds< / a > < a href = "#SkPath_updateBoundsCache" > updateBoundsCache< / a >
2017-07-28 19:18:29 +00:00
---
2018-02-06 14:41:53 +00:00
## <a name="Utility"></a> Utility
| name | description |
| --- | --- |
| < a href = "#SkPath_ConvertConicToQuads" > ConvertConicToQuads< / a > | approximates < a href = "#Conic" > Conic< / a > with < a href = "#Quad" > Quad< / a > array |
| < a href = "#SkPath_ConvertToNonInverseFillType" > ConvertToNonInverseFillType< / a > | returns < a href = "#Fill_Type" > Fill Type< / a > representing inside geometry |
| < a href = "#SkPath_dump_2" > dump< / a > | sends text representation using floats to standard output |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_dump" > dump(SkWStream* stream, bool forceClose, bool dumpAsHex)< / a > const |
| | < a href = "#SkPath_dump_2" > dump< / a > const |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_dumpHex" > dumpHex< / a > | sends text representation using hexadecimal to standard output |
| < a href = "#SkPath_getSegmentMasks" > getSegmentMasks< / a > | returns types in < a href = "#Verb_Array" > Verb Array< / a > |
| < a href = "#SkPath_incReserve" > incReserve< / a > | reserves space for additional data |
| < a href = "#SkPath_readFromMemory" > readFromMemory< / a > | Initializes from buffer |
| < a href = "#SkPath_serialize" > serialize< / a > | copies data to buffer |
| < a href = "#SkPath_setLastPt" > setLastPt< / a > | replaces < a href = "#Last_Point" > Last Point< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_setLastPt" > setLastPt(SkScalar x, SkScalar y)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_updateBoundsCache" > updateBoundsCache< / a > | refreshes result of < a href = "#SkPath_getBounds" > getBounds< / a > |
| < a href = "#SkPath_writeToMemory" > writeToMemory< / a > | copies data to buffer |
2017-08-25 17:14:33 +00:00
< a name = "SkPath_updateBoundsCache" > < / a >
2017-07-28 19:18:29 +00:00
## updateBoundsCache
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void updateBoundsCache() const
< / pre >
2017-08-25 15:51:49 +00:00
Update internal bounds so that subsequent calls to < a href = "#SkPath_getBounds" > getBounds< / a > are instantaneous.
Unaltered copies of < a href = "#Path" > Path< / a > may also access cached bounds through < a href = "#SkPath_getBounds" > getBounds< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
For now, identical to calling < a href = "#SkPath_getBounds" > getBounds< / a > and ignoring the returned value.
2017-07-28 19:18:29 +00:00
2018-01-04 21:11:51 +00:00
Call to prepare < a href = "#Path" > Path< / a > subsequently drawn from multiple threads,
2017-07-28 19:18:29 +00:00
to avoid a race condition where each draw separately computes the bounds.
### Example
< div > < fiddle-embed name = "bb761cd858e6d0ca05627262cd22ff5e" >
#### Example Output
~~~~
#Volatile
uncached avg: 0.18048 ms
cached avg: 0.182784 ms
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getBounds" > getBounds< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_computeTightBounds" > < / a >
2017-07-28 19:18:29 +00:00
## computeTightBounds
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
SkRect computeTightBounds() const
< / pre >
2017-08-25 15:51:49 +00:00
Returns minimum and maximum x and y values of the lines and curves in < a href = "#Path" > Path< / a > .
2018-01-26 17:56:22 +00:00
Returns (0, 0, 0, 0) if < a href = "#Path" > Path< / a > contains no points.
2018-01-04 21:11:51 +00:00
Returned bounds width and height may be larger or smaller than area affected
2017-08-25 15:51:49 +00:00
when < a href = "#Path" > Path< / a > is drawn.
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
Includes < a href = "SkPoint_Reference#Point" > Points< / a > associated with < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > that define empty
2017-08-29 21:36:51 +00:00
< a href = "#Contour" > Contours< / a > .
2017-07-28 19:18:29 +00:00
2018-01-26 17:56:22 +00:00
Behaves identically to < a href = "#SkPath_getBounds" > getBounds< / a > when < a href = "#Path" > Path< / a > contains
only lines. If < a href = "#Path" > Path< / a > contains curves, computed bounds includes
2017-08-29 21:36:51 +00:00
the 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 > ;
and unlike < a href = "#SkPath_getBounds" > getBounds< / a > , does not cache the result.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
tight bounds of curves in < a href = "#Path" > Path< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "da34f02e69ec98d5681300aea9a2d0bf" >
#### Example Output
~~~~
empty bounds = 0, 0, 0, 0
circle bounds = 25, 20, 75, 70
rotated circle bounds = 25, 20, 75, 70
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getBounds" > getBounds< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_conservativelyContainsRect" > < / a >
2017-07-28 19:18:29 +00:00
## conservativelyContainsRect
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool conservativelyContainsRect(const SkRect& rect) const
< / pre >
2018-01-04 21:11:51 +00:00
Returns true if < a href = "#SkPath_conservativelyContainsRect_rect" > rect< / a > is contained by < a href = "#Path" > Path< / a > .
2017-08-25 15:51:49 +00:00
May return false when < a href = "#SkPath_conservativelyContainsRect_rect" > rect< / a > is contained by < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
For now, only returns true if < a href = "#Path" > Path< / a > has one < a href = "#Contour" > Contour< / a > and is convex.
< a href = "#SkPath_conservativelyContainsRect_rect" > rect< / a > may share points and edges with < a href = "#Path" > Path< / a > and be contained.
2017-08-29 21:36:51 +00:00
Returns true if < a href = "#SkPath_conservativelyContainsRect_rect" > rect< / a > is empty, that is, it has zero width or height; and
2017-11-27 15:44:06 +00:00
the < 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_conservativelyContainsRect_rect" > < code > < strong > rect < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#SkPath_conservativelyContainsRect_rect" > rect< / a > is contained
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
### See Also
2017-10-04 18:31:33 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_incReserve" > < / a >
2017-07-28 19:18:29 +00:00
## incReserve
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void incReserve(unsigned extraPtCount)
< / pre >
2018-02-15 22:31:24 +00:00
grows < 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 = "SkPoint_Reference#Point" > Points< / a > .
2017-08-29 21:36:51 +00:00
May improve performance and use less memory by
2017-08-25 15:51:49 +00:00
reducing the number and size of allocations when creating < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_incReserve_extraPtCount" > < code > < strong > extraPtCount < / strong > < / code > < / a > < / td > < td >
2018-02-15 22:31:24 +00:00
number of additional < a href = "SkPoint_Reference#Point" > Points< / a > to allocate< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "f2260f2a170a54aef5bafe5b91c121b3" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#Point_Array" > Point Array< / a >
2017-07-28 19:18:29 +00:00
---
2018-02-06 14:41:53 +00:00
## <a name="Build"></a> Build
| name | description |
| --- | --- |
| < a href = "#SkPath_addArc" > addArc< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "#Arc" > Arc< / a > |
| < a href = "#SkPath_addCircle" > addCircle< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "undocumented#Circle" > Circle< / a > |
| < a href = "#SkPath_addOval" > addOval< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "undocumented#Oval" > Oval< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_addOval" > addOval(const SkRect& oval, Direction dir = kCW Direction)< / a > |
| | < a href = "#SkPath_addOval_2" > addOval(const SkRect& oval, Direction dir, unsigned start)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_addPath" > addPath< / a > | adds contents of < a href = "#Path" > Path< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_addPath" > addPath(const SkPath& src, SkScalar dx, SkScalar dy, AddPathMode mode = kAppend AddPathMode)< / a > |
| | < a href = "#SkPath_addPath_2" > addPath(const SkPath& src, AddPathMode mode = kAppend AddPathMode)< / a > |
| | < a href = "#SkPath_addPath_3" > addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend AddPathMode)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_addPoly" > addPoly< / a > | adds one < a href = "#Contour" > Contour< / a > containing connected lines |
| < a href = "#SkPath_addRRect" > addRRect< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "undocumented#Round_Rect" > Round Rect< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_addRRect" > addRRect(const SkRRect& rrect, Direction dir = kCW Direction)< / a > |
| | < a href = "#SkPath_addRRect_2" > addRRect(const SkRRect& rrect, Direction dir, unsigned start)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_addRect" > addRect< / a > | adds one < a href = "#Contour" > Contour< / a > containing < a href = "SkRect_Reference#Rect" > Rect< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_addRect" > addRect(const SkRect& rect, Direction dir = kCW Direction)< / a > |
| | < a href = "#SkPath_addRect_2" > addRect(const SkRect& rect, Direction dir, unsigned start)< / a > |
| | < a href = "#SkPath_addRect_3" > addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, Direction dir = kCW Direction)< / a > |
2018-02-06 14:41:53 +00:00
| < 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 |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_addRoundRect" > addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, Direction dir = kCW Direction)< / a > |
| | < a href = "#SkPath_addRoundRect_2" > addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW Direction)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_arcTo" > arcTo< / a > | appends < a href = "#Arc" > Arc< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_arcTo" > arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_close" > close< / a > | makes last < a href = "#Contour" > Contour< / a > a loop |
| < a href = "#SkPath_cubicTo" > cubicTo< / a > | appends < a href = "#Cubic" > Cubic< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_cubicTo" > cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_lineTo" > lineTo< / a > | appends < a href = "undocumented#Line" > Line< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_lineTo" > lineTo(SkScalar x, SkScalar y)< / a > |
| | < a href = "#SkPath_lineTo_2" > lineTo(const SkPoint& p)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_moveTo" > moveTo< / a > | starts < a href = "#Contour" > Contour< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_moveTo" > moveTo(SkScalar x, SkScalar y)< / a > |
| | < a href = "#SkPath_moveTo_2" > moveTo(const SkPoint& p)< / a > |
2018-02-06 14:41:53 +00:00
| < a href = "#SkPath_rArcTo" > rArcTo< / a > | appends < a href = "#Arc" > Arc< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rConicTo" > rConicTo< / a > | appends < a href = "#Conic" > Conic< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rCubicTo" > rCubicTo< / a > | appends < a href = "#Cubic" > Cubic< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rLineTo" > rLineTo< / a > | appends < a href = "undocumented#Line" > Line< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rMoveTo" > rMoveTo< / a > | starts < a href = "#Contour" > Contour< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_rQuadTo" > rQuadTo< / a > | appends < a href = "#Quad" > Quad< / a > relative to < a href = "#Last_Point" > Last Point< / a > |
| < a href = "#SkPath_reverseAddPath" > reverseAddPath< / a > | adds contents of < a href = "#Path" > Path< / a > back to front |
2017-08-25 17:14:33 +00:00
< a name = "SkPath_moveTo" > < / a >
2017-07-28 19:18:29 +00:00
## moveTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void moveTo(SkScalar x, SkScalar y)
< / pre >
2017-11-27 15:44:06 +00:00
Adds 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 > ).
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_moveTo_x" > < code > < strong > x < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_moveTo_x" > x< / a > -coordinate of < a href = "#Contour" > Contour< / a > start< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_moveTo_y" > < code > < strong > y < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_moveTo_y" > y< / a > -coordinate of < a href = "#Contour" > Contour< / a > start< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "84101d341e934a535a41ad6cf42218ce" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_moveTo_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void moveTo(const SkPoint& p)
< / pre >
2017-11-27 15:44:06 +00:00
Adds beginning of < a href = "#Contour" > Contour< / a > at < a href = "SkPoint_Reference#Point" > Point< / a > < a href = "#SkPath_moveTo_2_p" > p< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_moveTo_2_p" > < code > < strong > p < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
contour start< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "53b351d3fac667a4803418238e44a593" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_rMoveTo" > < / a >
2017-07-28 19:18:29 +00:00
## rMoveTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void rMoveTo(SkScalar dx, SkScalar dy)
< / pre >
2017-08-25 15:51:49 +00:00
Adds beginning of < a href = "#Contour" > Contour< / a > relative to < a href = "#Last_Point" > Last Point< / a > .
If < 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 > ).
2018-01-26 17:56:22 +00:00
Otherwise, 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 > ).
2017-09-01 19:51:02 +00:00
Function name stands for "relative move to".
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_rMoveTo_dx" > < code > < strong > dx < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Contour" > Contour< / a > start x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rMoveTo_dy" > < code > < strong > dy < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > y to < a href = "#Contour" > Contour< / a > start y< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "63e32dec4b2d8440b427f368bf8313a4" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_lineTo" > < / a >
2017-07-28 19:18:29 +00:00
## lineTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void lineTo(SkScalar x, SkScalar y)
< / pre >
2017-08-25 15:51:49 +00:00
Adds < a href = "undocumented#Line" > Line< / a > from < a href = "#Last_Point" > Last Point< / a > to (< a href = "#SkPath_lineTo_x" > x< / a > , < a href = "#SkPath_lineTo_y" > y< / a > ). If < a href = "#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) before adding < a href = "undocumented#Line" > Line< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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.
< 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_lineTo_x" > < code > < strong > x < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
end of added < a href = "undocumented#Line" > Line< / a > in < a href = "#SkPath_lineTo_x" > x< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_lineTo_y" > < code > < strong > y < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
end of added < a href = "undocumented#Line" > Line< / a > in < a href = "#SkPath_lineTo_y" > y< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "e311cdd451edacec33b50cc22a4dd5dc" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_lineTo_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void lineTo(const SkPoint& p)
< / pre >
2017-11-27 15:44:06 +00:00
Adds < 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
2017-08-25 15:51:49 +00:00
< 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 > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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.
2017-11-27 15:44:06 +00:00
< 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_lineTo_2_p" > < code > < strong > p < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of added < a href = "undocumented#Line" > Line< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "41001546a7f7927d08e5a818bcc304f5" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_rLineTo" > < / a >
2017-07-28 19:18:29 +00:00
## rLineTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void rLineTo(SkScalar dx, SkScalar dy)
< / pre >
2017-11-27 15:44:06 +00:00
Adds < a href = "undocumented#Line" > Line< / a > from < a href = "#Last_Point" > Last Point< / a > to < a href = "SkPoint_Reference#Vector" > Vector< / a > (< a href = "#SkPath_rLineTo_dx" > dx< / a > , < a href = "#SkPath_rLineTo_dy" > dy< / a > ). If < a href = "#Path" > Path< / a > is empty, or last < a href = "#SkPath_Verb" > Verb< / a > is
2017-08-25 15:51:49 +00:00
< 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 > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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;
then appends < a href = "#SkPath_kLine_Verb" > kLine Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > and < a href = "undocumented#Line" > Line< / a > end to < a href = "#Point_Array" > Point Array< / a > .
2017-11-27 15:44:06 +00:00
< 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 > ).
2017-09-01 19:51:02 +00:00
Function name stands for "relative line to".
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_rLineTo_dx" > < code > < strong > dx < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "undocumented#Line" > Line< / a > end x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rLineTo_dy" > < code > < strong > dy < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > y to < a href = "undocumented#Line" > Line< / a > end y< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "6e0be0766b8ca320da51640326e608b3" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-02-07 12:27:09 +00:00
## <a name="Quad"></a> Quad
2017-11-27 15:44:06 +00:00
< a href = "#Quad" > Quad< / a > describes a quadratic Bezier, a second-order curve identical to a section
of 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 > ,
and then curves to an end < a href = "SkPoint_Reference#Point" > Point< / a > .
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "78ad51fa1cd33eb84a6f99061e56e067" > < / fiddle-embed > < / div >
2017-08-25 15:51:49 +00:00
< 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.
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
< a href = "#Quad" > Quad< / a > is always contained by the triangle connecting its three < a href = "SkPoint_Reference#Point" > Points< / a > . < a href = "#Quad" > Quad< / a >
2017-11-27 15:44:06 +00:00
begins tangent to the line between start < a href = "SkPoint_Reference#Point" > Point< / a > and control < a href = "SkPoint_Reference#Point" > Point< / a > , and ends
tangent to the line between control < a href = "SkPoint_Reference#Point" > Point< / a > and end < a href = "SkPoint_Reference#Point" > Point< / a > .
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "4082f66a42df11bb20462b232b156bb6" > < / fiddle-embed > < / div >
2017-08-25 17:14:33 +00:00
< a name = "SkPath_quadTo" > < / a >
2017-07-28 19:18:29 +00:00
## quadTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
< / pre >
2018-01-04 21:11:51 +00:00
Adds < 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 > ).
2017-08-25 15:51:49 +00:00
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 (0, 0)
before adding < a href = "#Quad" > Quad< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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;
then appends < a href = "#SkPath_kQuad_Verb" > kQuad Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > ; and (< a href = "#SkPath_quadTo_x1" > x1< / a > , < a href = "#SkPath_quadTo_y1" > y1< / a > ), (< a href = "#SkPath_quadTo_x2" > x2< / a > , < a href = "#SkPath_quadTo_y2" > y2< / a > )
2017-08-25 15:51:49 +00:00
to < a href = "#Point_Array" > Point Array< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_quadTo_x1" > < code > < strong > x1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Quad" > Quad< / a > in x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_quadTo_y1" > < code > < strong > y1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Quad" > Quad< / a > in y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_quadTo_x2" > < code > < strong > x2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Quad" > Quad< / a > in x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_quadTo_y2" > < code > < strong > y2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Quad" > Quad< / a > in y< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "60ee3eb747474f5781b0f0dd3a17a866" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_quadTo_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void quadTo(const SkPoint& p1, const SkPoint& p2)
< / pre >
2018-01-04 21:11:51 +00:00
Adds < 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 > .
2017-08-25 15:51:49 +00:00
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 (0, 0)
before adding < a href = "#Quad" > Quad< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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;
2018-02-15 22:31:24 +00:00
then appends < a href = "#SkPath_kQuad_Verb" > kQuad Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > ; and < a href = "SkPoint_Reference#Point" > Points< / a > < a href = "#SkPath_quadTo_2_p1" > p1< / a > , < a href = "#SkPath_quadTo_2_p2" > p2< / a >
2017-08-25 15:51:49 +00:00
to < a href = "#Point_Array" > Point Array< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_quadTo_2_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > of added < a href = "#Quad" > Quad< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_quadTo_2_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of added < a href = "#Quad" > Quad< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "82621c4df8da1e589d9e627494067826" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_rQuadTo" > < / a >
2017-07-28 19:18:29 +00:00
## rQuadTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void rQuadTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2)
< / pre >
2017-11-27 15:44:06 +00:00
Adds < 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 > ).
2017-08-25 15:51:49 +00:00
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 (0, 0) before adding < a href = "#Quad" > Quad< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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; 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 >
2017-08-25 15:51:49 +00:00
control and < a href = "#Quad" > Quad< / a > end to < a href = "#Point_Array" > Point Array< / a > .
2017-11-27 15:44:06 +00:00
< 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 > ).
< 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 > ).
2017-09-01 19:51:02 +00:00
Function name stands for "relative quad to".
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_rQuadTo_dx1" > < code > < strong > dx1 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Quad" > Quad< / a > control x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rQuadTo_dy1" > < code > < strong > dy1 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Quad" > Quad< / a > control y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rQuadTo_dx2" > < code > < strong > dx2 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Quad" > Quad< / a > end x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rQuadTo_dy2" > < code > < strong > dy2 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Quad" > Quad< / a > end y< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "1c1f4cdef1c572c9aa8fdf3e461191d0" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-02-07 12:27:09 +00:00
## <a name="Conic"></a> Conic
2017-08-25 15:51:49 +00:00
< a href = "#Conic" > Conic< / a > describes a conical section: a piece of an ellipse, or a piece of a
2018-01-04 21:11:51 +00:00
parabola, or a piece of a hyperbola. < a href = "#Conic" > Conic< / a > begins at a start < a href = "SkPoint_Reference#Point" > Point< / a > ,
2017-11-27 15:44:06 +00:00
curves 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
of the control < a href = "SkPoint_Reference#Point" > Point< / a > is determined by < a href = "#Conic_Weight" > Conic Weight< / a > .
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
Each < a href = "#Conic" > Conic< / a > in < a href = "#Path" > Path< / a > adds two < a href = "SkPoint_Reference#Point" > Points< / a > and one < a href = "#Conic_Weight" > Conic Weight< / a > . < a href = "#Conic_Weight" > Conic Weights< / a > in < a href = "#Path" > Path< / a >
2017-08-29 21:36:51 +00:00
may be inspected with < a href = "#SkPath_Iter" > Iter< / a > , or with < a href = "#SkPath_RawIter" > RawIter< / a > .
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
## <a name="Conic_Weight"></a> Conic Weight
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< 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 > .
2017-08-25 15:51:49 +00:00
If < 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
2018-01-04 21:11:51 +00:00
parabolic segment.
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
move {0, 0},
quad {0, 0}, {20, 30}, {50, 60},
done
~~~~
< / fiddle-embed > < / div >
2017-08-25 15:51:49 +00:00
If weight is less than one, < a href = "#Conic" > Conic< / a > is an elliptical segment.
2017-07-28 19:18:29 +00:00
### Example
2018-03-05 18:26:16 +00:00
< div > < fiddle-embed name = "e88f554efacfa9f75f270fb1c0add5b4" > < div > A 90 degree circular arc has the weight1 / sqrt(2).
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
move {0, 0},
conic {0, 0}, {20, 0}, {20, 20}, weight = 0.707107
done
~~~~
< / fiddle-embed > < / div >
2017-09-01 19:51:02 +00:00
If weight is greater than one, < a href = "#Conic" > Conic< / a > is a hyperbolic segment. As weight gets large,
2017-07-28 19:18:29 +00:00
a hyperbolic segment can be approximated by straight lines connecting the
2018-02-15 22:31:24 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > with the end < a href = "SkPoint_Reference#Point" > Points< / a > .
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "6fb11419e99297fe2fe666c296117fb9" >
#### Example Output
~~~~
move {0, 0},
line {0, 0}, {20, 0},
line {20, 0}, {20, 20},
done
~~~~
< / fiddle-embed > < / div >
2017-08-25 17:14:33 +00:00
< a name = "SkPath_conicTo" > < / a >
2017-07-28 19:18:29 +00:00
## conicTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
< / pre >
2018-01-04 21:11:51 +00:00
Adds < 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 > .
2017-08-25 15:51:49 +00:00
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 (0, 0)
before adding < a href = "#Conic" > Conic< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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.
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_conicTo_w" > w< / a > is finite and not one, appends < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > ;
2018-02-15 22:31:24 +00:00
and (< a href = "#SkPath_conicTo_x1" > x1< / a > , < a href = "#SkPath_conicTo_y1" > y1< / a > ), (< a href = "#SkPath_conicTo_x2" > x2< / a > , < a href = "#SkPath_conicTo_y2" > y2< / a > ) to < a href = "#Point_Array" > Point Array< / a > ; and < a href = "#SkPath_conicTo_w" > w< / a > to < a href = "#Conic_Weight" > Conic Weights< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_conicTo_w" > w< / a > is one, appends < a href = "#SkPath_kQuad_Verb" > kQuad Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > , and
2017-08-25 15:51:49 +00:00
(< 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 > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_conicTo_w" > w< / a > is not finite, appends < a href = "#SkPath_kLine_Verb" > kLine Verb< / a > twice to < a href = "#Verb_Array" > Verb Array< / a > , and
2017-08-25 15:51:49 +00:00
(< 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_conicTo_x1" > < code > < strong > x1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Conic" > Conic< / a > in x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_conicTo_y1" > < code > < strong > y1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Conic" > Conic< / a > in y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_conicTo_x2" > < code > < strong > x2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Conic" > Conic< / a > in x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_conicTo_y2" > < code > < strong > y2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Conic" > Conic< / a > in y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_conicTo_w" > < code > < strong > w < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
weight of added < a href = "#Conic" > Conic< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2018-01-04 21:11:51 +00:00
< div > < fiddle-embed name = "358d9b6060b528b0923c007420f09c13" > < div > As weight increases, curve is pulled towards control point.
2017-07-28 19:18:29 +00:00
The bottom two curves are elliptical; the next is parabolic; the
2018-03-05 18:26:16 +00:00
top curve is hyperbolic.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_conicTo_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void conicTo(const SkPoint& p1, const SkPoint& p2, SkScalar w)
< / pre >
2018-01-04 21:11:51 +00:00
Adds < 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 > .
2017-08-25 15:51:49 +00:00
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 (0, 0)
before adding < a href = "#Conic" > Conic< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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.
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_conicTo_2_w" > w< / a > is finite and not one, appends < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > ;
2018-02-15 22:31:24 +00:00
and < a href = "SkPoint_Reference#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 = "#Conic_Weight" > Conic Weights< / a > .
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
If < a href = "#SkPath_conicTo_2_w" > w< / a > is one, appends < a href = "#SkPath_kQuad_Verb" > kQuad Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > , and < a href = "SkPoint_Reference#Point" > Points< / a > < a href = "#SkPath_conicTo_2_p1" > p1< / a > , < a href = "#SkPath_conicTo_2_p2" > p2< / a >
2017-08-25 15:51:49 +00:00
to < a href = "#Point_Array" > Point Array< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_conicTo_2_w" > w< / a > is not finite, appends < a href = "#SkPath_kLine_Verb" > kLine Verb< / a > twice to < a href = "#Verb_Array" > Verb Array< / a > , and
2018-02-15 22:31:24 +00:00
< a href = "SkPoint_Reference#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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_conicTo_2_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > of added < a href = "#Conic" > Conic< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_conicTo_2_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of added < a href = "#Conic" > Conic< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_conicTo_2_w" > < code > < strong > w < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
weight of added < a href = "#Conic" > Conic< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2017-08-25 15:51:49 +00:00
< div > < fiddle-embed name = "22d25e03b19d5bae92118877e462361b" > < div > < a href = "#Conic" > Conics< / a > and arcs use identical representations. As the arc sweep increases
2018-03-05 18:26:16 +00:00
the < a href = "#Conic_Weight" > Conic Weight< / a > also increases, but remains smaller than one.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_rConicTo" > < / a >
2017-07-28 19:18:29 +00:00
## rConicTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar w)
< / pre >
2017-11-27 15:44:06 +00:00
Adds < 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 > ),
2017-08-25 15:51:49 +00:00
weighted by < a href = "#SkPath_rConicTo_w" > w< / 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 (0, 0) before adding < a href = "#Conic" > Conic< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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 > ,
2018-01-04 21:11:51 +00:00
if needed.
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_rConicTo_w" > w< / a > is finite and not one, next appends < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > ,
and < a href = "#SkPath_rConicTo_w" > w< / a > is recorded as < a href = "#Conic_Weight" > Conic Weight< / a > ; otherwise, if < a href = "#SkPath_rConicTo_w" > w< / a > is one, appends
< 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 >
2017-08-25 15:51:49 +00:00
twice to < a href = "#Verb_Array" > Verb Array< / a > .
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
In all cases appends < a href = "SkPoint_Reference#Point" > Points< / a > control and end to < a href = "#Point_Array" > Point Array< / a > .
2017-11-27 15:44:06 +00:00
control is < a href = "#Last_Point" > Last Point< / a > plus < a href = "SkPoint_Reference#Vector" > Vector< / a > (< a href = "#SkPath_rConicTo_dx1" > dx1< / a > , < a href = "#SkPath_rConicTo_dy1" > dy1< / a > ).
end is < a href = "#Last_Point" > Last Point< / a > plus < a href = "SkPoint_Reference#Vector" > Vector< / a > (< a href = "#SkPath_rConicTo_dx2" > dx2< / a > , < a href = "#SkPath_rConicTo_dy2" > dy2< / a > ).
2017-07-28 19:18:29 +00:00
2017-09-01 19:51:02 +00:00
Function name stands for "relative conic to".
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_rConicTo_dx1" > < code > < strong > dx1 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Conic" > Conic< / a > control x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rConicTo_dy1" > < code > < strong > dy1 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Conic" > Conic< / a > control y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rConicTo_dx2" > < code > < strong > dx2 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Conic" > Conic< / a > end x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rConicTo_dy2" > < code > < strong > dy2 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Conic" > Conic< / a > end y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rConicTo_w" > < code > < strong > w < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
weight of added < a href = "#Conic" > Conic< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "3d52763e7c0e20c0b1d484a0afa622d2" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-02-07 12:27:09 +00:00
## <a name="Cubic"></a> Cubic
2018-01-04 21:11:51 +00:00
< a href = "#Cubic" > Cubic< / a > describes a Bezier_Curve segment described by a third-order polynomial.
2017-11-27 15:44:06 +00:00
< 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 > ;
and curves from the end < a href = "SkPoint_Reference#Point" > Point< / a > towards the second control < a href = "SkPoint_Reference#Point" > Point< / a > .
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "466445ed991d86de08587066392d654a" > < / fiddle-embed > < / div >
2017-08-25 17:14:33 +00:00
< a name = "SkPath_cubicTo" > < / a >
2017-07-28 19:18:29 +00:00
## cubicTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Adds < 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
(< 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
(0, 0) before adding < a href = "#Cubic" > Cubic< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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;
then appends < a href = "#SkPath_kCubic_Verb" > kCubic Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > ; and (< a href = "#SkPath_cubicTo_x1" > x1< / a > , < a href = "#SkPath_cubicTo_y1" > y1< / a > ), (< a href = "#SkPath_cubicTo_x2" > x2< / a > , < a href = "#SkPath_cubicTo_y2" > y2< / a > ), (< a href = "#SkPath_cubicTo_x3" > x3< / a > , < a href = "#SkPath_cubicTo_y3" > y3< / a > )
2017-08-25 15:51:49 +00:00
to < a href = "#Point_Array" > Point Array< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_cubicTo_x1" > < code > < strong > x1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
first control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > in x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_cubicTo_y1" > < code > < strong > y1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
first control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > in y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_cubicTo_x2" > < code > < strong > x2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
second control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > in x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_cubicTo_y2" > < code > < strong > y2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
second control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > in y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_cubicTo_x3" > < code > < strong > x3 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > in x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_cubicTo_y3" > < code > < strong > y3 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > in y< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "3e476378e3e0550ab134bbaf61112d98" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_cubicTo_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void cubicTo(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3)
< / pre >
2017-11-27 15:44:06 +00:00
Adds < 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
< 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
2017-08-25 15:51:49 +00:00
(0, 0) before adding < a href = "#Cubic" > Cubic< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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;
2018-02-15 22:31:24 +00:00
then appends < a href = "#SkPath_kCubic_Verb" > kCubic Verb< / a > to < a href = "#Verb_Array" > Verb Array< / a > ; and < a href = "SkPoint_Reference#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 >
2017-08-25 15:51:49 +00:00
to < a href = "#Point_Array" > Point Array< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_cubicTo_2_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
first control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_cubicTo_2_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
second control < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_cubicTo_2_p3" > < code > < strong > p3 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
end < a href = "SkPoint_Reference#Point" > Point< / a > of < a href = "#Cubic" > Cubic< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "d38aaf12c6ff5b8d901a2201bcee5476" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_rCubicTo" > < / a >
2017-07-28 19:18:29 +00:00
## rCubicTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void rCubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
2017-07-28 19:18:29 +00:00
< / pre >
2017-11-27 15:44:06 +00:00
Adds < 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
< a href = "SkPoint_Reference#Vector" > Vector< / a > (dx2, dy2), to < a href = "SkPoint_Reference#Vector" > Vector< / a > (dx3, dy3).
2017-08-25 15:51:49 +00:00
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 (0, 0) before adding < a href = "#Cubic" > Cubic< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
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; 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 >
2017-08-25 15:51:49 +00:00
control and < a href = "#Cubic" > Cubic< / a > end to < a href = "#Point_Array" > Point Array< / a > .
2017-11-27 15:44:06 +00:00
< a href = "#Cubic" > Cubic< / a > control is < a href = "#Last_Point" > Last Point< / a > plus < a href = "SkPoint_Reference#Vector" > Vector< / a > (dx1, dy1).
< a href = "#Cubic" > Cubic< / a > end is < a href = "#Last_Point" > Last Point< / a > plus < a href = "SkPoint_Reference#Vector" > Vector< / a > (dx2, dy2).
2017-09-01 19:51:02 +00:00
Function name stands for "relative cubic to".
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_rCubicTo_x1" > < code > < strong > x1 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to first < a href = "#Cubic" > Cubic< / a > control x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rCubicTo_y1" > < code > < strong > y1 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to first < a href = "#Cubic" > Cubic< / a > control y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rCubicTo_x2" > < code > < strong > x2 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to second < a href = "#Cubic" > Cubic< / a > control x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rCubicTo_y2" > < code > < strong > y2 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to second < a href = "#Cubic" > Cubic< / a > control y< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rCubicTo_x3" > < code > < strong > x3 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Cubic" > Cubic< / a > end x< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rCubicTo_y3" > < code > < strong > y3 < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset from < a href = "#Last_Point" > Last Point< / a > x to < a href = "#Cubic" > Cubic< / a > end y< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "19f0cfc7eeba8937fe19446ec0b5f932" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-02-01 14:37:32 +00:00
## <a name="Arc"></a> Arc
2017-08-25 15:51:49 +00:00
< 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,
2017-07-28 19:18:29 +00:00
by start point and end point, and by radius and tangent lines. Each construction has advantages,
2017-08-25 15:51:49 +00:00
and some constructions correspond to < a href = "#Arc" > Arc< / a > drawing in graphics standards.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
All < 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,
< 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 > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo" > arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)< / a >
describes < a href = "#Arc" > Arc< / a > as a piece of < a href = "undocumented#Oval" > Oval< / a > , beginning at start angle, sweeping clockwise or counterclockwise,
2018-01-04 21:11:51 +00:00
which may continue < a href = "#Contour" > Contour< / a > or start a new one. This construction is similar to < a href = "undocumented#PostScript" > PostScript< / a > and
2017-08-25 15:51:49 +00:00
< 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
requiring < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo_2" > arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)< / a >
describes < a href = "#Arc" > Arc< / a > as tangent to the line (x0, y0), (x1, y1) and tangent to the line (x1, y1), (x2, y2)
2017-11-27 15:44:06 +00:00
where (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
2017-08-04 16:48:24 +00:00
< a href = "undocumented#HTML_Canvas" > HTML Canvas< / a > arcs.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo_4" > arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep,
2018-01-04 21:11:51 +00:00
SkScalar x, SkScalar y)< / a >
2017-08-25 15:51:49 +00:00
describes < a href = "#Arc" > Arc< / a > as part of < a href = "undocumented#Oval" > Oval< / a > with radii (rx, ry), beginning at
2017-11-27 15:44:06 +00:00
last < 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,
2017-08-04 16:48:24 +00:00
so additional values choose a single solution. This construction is similar to < a href = "undocumented#SVG" > SVG< / a > arcs.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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 > .
< 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 >
2018-01-04 21:11:51 +00:00
constructions are converted to < a href = "#Conic" > Conic< / a > data when added to < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "891ac93abd0cdb27c4156685d3b1bb4c" > < div >
< table > < tr >
2017-08-25 15:51:49 +00:00
< td > < sup > 1< / sup > < a href = "#SkPath_arcTo" > arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)< / a > < / td > < / tr > < tr >
2017-07-28 19:18:29 +00:00
< td > < sup > 2< / sup > parameter sets force MoveTo< / td > < / tr > < tr >
2018-01-22 12:55:48 +00:00
< td > < sup > 3< / sup > start angle must be multiple of 90 degrees< / td > < / tr > < tr >
2017-08-25 15:51:49 +00:00
< td > < sup > 4< / sup > < a href = "#SkPath_arcTo_2" > arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)< / a > < / td > < / tr > < tr >
< td > < sup > 5< / sup > < a href = "#SkPath_arcTo_4" > arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc,
2017-07-28 19:18:29 +00:00
Direction sweep, SkScalar x, SkScalar y)< / a > < / td > < / tr >
< / table >
< / div > < / fiddle-embed > < / div >
### Example
< div > < fiddle-embed name = "5acc77eba0cb4d00bbf3a8f4db0c0aee" > < div > 1 describes an arc from an oval, a starting angle, and a sweep angle.
2 is similar to 1, but does not require building a path to draw.
2017-08-25 15:51:49 +00:00
3 is similar to 1, but always begins new < a href = "#Contour" > Contour< / a > .
2017-07-28 19:18:29 +00:00
4 describes an arc from a pair of tangent lines and a radius.
2017-11-27 15:44:06 +00:00
5 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 > .
2018-03-05 18:26:16 +00:00
6 describes an arc from a pair of tangent lines and a < a href = "#Conic_Weight" > Conic Weight< / a > .
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_arcTo" > < / a >
2017-07-28 19:18:29 +00:00
## arcTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Append < a href = "#Arc" > Arc< / a > to < a href = "#Path" > Path< / a > . < a href = "#Arc" > Arc< / a > added is part of ellipse
bounded by < a href = "#SkPath_arcTo_oval" > oval< / a > , from < a href = "#SkPath_arcTo_startAngle" > startAngle< / a > through < a href = "#SkPath_arcTo_sweepAngle" > sweepAngle< / a > . Both < a href = "#SkPath_arcTo_startAngle" > startAngle< / a > and
< a href = "#SkPath_arcTo_sweepAngle" > sweepAngle< / a > are measured in degrees, where zero degrees is aligned with the
positive x-axis, and positive sweeps extends < a href = "#Arc" > Arc< / a > clockwise.
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< 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 >
2017-08-25 15:51:49 +00:00
is false and < a href = "#Path" > Path< / a > is not empty. Otherwise, added < a href = "#Contour" > Contour< / a > begins with first point
of < a href = "#Arc" > Arc< / a > . Angles greater than -360 and less than 360 are treated modulo 360.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_arcTo_oval" > < code > < strong > oval < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds of ellipse containing < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_startAngle" > < code > < strong > startAngle < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
starting angle of < a href = "#Arc" > Arc< / a > in degrees< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_sweepAngle" > < code > < strong > sweepAngle < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
sweep, in degrees. Positive is clockwise; treated modulo 360< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_forceMoveTo" > < code > < strong > forceMoveTo < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
true to start a new contour with < a href = "#Arc" > Arc< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2017-08-25 15:51:49 +00:00
< 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 >
2018-03-05 18:26:16 +00:00
is not empty.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_addArc" > addArc< / a > < a href = "SkCanvas_Reference#SkCanvas_drawArc" > SkCanvas::drawArc< / a > < a href = "#SkPath_conicTo" > conicTo< / a > < sup > < a href = "#SkPath_conicTo_2" > [2]< / a > < / sup >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_arcTo_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)
< / pre >
2017-08-25 15:51:49 +00:00
Append < 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 >
weighted to describe part of < a href = "undocumented#Circle" > Circle< / a > . < a href = "#Arc" > Arc< / a > is contained by tangent from
last < 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 >
2018-01-04 21:11:51 +00:00
is part of < a href = "undocumented#Circle" > Circle< / a > sized to < a href = "#SkPath_arcTo_2_radius" > radius< / a > , positioned so it touches both tangent lines.
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "d9c6435f26f37b3d63c664a99028f77f" > < / fiddle-embed > < / div >
2017-11-27 15:44:06 +00:00
If 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 > .
The length of < a href = "SkPoint_Reference#Vector" > Vector< / a > from (< a href = "#SkPath_arcTo_2_x1" > x1< / a > , < a href = "#SkPath_arcTo_2_y1" > y1< / a > ) to (< a href = "#SkPath_arcTo_2_x2" > x2< / a > , < a href = "#SkPath_arcTo_2_y2" > y2< / a > ) does not affect < a href = "#Arc" > Arc< / a > .
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "01d2ddfd539ab86a86989e210640dffc" > < / fiddle-embed > < / div >
2017-08-25 15:51:49 +00:00
< 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
2017-11-27 15:44:06 +00:00
tangents 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 > ).
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > appends at most one < a href = "undocumented#Line" > Line< / a > and one < a href = "#Conic" > Conic< / a > .
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > implements the functionality of < a href = "undocumented#Arct" > PostScript Arct< / a > and < a href = "undocumented#ArcTo" > HTML Canvas ArcTo< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_arcTo_2_x1" > < code > < strong > x1 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
x common to pair of tangents< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_2_y1" > < code > < strong > y1 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
y common to pair of tangents< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_2_x2" > < code > < strong > x2 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
x end of second tangent< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_2_y2" > < code > < strong > y2 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
y end of second tangent< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_2_radius" > < code > < strong > radius < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
distance from < a href = "#Arc" > Arc< / a > to < a href = "undocumented#Circle" > Circle< / a > center< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
move to (156,20)
line (156,20),(79.2893,20)
conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683
~~~~
< / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< a href = "#SkPath_conicTo" > conicTo< / a > < sup > < a href = "#SkPath_conicTo_2" > [2]< / a > < / sup >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_arcTo_3" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius)
< / pre >
2017-08-25 15:51:49 +00:00
Append < 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 >
weighted to describe part of < a href = "undocumented#Circle" > Circle< / a > . < a href = "#Arc" > Arc< / a > is contained by tangent from
last < 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 >
2018-01-04 21:11:51 +00:00
is part of < a href = "undocumented#Circle" > Circle< / a > sized to < a href = "#SkPath_arcTo_3_radius" > radius< / a > , positioned so it touches both tangent lines.
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
If 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 > .
The length of < a href = "SkPoint_Reference#Vector" > Vector< / a > from < a href = "#SkPath_arcTo_3_p1" > p1< / a > to < a href = "#SkPath_arcTo_3_p2" > p2< / a > does not affect < a href = "#Arc" > Arc< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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
2017-11-27 15:44:06 +00:00
tangents 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 > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > appends at most one < a href = "undocumented#Line" > Line< / a > and one < a href = "#Conic" > Conic< / a > .
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > implements the functionality of < a href = "undocumented#Arct" > PostScript Arct< / a > and < a href = "undocumented#ArcTo" > HTML Canvas ArcTo< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_arcTo_3_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "SkPoint_Reference#Point" > Point< / a > common to pair of tangents< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_3_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
end of second tangent< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_3_radius" > < code > < strong > radius < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
distance from < a href = "#Arc" > Arc< / a > to < a href = "undocumented#Circle" > Circle< / a > center< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2017-11-27 15:44:06 +00:00
< 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
2018-03-05 18:26:16 +00:00
< a href = "#SkPath_arcTo_3_p1" > p1< / a > , but does not append a circular < a href = "#Conic" > Conic< / a > .
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
move to (156,20)
line (156,20),(200,20)
~~~~
< / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< a href = "#SkPath_conicTo" > conicTo< / a > < sup > < a href = "#SkPath_conicTo_2" > [2]< / a > < / sup >
2017-07-28 19:18:29 +00:00
---
2017-08-25 15:51:49 +00:00
## <a name="SkPath_ArcSize"></a> Enum SkPath::ArcSize
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-25 15:51:49 +00:00
enum < a href = "#SkPath_ArcSize" > ArcSize< / a > {
2018-01-04 21:11:51 +00:00
< a href = "#SkPath_kSmall_ArcSize" > kSmall ArcSize< / a > ,
< a href = "#SkPath_kLarge_ArcSize" > kLarge ArcSize< / a > ,
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
Four < 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).
2017-08-25 15:51:49 +00:00
< 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.
2017-07-28 19:18:29 +00:00
### Constants
< table >
< tr >
2017-10-26 11:58:48 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2017-10-26 11:58:48 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2017-08-25 15:51:49 +00:00
< 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.
2017-07-28 19:18:29 +00:00
Two routes are large, and two routes are counterclockwise. The one route both large
2018-03-05 18:26:16 +00:00
and counterclockwise is blue.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
< a name = "SkPath_arcTo_4" > < / a >
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep,
SkScalar x, SkScalar y)
2017-07-28 19:18:29 +00:00
< / pre >
2017-10-26 11:58:48 +00:00
Append < 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
describe part of < a href = "undocumented#Oval" > Oval< / a > with radii (< a href = "#SkPath_arcTo_4_rx" > rx< / a > , < a href = "#SkPath_arcTo_4_ry" > ry< / a > ) rotated by < a href = "#SkPath_arcTo_4_xAxisRotate" > xAxisRotate< / a > degrees. < a href = "#Arc" > Arc< / a >
2017-11-27 15:44:06 +00:00
curves 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:
2017-10-26 11:58:48 +00:00
clockwise or counterclockwise, and smaller or larger.
2017-07-28 19:18:29 +00:00
2017-10-26 11:58:48 +00:00
< 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
2017-11-27 15:44:06 +00:00
either 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
(< 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
2017-10-26 11:58:48 +00:00
too small.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > appends up to four < a href = "#Conic" > Conic< / a > curves.
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > implements the functionality of < a href = "undocumented#Arc" > SVG Arc< / a > , although < a href = "undocumented#SVG" > SVG< / a > "< a href = "#SkPath_arcTo_4_sweep" > sweep< / a > -flag" value
2017-11-27 15:44:06 +00:00
is 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,
2017-10-26 11:58:48 +00:00
while < a href = "#SkPath_kCW_Direction" > kCW Direction< / a > cast to int is zero.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_arcTo_4_rx" > < code > < strong > rx < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
radius in < a href = "#SkPath_arcTo_4_x" > x< / a > before < a href = "#SkPath_arcTo_4_x" > x< / a > -axis rotation< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_4_ry" > < code > < strong > ry < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
radius in < a href = "#SkPath_arcTo_4_y" > y< / a > before < a href = "#SkPath_arcTo_4_x" > x< / a > -axis rotation< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_4_xAxisRotate" > < code > < strong > xAxisRotate < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_arcTo_4_x" > x< / a > -axis rotation in degrees; positive values are clockwise< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_4_largeArc" > < code > < strong > largeArc < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
chooses smaller or larger < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_4_sweep" > < code > < strong > sweep < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
chooses clockwise or counterclockwise < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_4_x" > < code > < strong > x < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
end of < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_4_y" > < code > < strong > y < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
end of < a href = "#Arc" > Arc< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "6b6ea44f659b27918f3a6fa621bf6173" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_rArcTo" > rArcTo< / a > < a href = "#SkPath_ArcSize" > ArcSize< / a > < a href = "#SkPath_Direction" > Direction< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_arcTo_5" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void arcTo(const SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, const SkPoint xy)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Append < 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 >
2017-11-27 15:44:06 +00:00
with 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
2017-08-25 15:51:49 +00:00
(< 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,
2017-07-28 19:18:29 +00:00
and smaller or larger.
2017-08-25 15:51:49 +00:00
< 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,
2017-11-27 15:44:06 +00:00
or 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
2017-09-01 19:51:02 +00:00
< a href = "#SkPath_arcTo_5_xy" > xy< / a > if both are greater than zero but too small to describe an arc.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > appends up to four < a href = "#Conic" > Conic< / a > curves.
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > implements the functionality of < a href = "undocumented#Arc" > SVG Arc< / a > , although < a href = "undocumented#SVG" > SVG< / a > "< a href = "#SkPath_arcTo_5_sweep" > sweep< / a > -flag" value is
2017-11-27 15:44:06 +00:00
opposite 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
2017-09-01 19:51:02 +00:00
< a href = "#SkPath_kCW_Direction" > kCW Direction< / a > cast to int is zero.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_arcTo_5_r" > < code > < strong > r < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
radii in x and y before x-axis rotation< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_5_xAxisRotate" > < code > < strong > xAxisRotate < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
x-axis rotation in degrees; positive values are clockwise< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_5_largeArc" > < code > < strong > largeArc < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
chooses smaller or larger < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_5_sweep" > < code > < strong > sweep < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
chooses clockwise or counterclockwise < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_arcTo_5_xy" > < code > < strong > xy < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
end of < a href = "#Arc" > Arc< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "3f76a1007416181a4848c1a87fc81dbd" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_rArcTo" > rArcTo< / a > < a href = "#SkPath_ArcSize" > ArcSize< / a > < a href = "#SkPath_Direction" > Direction< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_rArcTo" > < / a >
2017-07-28 19:18:29 +00:00
## rArcTo
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep,
SkScalar dx, SkScalar dy)
2017-07-28 19:18:29 +00:00
< / pre >
2018-01-04 21:11:51 +00:00
Append < 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
2017-09-01 19:51:02 +00:00
more < 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
2017-11-27 15:44:06 +00:00
< 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 > :
2017-10-26 11:58:48 +00:00
2018-03-05 18:26:16 +00:00
(x0 + < a href = "#SkPath_rArcTo_dx" > dx< / a > , y0 + < a href = "#SkPath_rArcTo_dy" > dy< / a > )
,
2017-08-29 21:36:51 +00:00
choosing one of four possible routes: clockwise or
2017-11-27 15:44:06 +00:00
counterclockwise, 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 >
2017-07-28 19:18:29 +00:00
is (0, 0).
2017-11-27 15:44:06 +00:00
< 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 >
if 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 > .
< 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
2017-09-01 19:51:02 +00:00
greater than zero but too small to describe an arc.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > appends up to four < a href = "#Conic" > Conic< / a > curves.
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_arcTo" > arcTo< / a > implements the functionality of < a href = "undocumented#Arc" > SVG Arc< / a > , although < a href = "undocumented#SVG" > SVG< / a > "< a href = "#SkPath_rArcTo_sweep" > sweep< / a > -flag" value is
2017-11-27 15:44:06 +00:00
opposite 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
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_kCW_Direction" > kCW Direction< / a > cast to int is zero.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_rArcTo_rx" > < code > < strong > rx < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
radius in x before x-axis rotation< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rArcTo_ry" > < code > < strong > ry < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
radius in y before x-axis rotation< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rArcTo_xAxisRotate" > < code > < strong > xAxisRotate < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
x-axis rotation in degrees; positive values are clockwise< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rArcTo_largeArc" > < code > < strong > largeArc < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
chooses smaller or larger < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rArcTo_sweep" > < code > < strong > sweep < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
chooses clockwise or counterclockwise < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rArcTo_dx" > < code > < strong > dx < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
x offset end of < a href = "#Arc" > Arc< / a > from last < a href = "#Path" > Path< / a > < a href = "SkPoint_Reference#Point" > Point< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_rArcTo_dy" > < code > < strong > dy < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
y offset end of < a href = "#Arc" > Arc< / a > from last < a href = "#Path" > Path< / a > < a href = "SkPoint_Reference#Point" > Point< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "3f76a1007416181a4848c1a87fc81dbd" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_close" > < / a >
2017-07-28 19:18:29 +00:00
## close
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void close()
< / pre >
2017-11-27 15:44:06 +00:00
Append < 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 >
2017-09-01 19:51:02 +00:00
with < a href = "undocumented#Line" > Line< / a > , forming a continuous loop. Open and closed < a href = "#Contour" > Contour< / a > draw the same
2018-02-15 22:31:24 +00:00
with < a href = "SkPaint_Reference#SkPaint_kFill_Style" > SkPaint::kFill Style< / a > . With < a href = "SkPaint_Reference#SkPaint_kStroke_Style" > SkPaint::kStroke Style< / a > , open < a href = "#Contour" > Contour< / a > draws
< a href = "SkPaint_Reference#Stroke_Cap" > Paint Stroke Cap< / a > at < a href = "#Contour" > Contour< / a > start and end; closed < a href = "#Contour" > Contour< / a > draws
< a href = "SkPaint_Reference#Stroke_Join" > Paint Stroke Join< / a > at < a href = "#Contour" > Contour< / a > start and end.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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 > .
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "9235f6309271d6420fa5c45dc28664c5" > < / fiddle-embed > < / div >
### See Also
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_IsInverseFillType" > < / a >
2017-07-28 19:18:29 +00:00
## IsInverseFillType
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
static bool IsInverseFillType(FillType fill)
< / pre >
2017-08-25 15:51:49 +00:00
Returns 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
2017-07-28 19:18:29 +00:00
of its geometric bounds.
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_FillType" > FillType< / a > | is inverse |
2017-07-28 19:18:29 +00:00
| --- | --- |
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > | false |
| < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > | false |
| < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > | true |
| < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > | true |
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_IsInverseFillType_fill" > < code > < strong > fill < / strong > < / code > < / a > < / td > < td >
one of: < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > , < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > ,
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > , < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#Path" > Path< / a > fills outside its bounds
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "1453856a9d0c73e8192bf298c4143563" >
#### Example Output
~~~~
IsInverseFillType(kWinding_FillType) == false
IsInverseFillType(kEvenOdd_FillType) == false
IsInverseFillType(kInverseWinding_FillType) == true
IsInverseFillType(kInverseEvenOdd_FillType) == true
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_FillType" > FillType< / a > < a href = "#SkPath_getFillType" > getFillType< / a > < a href = "#SkPath_setFillType" > setFillType< / a > < a href = "#SkPath_ConvertToNonInverseFillType" > ConvertToNonInverseFillType< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_ConvertToNonInverseFillType" > < / a >
2017-07-28 19:18:29 +00:00
## ConvertToNonInverseFillType
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
static FillType ConvertToNonInverseFillType(FillType fill)
< / pre >
2017-08-25 15:51:49 +00:00
Returns equivalent < a href = "#Fill_Type" > Fill Type< / a > representing < a href = "#Path" > Path< / a > < a href = "#SkPath_ConvertToNonInverseFillType_fill" > fill< / a > inside its bounds.
2017-07-28 19:18:29 +00:00
.
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_FillType" > FillType< / a > | inside < a href = "#SkPath_FillType" > FillType< / a > |
2017-07-28 19:18:29 +00:00
| --- | --- |
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > | < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > |
| < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > | < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > |
| < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > | < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > |
| < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > | < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > |
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_ConvertToNonInverseFillType_fill" > < code > < strong > fill < / strong > < / code > < / a > < / td > < td >
one of: < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > , < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > ,
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > , < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
< 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
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "adfae398bbe9e37495f8220ad544c8f8" >
#### Example Output
~~~~
ConvertToNonInverseFillType(kWinding_FillType) == kWinding_FillType
ConvertToNonInverseFillType(kEvenOdd_FillType) == kEvenOdd_FillType
ConvertToNonInverseFillType(kInverseWinding_FillType) == kWinding_FillType
ConvertToNonInverseFillType(kInverseEvenOdd_FillType) == kEvenOdd_FillType
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_FillType" > FillType< / a > < a href = "#SkPath_getFillType" > getFillType< / a > < a href = "#SkPath_setFillType" > setFillType< / a > < a href = "#SkPath_IsInverseFillType" > IsInverseFillType< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_ConvertConicToQuads" > < / a >
2017-07-28 19:18:29 +00:00
## ConvertConicToQuads
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
static int ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w,
SkPoint pts[], int pow2)
2017-07-28 19:18:29 +00:00
< / pre >
2017-11-27 15:44:06 +00:00
Approximates < 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 > ,
2018-01-04 21:11:51 +00:00
control < a href = "SkPoint_Reference#Point" > Point< / a > < a href = "#SkPath_ConvertConicToQuads_p1" > p1< / a > , end < a href = "SkPoint_Reference#Point" > Point< / a > < a href = "#SkPath_ConvertConicToQuads_p2" > p2< / a > , and weight < a href = "#SkPath_ConvertConicToQuads_w" > w< / a > .
2017-08-25 15:51:49 +00:00
< a href = "#Quad" > Quad< / a > array is stored in < a href = "#SkPath_ConvertConicToQuads_pts" > pts< / a > ; this storage is supplied by caller.
Maximum < a href = "#Quad" > Quad< / a > count is 2 to the < a href = "#SkPath_ConvertConicToQuads_pow2" > pow2< / a > .
2018-01-04 21:11:51 +00:00
Every 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
next < a href = "#Quad" > Quad< / a > . Maximum < a href = "#SkPath_ConvertConicToQuads_pts" > pts< / a > storage size is given by:
2017-10-26 11:58:48 +00:00
(1 + 2 * (1 << <a href="#SkPath_ConvertConicToQuads_pow2">pow2</a>)) * sizeof(SkPoint).
Returns < a href = "#Quad" > Quad< / a > count used the approximation, which may be smaller
2017-07-28 19:18:29 +00:00
than the number requested.
2017-08-25 15:51:49 +00:00
< a href = "#Conic_Weight" > Conic Weight< / a > determines the amount of influence < a href = "#Conic" > Conic< / a > control point has on the curve.
< 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
a hyperbolic section. < a href = "#SkPath_ConvertConicToQuads_w" > w< / a > equal to one represents a parabolic section.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
Two < a href = "#Quad" > Quad< / a > curves are sufficient to approximate an elliptical < a href = "#Conic" > Conic< / a > with a sweep
of up to 90 degrees; in this case, set < a href = "#SkPath_ConvertConicToQuads_pow2" > pow2< / a > to one.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_ConvertConicToQuads_p0" > < code > < strong > p0 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#Conic" > Conic< / a > start < a href = "SkPoint_Reference#Point" > Point< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_ConvertConicToQuads_p1" > < code > < strong > p1 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#Conic" > Conic< / a > control < a href = "SkPoint_Reference#Point" > Point< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_ConvertConicToQuads_p2" > < code > < strong > p2 < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#Conic" > Conic< / a > end < a href = "SkPoint_Reference#Point" > Point< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_ConvertConicToQuads_w" > < code > < strong > w < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Conic" > Conic< / a > weight< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_ConvertConicToQuads_pts" > < code > < strong > pts < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
storage for < a href = "#Quad" > Quad< / a > array< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_ConvertConicToQuads_pow2" > < code > < strong > pow2 < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#Quad" > Quad< / a > count, as power of two, normally 0 to 5 (1 to 32 < a href = "#Quad" > Quad< / a > curves)< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-30 12:58:10 +00:00
number of < a href = "#Quad" > Quad< / a > curves written to < a href = "#SkPath_ConvertConicToQuads_pts" > pts< / a >
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< 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.
2017-07-28 19:18:29 +00:00
The middle curve is nearly circular. The top-right curve is parabolic, which can
2018-03-05 18:26:16 +00:00
be drawn exactly with a single < a href = "#Quad" > Quad< / a > .
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#Conic" > Conic< / a > < a href = "#Quad" > Quad< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isRect" > < / a >
2017-07-28 19:18:29 +00:00
## isRect
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
bool isRect(SkRect* rect, bool* isClosed = nullptr, Direction* direction = nullptr) const
2017-07-28 19:18:29 +00:00
< / pre >
2017-10-04 18:31:33 +00:00
Returns true if < a href = "#Path" > Path< / a > is equivalent to < a href = "SkRect_Reference#Rect" > Rect< / a > when filled.
2017-08-29 21:36:51 +00:00
If false: < a href = "#SkPath_isRect_rect" > rect< / a > , < a href = "#SkPath_isRect_isClosed" > isClosed< / a > , and < a href = "#SkPath_isRect_direction" > direction< / a > are unchanged.
If true: < a href = "#SkPath_isRect_rect" > rect< / a > , < a href = "#SkPath_isRect_isClosed" > isClosed< / a > , and < a href = "#SkPath_isRect_direction" > direction< / a > are written to if not nullptr.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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
that do not alter the area drawn by the returned < a href = "#SkPath_isRect_rect" > rect< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_isRect_rect" > < code > < strong > rect < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
storage for bounds of < a href = "SkRect_Reference#Rect" > Rect< / a > ; may be nullptr< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_isRect_isClosed" > < code > < strong > isClosed < / strong > < / code > < / a > < / td > < td >
storage set to true if < a href = "#Path" > Path< / a > is closed; may be nullptr< / td >
< / tr > < tr > < td > < a name = "SkPath_isRect_direction" > < code > < strong > direction < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
storage set to < a href = "SkRect_Reference#Rect" > Rect< / a > < a href = "#SkPath_isRect_direction" > direction< / a > ; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-01-26 17:56:22 +00:00
true if < a href = "#Path" > Path< / a > contains < a href = "SkRect_Reference#Rect" > Rect< / a >
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< 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
following < a href = "#SkPath_lineTo" > lineTo< / a > does not. < a href = "#SkPath_addPoly" > addPoly< / a > returns true even though < a href = "#SkPath_isRect_rect" > rect< / a > is not closed, and one
2018-03-05 18:26:16 +00:00
side of < a href = "#SkPath_isRect_rect" > rect< / a > is made up of consecutive line segments.
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
empty is not rect
addRect is rect (10, 20, 30, 40); is closed; direction CW
moveTo is rect (10, 20, 30, 40); is closed; direction CW
lineTo is not rect
addPoly is rect (0, 0, 80, 80); is not closed; direction CCW
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_isNestedFillRects" > < / a >
2017-07-28 19:18:29 +00:00
## isNestedFillRects
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-29 21:36:51 +00:00
bool isNestedFillRects(SkRect rect[2], Direction dirs[2] = nullptr) const
2017-07-28 19:18:29 +00:00
< / pre >
2017-10-04 18:31:33 +00:00
Returns true if < a href = "#Path" > Path< / a > is equivalent to nested < a href = "SkRect_Reference#Rect" > Rect< / a > pair when filled.
2017-08-29 21:36:51 +00:00
If false, < a href = "#SkPath_isNestedFillRects_rect" > rect< / a > and < a href = "#SkPath_isNestedFillRects_dirs" > dirs< / a > are unchanged.
If true, < a href = "#SkPath_isNestedFillRects_rect" > rect< / a > and < a href = "#SkPath_isNestedFillRects_dirs" > dirs< / a > are written to if not nullptr:
2017-10-04 18:31:33 +00:00
setting < 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 > ;
setting < 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
< a href = "SkRect_Reference#Rect" > Rect< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_isNestedFillRects_rect" > < code > < strong > rect < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
storage for < a href = "SkRect_Reference#Rect" > Rect< / a > pair; may be nullptr< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_isNestedFillRects_dirs" > < code > < strong > dirs < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
storage for < a href = "#SkPath_Direction" > Direction< / a > pair; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-01-26 17:56:22 +00:00
true if < a href = "#Path" > Path< / a > contains nested < a href = "SkRect_Reference#Rect" > Rect< / a > pair
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "77e4394caf9fa083c19c21c2462efe14" >
#### Example Output
~~~~
outer (7.5, 17.5, 32.5, 42.5); direction CW
inner (12.5, 22.5, 27.5, 37.5); direction CCW
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addRect" > < / a >
2017-07-28 19:18:29 +00:00
## addRect
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addRect(const SkRect& rect, Direction dir = kCW_Direction)
< / pre >
2017-10-04 18:31:33 +00:00
Add < 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 > ,
starting with top-left corner of < a href = "SkRect_Reference#Rect" > Rect< / a > ; followed by top-right, bottom-right,
2017-08-25 15:51:49 +00:00
and bottom-left if < a href = "#SkPath_addRect_dir" > dir< / a > is < a href = "#SkPath_kCW_Direction" > kCW Direction< / a > ; or followed by bottom-left,
bottom-right, and top-right if < a href = "#SkPath_addRect_dir" > dir< / a > is < a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addRect_rect" > < code > < strong > rect < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
< a href = "SkRect_Reference#Rect" > Rect< / a > to add as a closed contour< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRect_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind added contour< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2017-10-04 18:31:33 +00:00
< 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.
2018-03-05 18:26:16 +00:00
The right < a href = "SkRect_Reference#Rect" > Rect< / a > dashes starting at the top-left corner, towards the bottom.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkCanvas_Reference#SkCanvas_drawRect" > SkCanvas::drawRect< / a > < a href = "#SkPath_Direction" > Direction< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_addRect_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addRect(const SkRect& rect, Direction dir, unsigned start)
< / pre >
2017-10-04 18:31:33 +00:00
Add < 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 > .
If < a href = "#SkPath_addRect_2_dir" > dir< / a > is < a href = "#SkPath_kCW_Direction" > kCW Direction< / a > , < a href = "SkRect_Reference#Rect" > Rect< / a > corners are added clockwise; if < a href = "#SkPath_addRect_2_dir" > dir< / a > is
< a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > , < a href = "SkRect_Reference#Rect" > Rect< / a > corners are added counterclockwise.
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_addRect_2_start" > start< / a > determines the first corner added.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_addRect_2_start" > start< / a > | first corner |
2017-07-28 19:18:29 +00:00
| --- | --- |
| 0 | top-left |
| 1 | top-right |
| 2 | bottom-right |
| 3 | bottom-left |
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addRect_2_rect" > < code > < strong > rect < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
< a href = "SkRect_Reference#Rect" > Rect< / a > to add as a closed contour< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRect_2_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind added contour< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRect_2_start" > < code > < strong > start < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
initial corner of < a href = "SkRect_Reference#Rect" > Rect< / a > to add< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "9202430b3f4f5275af8eec5cc9d7baa8" > < div > The arrow is just after the initial corner and points towards the next
2018-03-05 18:26:16 +00:00
corner appended to < a href = "#Path" > Path< / a > .
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkCanvas_Reference#SkCanvas_drawRect" > SkCanvas::drawRect< / a > < a href = "#SkPath_Direction" > Direction< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_addRect_3" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom,
Direction dir = kCW_Direction)
< / pre >
2017-10-04 18:31:33 +00:00
Add < 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 > ,
2017-08-25 15:51:49 +00:00
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 > ,
2017-11-27 15:44:06 +00:00
starting 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 > ,
and < 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 > ,
< 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addRect_3_left" > < code > < strong > left < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
smaller x of < a href = "SkRect_Reference#Rect" > Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRect_3_top" > < code > < strong > top < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
smaller y of < a href = "SkRect_Reference#Rect" > Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRect_3_right" > < code > < strong > right < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
larger x of < a href = "SkRect_Reference#Rect" > Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRect_3_bottom" > < code > < strong > bottom < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
larger y of < a href = "SkRect_Reference#Rect" > Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRect_3_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind added contour< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2017-11-27 15:44:06 +00:00
< 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 > .
2018-03-05 18:26:16 +00:00
The < 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 >
2017-07-28 19:18:29 +00:00
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkCanvas_Reference#SkCanvas_drawRect" > SkCanvas::drawRect< / a > < a href = "#SkPath_Direction" > Direction< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addOval" > < / a >
2017-07-28 19:18:29 +00:00
## addOval
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addOval(const SkRect& oval, Direction dir = kCW_Direction)
< / pre >
2017-08-25 15:51:49 +00:00
Add < 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 > .
2017-10-04 18:31:33 +00:00
< 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
2017-08-25 15:51:49 +00:00
and half < a href = "#SkPath_addOval_oval" > oval< / a > height. < a href = "undocumented#Oval" > Oval< / a > begins at (< a href = "#SkPath_addOval_oval" > oval< / a > .fRight, < a href = "#SkPath_addOval_oval" > oval< / a > .centerY()) and continues
clockwise if < a href = "#SkPath_addOval_dir" > dir< / a > is < a href = "#SkPath_kCW_Direction" > kCW Direction< / a > , counterclockwise if < a href = "#SkPath_addOval_dir" > dir< / a > is < a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > .
2017-07-28 19:18:29 +00:00
This form is identical to
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addOval_oval" > < code > < strong > oval < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds of ellipse added< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addOval_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind ellipse< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "cac84cf68e63a453c2a8b64c91537704" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkCanvas_Reference#SkCanvas_drawOval" > SkCanvas::drawOval< / a > < a href = "#SkPath_Direction" > Direction< / a > < a href = "undocumented#Oval" > Oval< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_addOval_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addOval(const SkRect& oval, Direction dir, unsigned start)
< / pre >
2017-08-25 15:51:49 +00:00
Add < 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 > .
2017-10-04 18:31:33 +00:00
< 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
2017-08-25 15:51:49 +00:00
and half < a href = "#SkPath_addOval_2_oval" > oval< / a > height. < a href = "undocumented#Oval" > Oval< / a > begins at < a href = "#SkPath_addOval_2_start" > start< / a > and continues
clockwise if < a href = "#SkPath_addOval_2_dir" > dir< / a > is < a href = "#SkPath_kCW_Direction" > kCW Direction< / a > , counterclockwise if < a href = "#SkPath_addOval_2_dir" > dir< / a > is < a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > .
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
| < a href = "#SkPath_addOval_2_start" > start< / a > | < a href = "SkPoint_Reference#Point" > Point< / a > |
2017-07-28 19:18:29 +00:00
| --- | --- |
2017-08-25 15:51:49 +00:00
| 0 | < a href = "#SkPath_addOval_2_oval" > oval< / a > .centerX(), < a href = "#SkPath_addOval_2_oval" > oval< / a > .fTop |
| 1 | < a href = "#SkPath_addOval_2_oval" > oval< / a > .fRight, < a href = "#SkPath_addOval_2_oval" > oval< / a > .centerY() |
| 2 | < a href = "#SkPath_addOval_2_oval" > oval< / a > .centerX(), < a href = "#SkPath_addOval_2_oval" > oval< / a > .fBottom |
| 3 | < a href = "#SkPath_addOval_2_oval" > oval< / a > .fLeft, < a href = "#SkPath_addOval_2_oval" > oval< / a > .centerY() |
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addOval_2_oval" > < code > < strong > oval < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds of ellipse added< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addOval_2_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind ellipse< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addOval_2_start" > < code > < strong > start < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
index of initial point of ellipse< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "ab9753174060e4a551727ef3af12924d" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkCanvas_Reference#SkCanvas_drawOval" > SkCanvas::drawOval< / a > < a href = "#SkPath_Direction" > Direction< / a > < a href = "undocumented#Oval" > Oval< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addCircle" > < / a >
2017-07-28 19:18:29 +00:00
## addCircle
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void addCircle(SkScalar x, SkScalar y, SkScalar radius, Direction dir = kCW_Direction)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Add < 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 > ,
2018-01-04 21:11:51 +00:00
four < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > , and < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > . < a href = "undocumented#Circle" > Circle< / a > begins at:
2018-03-05 18:26:16 +00:00
(< a href = "#SkPath_addCircle_x" > x< / a > + < a href = "#SkPath_addCircle_radius" > radius< / a > , < a href = "#SkPath_addCircle_y" > y< / a > )
,
2017-10-26 11:58:48 +00:00
continuing
clockwise if < a href = "#SkPath_addCircle_dir" > dir< / a > is < a href = "#SkPath_kCW_Direction" > kCW Direction< / a > , and counterclockwise if < a href = "#SkPath_addCircle_dir" > dir< / a > is < a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > .
2017-07-28 19:18:29 +00:00
2017-09-21 16:31:06 +00:00
Has no effect if < a href = "#SkPath_addCircle_radius" > radius< / a > is zero or negative.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addCircle_x" > < code > < strong > x < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
center of < a href = "undocumented#Circle" > Circle< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addCircle_y" > < code > < strong > y < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
center of < a href = "undocumented#Circle" > Circle< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addCircle_radius" > < code > < strong > radius < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
distance from center to edge< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addCircle_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind < a href = "undocumented#Circle" > Circle< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "bd5286cb9a5e5c32cd980f72b8f400fb" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkCanvas_Reference#SkCanvas_drawCircle" > SkCanvas::drawCircle< / a > < sup > < a href = "SkCanvas_Reference#SkCanvas_drawCircle_2" > [2]< / a > < / sup > < a href = "#SkPath_Direction" > Direction< / a > < a href = "undocumented#Circle" > Circle< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addArc" > < / a >
2017-07-28 19:18:29 +00:00
## addArc
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle)
< / pre >
2017-08-25 15:51:49 +00:00
Append < 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
bounded by < a href = "#SkPath_addArc_oval" > oval< / a > , from < a href = "#SkPath_addArc_startAngle" > startAngle< / a > through < a href = "#SkPath_addArc_sweepAngle" > sweepAngle< / a > . Both < a href = "#SkPath_addArc_startAngle" > startAngle< / a > and
< a href = "#SkPath_addArc_sweepAngle" > sweepAngle< / a > are measured in degrees, where zero degrees is aligned with the
positive x-axis, and positive sweeps extends < a href = "#Arc" > Arc< / a > clockwise.
2017-07-28 19:18:29 +00:00
2018-01-04 21:11:51 +00:00
If < a href = "#SkPath_addArc_sweepAngle" > sweepAngle< / a > < = -360, or < a href = "#SkPath_addArc_sweepAngle" > sweepAngle< / a > >= 360; and < a href = "#SkPath_addArc_startAngle" > startAngle< / a > modulo 90 is nearly
zero, 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
2017-08-25 15:51:49 +00:00
modulo 360, and < a href = "#Arc" > Arc< / a > may or may not draw depending on numeric rounding.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addArc_oval" > < code > < strong > oval < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds of ellipse containing < a href = "#Arc" > Arc< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addArc_startAngle" > < code > < strong > startAngle < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
starting angle of < a href = "#Arc" > Arc< / a > in degrees< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addArc_sweepAngle" > < code > < strong > sweepAngle < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
sweep, in degrees. Positive is clockwise; treated modulo 360< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "9cf5122475624e4cf39f06c698f80b1a" > < div > The middle row of the left and right columns draw differently from the entries
2018-01-04 21:11:51 +00:00
above and below because < a href = "#SkPath_addArc_sweepAngle" > sweepAngle< / a > is outside of the range of +/-360,
2018-03-05 18:26:16 +00:00
and < a href = "#SkPath_addArc_startAngle" > startAngle< / a > modulo 90 is not zero.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-02-15 22:31:24 +00:00
< 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_Reference#SkCanvas_drawArc" > SkCanvas::drawArc< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addRoundRect" > < / a >
2017-07-28 19:18:29 +00:00
## addRoundRect
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, Direction dir = kCW_Direction)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Append < 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
equal to < a href = "#SkPath_addRoundRect_rect" > rect< / a > ; each corner is 90 degrees of an ellipse with radii (< a href = "#SkPath_addRoundRect_rx" > rx< / a > , < a href = "#SkPath_addRoundRect_ry" > ry< / a > ). If
< 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
winds 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
2017-07-28 19:18:29 +00:00
of the upper-left corner and winds counterclockwise.
2017-08-25 15:51:49 +00:00
If either < a href = "#SkPath_addRoundRect_rx" > rx< / a > or < a href = "#SkPath_addRoundRect_ry" > ry< / a > is too large, < a href = "#SkPath_addRoundRect_rx" > rx< / a > and < a href = "#SkPath_addRoundRect_ry" > ry< / a > are scaled uniformly until the
corners fit. If < a href = "#SkPath_addRoundRect_rx" > rx< / a > or < a href = "#SkPath_addRoundRect_ry" > ry< / a > is less than or equal to zero, < a href = "#SkPath_addRoundRect" > addRoundRect< / a > appends
2017-10-04 18:31:33 +00:00
< a href = "SkRect_Reference#Rect" > Rect< / a > < a href = "#SkPath_addRoundRect_rect" > rect< / a > to < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
2017-10-04 18:31:33 +00:00
After 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.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addRoundRect_rect" > < code > < strong > rect < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds of < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRoundRect_rx" > < code > < strong > rx < / strong > < / code > < / a > < / td > < td >
2017-08-04 16:48:24 +00:00
x-radius of rounded corners on the < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRoundRect_ry" > < code > < strong > ry < / strong > < / code > < / a > < / td > < td >
2017-08-04 16:48:24 +00:00
y-radius of rounded corners on the < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRoundRect_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2018-01-26 17:56:22 +00:00
< div > < fiddle-embed name = "24736f685f265cf533f1700c042db353" > < div > If either radius is zero, path contains < a href = "SkRect_Reference#Rect" > Rect< / a > and is drawn red.
If sides are only radii, path contains < a href = "undocumented#Oval" > Oval< / a > and is drawn blue.
2017-07-28 19:18:29 +00:00
All remaining path draws are convex, and are drawn in gray; no
2017-08-25 15:51:49 +00:00
paths constructed from < a href = "#SkPath_addRoundRect" > addRoundRect< / a > are concave, so none are
2018-03-05 18:26:16 +00:00
drawn in green.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_addRRect" > addRRect< / a > < sup > < a href = "#SkPath_addRRect_2" > [2]< / a > < / sup > < a href = "SkCanvas_Reference#SkCanvas_drawRoundRect" > SkCanvas::drawRoundRect< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_addRoundRect_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void addRoundRect(const SkRect& rect, const SkScalar radii[], Direction dir = kCW_Direction)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Append < 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
equal to < a href = "#SkPath_addRoundRect_2_rect" > rect< / a > ; each corner is 90 degrees of an ellipse with < a href = "#SkPath_addRoundRect_2_radii" > radii< / a > from the
2017-07-28 19:18:29 +00:00
array.
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_addRoundRect_2_radii" > radii< / a > index | location |
2017-07-28 19:18:29 +00:00
| --- | --- |
| 0 | x-radius of top-left corner |
| 1 | y-radius of top-left corner |
| 2 | x-radius of top-right corner |
| 3 | y-radius of top-right corner |
| 4 | x-radius of bottom-right corner |
| 5 | y-radius of bottom-right corner |
| 6 | x-radius of bottom-left corner |
| 7 | y-radius of bottom-left corner |
2018-01-04 21:11:51 +00:00
If < 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
and 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
2017-07-28 19:18:29 +00:00
bottom-left of the upper-left corner and winds counterclockwise.
2018-01-04 21:11:51 +00:00
If both < a href = "#SkPath_addRoundRect_2_radii" > radii< / a > on any side of < a href = "#SkPath_addRoundRect_2_rect" > rect< / a > exceed its length, all < a href = "#SkPath_addRoundRect_2_radii" > radii< / a > are scaled
2017-07-28 19:18:29 +00:00
uniformly until the corners fit. If either radius of a corner is less than or
equal to zero, both are treated as zero.
2017-10-04 18:31:33 +00:00
After 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.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addRoundRect_2_rect" > < code > < strong > rect < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds of < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRoundRect_2_radii" > < code > < strong > radii < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
array of 8 < a href = "undocumented#SkScalar" > SkScalar< / a > values, a radius pair for each corner< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRoundRect_2_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "c43d70606b4ee464d2befbcf448c5e73" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_addRRect" > addRRect< / a > < sup > < a href = "#SkPath_addRRect_2" > [2]< / a > < / sup > < a href = "SkCanvas_Reference#SkCanvas_drawRoundRect" > SkCanvas::drawRoundRect< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addRRect" > < / a >
2017-07-28 19:18:29 +00:00
## addRRect
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction)
< / pre >
2017-08-25 15:51:49 +00:00
Add < a href = "#SkPath_addRRect_rrect" > rrect< / a > to < a href = "#Path" > Path< / a > , creating a new closed < a href = "#Contour" > Contour< / a > . If
< 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
winds clockwise. If < a href = "#SkPath_addRRect_dir" > dir< / a > is < a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > , < a href = "#SkPath_addRRect_rrect" > rrect< / a > starts at the bottom-left
2017-07-28 19:18:29 +00:00
of the upper-left corner and winds counterclockwise.
2017-10-04 18:31:33 +00:00
After 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addRRect_rrect" > < code > < strong > rrect < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds and radii of rounded rectangle< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRRect_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "d9ecd58081b5bc77a157636fcb345dc6" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_addRoundRect" > addRoundRect< / a > < sup > < a href = "#SkPath_addRoundRect_2" > [2]< / a > < / sup > < a href = "SkCanvas_Reference#SkCanvas_drawRRect" > SkCanvas::drawRRect< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_addRRect_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addRRect(const SkRRect& rrect, Direction dir, unsigned start)
< / pre >
2017-08-25 15:51:49 +00:00
Add < 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 >
winds clockwise; if < a href = "#SkPath_addRRect_2_dir" > dir< / a > is < a href = "#SkPath_kCCW_Direction" > kCCW Direction< / a > , < a href = "#SkPath_addRRect_2_rrect" > rrect< / a > winds counterclockwise.
< a href = "#SkPath_addRRect_2_start" > start< / a > determines the first point of < a href = "#SkPath_addRRect_2_rrect" > rrect< / a > to add.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_addRRect_2_start" > start< / a > | location |
2017-07-28 19:18:29 +00:00
| --- | --- |
| 0 | right of top-left corner |
| 1 | left of top-right corner |
| 2 | bottom of top-right corner |
| 3 | top of bottom-right corner |
| 4 | left of bottom-right corner |
| 5 | right of bottom-left corner |
| 6 | top of bottom-left corner |
| 7 | bottom of top-left corner |
2017-10-04 18:31:33 +00:00
After 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addRRect_2_rrect" > < code > < strong > rrect < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
bounds and radii of rounded rectangle< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRRect_2_dir" > < code > < strong > dir < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Direction" > Direction< / a > to wind < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addRRect_2_start" > < code > < strong > start < / strong > < / code > < / a > < / td > < td >
2017-08-30 12:58:10 +00:00
index of initial point of < a href = "undocumented#Round_Rect" > Round Rect< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "f18740ffcb10a499007488948c2cd60d" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_addRoundRect" > addRoundRect< / a > < sup > < a href = "#SkPath_addRoundRect_2" > [2]< / a > < / sup > < a href = "SkCanvas_Reference#SkCanvas_drawRRect" > SkCanvas::drawRRect< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addPoly" > < / a >
2017-07-28 19:18:29 +00:00
## addPoly
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addPoly(const SkPoint pts[], int count, bool close)
< / pre >
2017-09-21 16:31:06 +00:00
Add < 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.
2017-11-27 15:44:06 +00:00
< 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 >
2018-01-26 17:56:22 +00:00
in < 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
2017-09-21 16:31:06 +00:00
< a href = "#SkPath_addPoly_pts" > pts< / a > [< a href = "#SkPath_addPoly_count" > count< / a > - 1] and < a href = "#SkPath_addPoly_pts" > pts< / a > [0].
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
If < a href = "#SkPath_addPoly_count" > count< / a > is zero, append < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > to path.
2017-08-29 21:36:51 +00:00
Has no effect if < a href = "#SkPath_addPoly_count" > count< / a > is less than one.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addPoly_pts" > < code > < strong > pts < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
array of < a href = "undocumented#Line" > Line< / a > sharing end and start < a href = "SkPoint_Reference#Point" > Point< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPoly_count" > < code > < strong > count < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
length of < a href = "SkPoint_Reference#Point" > Point< / a > array< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPoly_close" > < code > < strong > close < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
true to add < a href = "undocumented#Line" > Line< / a > connecting < a href = "#Contour" > Contour< / a > end and start< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "182b3999772f330f3b0b891b492634ae" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkCanvas_Reference#SkCanvas_drawPoints" > SkCanvas::drawPoints< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 15:51:49 +00:00
## <a name="SkPath_AddPathMode"></a> Enum SkPath::AddPathMode
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-25 15:51:49 +00:00
enum < a href = "#SkPath_AddPathMode" > AddPathMode< / a > {
2018-01-04 21:11:51 +00:00
< a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > ,
< a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > ,
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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
the last < a href = "#Contour" > Contour< / a > or start a new < a href = "#Contour" > Contour< / a > .
2017-07-28 19:18:29 +00:00
### Constants
< table >
< tr >
2017-08-29 21:36:51 +00:00
< 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
2018-03-05 18:26:16 +00:00
starts a new < a href = "#Contour" > Contour< / a > .
< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2017-11-27 15:44:06 +00:00
< 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
2018-03-05 18:26:16 +00:00
< a href = "#Path" > Path< / a > initial < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > , then append remining < a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > .
< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "801b02e74c64aafdb734f2e5cf3e5ab0" > < div > test is built from path, open on the top row, and closed on the bottom row.
2017-08-25 15:51:49 +00:00
The left column uses < a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > ; the right uses < a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > .
2018-03-05 18:26:16 +00:00
The top right composition is made up of one contour; the other three have two.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_addPath" > < / a >
2017-07-28 19:18:29 +00:00
## addPath
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void addPath(const SkPath& src, SkScalar dx, SkScalar dy, AddPathMode mode = kAppend_AddPathMode)
2017-07-28 19:18:29 +00:00
< / pre >
2018-01-26 17:56:22 +00:00
Append < 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 > ).
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
If < a href = "#SkPath_addPath_mode" > mode< / a > is < a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > , < a href = "#SkPath_addPath_src" > src< / a > < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > are
2017-08-25 15:51:49 +00:00
added unaltered. If < a href = "#SkPath_addPath_mode" > mode< / a > is < a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > , add < a href = "undocumented#Line" > Line< / a > before appending
2018-02-15 22:31:24 +00:00
< a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addPath_src" > < code > < strong > src < / strong > < / code > < / a > < / td > < td >
2018-02-15 22:31:24 +00:00
< a href = "#Path" > Path< / a > < a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > to add< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPath_dx" > < code > < strong > dx < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset added to < a href = "#SkPath_addPath_src" > src< / a > < a href = "#Point_Array" > Point Array< / a > x coordinates< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPath_dy" > < code > < strong > dy < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset added to < a href = "#SkPath_addPath_src" > src< / a > < a href = "#Point_Array" > Point Array< / a > y coordinates< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPath_mode" > < code > < strong > mode < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > or < a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "c416bddfe286628974e1c7f0fd66f3f4" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_addPath_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode)
< / pre >
2017-08-25 15:51:49 +00:00
Append < a href = "#SkPath_addPath_2_src" > src< / a > to < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
If < a href = "#SkPath_addPath_2_mode" > mode< / a > is < a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > , < a href = "#SkPath_addPath_2_src" > src< / a > < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > are
2017-08-25 15:51:49 +00:00
added unaltered. If < a href = "#SkPath_addPath_2_mode" > mode< / a > is < a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > , add < a href = "undocumented#Line" > Line< / a > before appending
2018-02-15 22:31:24 +00:00
< a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addPath_2_src" > < code > < strong > src < / strong > < / code > < / a > < / td > < td >
2018-02-15 22:31:24 +00:00
< a href = "#Path" > Path< / a > < a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > to add< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPath_2_mode" > < code > < strong > mode < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > or < a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "84b2d1c0fc29f1b35e855b6fc6672f9e" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_AddPathMode" > AddPathMode< / a > < a href = "#SkPath_reverseAddPath" > reverseAddPath< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_addPath_3" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
void addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend_AddPathMode)
2017-07-28 19:18:29 +00:00
< / pre >
2017-08-25 15:51:49 +00:00
Append < 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
2018-02-15 22:31:24 +00:00
< a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > .
2017-07-28 19:18:29 +00:00
2018-02-15 22:31:24 +00:00
If < a href = "#SkPath_addPath_3_mode" > mode< / a > is < a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > , < a href = "#SkPath_addPath_3_src" > src< / a > < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > are
2017-08-25 15:51:49 +00:00
added unaltered. If < a href = "#SkPath_addPath_3_mode" > mode< / a > is < a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > , add < a href = "undocumented#Line" > Line< / a > before appending
2018-02-15 22:31:24 +00:00
< a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_addPath_3_src" > < code > < strong > src < / strong > < / code > < / a > < / td > < td >
2018-02-15 22:31:24 +00:00
< a href = "#Path" > Path< / a > < a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > to add< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPath_3_matrix" > < code > < strong > matrix < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
transform applied to < a href = "#SkPath_addPath_3_src" > src< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_addPath_3_mode" > < code > < strong > mode < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kAppend_AddPathMode" > kAppend AddPathMode< / a > or < a href = "#SkPath_kExtend_AddPathMode" > kExtend AddPathMode< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "3a90a91030f7289d5df0671d342dbbad" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_reverseAddPath" > < / a >
2017-07-28 19:18:29 +00:00
## reverseAddPath
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void reverseAddPath(const SkPath& src)
< / pre >
2018-01-04 21:11:51 +00:00
Append < a href = "#SkPath_reverseAddPath_src" > src< / a > to < a href = "#Path" > Path< / a > , from back to front.
2017-08-25 15:51:49 +00:00
Reversed < a href = "#SkPath_reverseAddPath_src" > src< / a > always appends a new < a href = "#Contour" > Contour< / a > to < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_reverseAddPath_src" > < code > < strong > src < / strong > < / code > < / a > < / td > < td >
2018-02-15 22:31:24 +00:00
< a href = "#Path" > Path< / a > < a href = "#Verb" > Verbs< / a > , < a href = "SkPoint_Reference#Point" > Points< / a > , and < a href = "#Conic_Weight" > Conic Weights< / a > to add< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "5e8513f073db09acde3ff616f6426e3d" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_offset" > < / a >
2017-07-28 19:18:29 +00:00
## offset
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void offset(SkScalar dx, SkScalar dy, SkPath* dst) const
< / pre >
2017-08-25 15:51:49 +00:00
Offset < 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 > .
2018-01-26 17:56:22 +00:00
If < a href = "#SkPath_offset_dst" > dst< / a > is nullptr, < a href = "#Path" > Path< / a > is replaced by offset data.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_offset_dx" > < code > < strong > dx < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset added to < a href = "#Point_Array" > Point Array< / a > x coordinates< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_offset_dy" > < code > < strong > dy < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset added to < a href = "#Point_Array" > Point Array< / a > y coordinates< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_offset_dst" > < code > < strong > dst < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
overwritten, translated copy of < a href = "#Path" > Path< / a > ; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "1d1892196ba5bda257df4f3351abd084" > < / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2018-02-06 14:41:53 +00:00
## <a name="Transform"></a> Transform
| name | description |
| --- | --- |
| < a href = "#SkPath_offset" > offset< / a > | translates < a href = "#Point_Array" > Point Array< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_offset" > offset(SkScalar dx, SkScalar dy, SkPath* dst)< / a > const |
| | < a href = "#SkPath_offset_2" > offset(SkScalar dx, SkScalar dy)< / a > |
2018-02-15 22:31:24 +00:00
| < 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 = "#Conic_Weight" > Weights< / a > |
2018-02-07 12:27:09 +00:00
| | < a href = "#SkPath_transform" > transform(const SkMatrix& matrix, SkPath* dst)< / a > const |
| | < a href = "#SkPath_transform_2" > transform(const SkMatrix& matrix)< / a > |
2018-02-06 14:41:53 +00:00
2018-01-26 17:56:22 +00:00
< a name = "SkPath_offset_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void offset(SkScalar dx, SkScalar dy)
< / pre >
2018-01-26 17:56:22 +00:00
Offset < 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.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_offset_2_dx" > < code > < strong > dx < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset added to < a href = "#Point_Array" > Point Array< / a > x coordinates< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_offset_2_dy" > < code > < strong > dy < / strong > < / code > < / a > < / td > < td >
2018-01-26 17:56:22 +00:00
offset added to < a href = "#Point_Array" > Point Array< / a > y coordinates< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "5188d77585715db30bef228f2dfbcccd" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< 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_Reference#SkCanvas_translate" > SkCanvas::translate()< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_transform" > < / a >
2017-07-28 19:18:29 +00:00
## transform
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void transform(const SkMatrix& matrix, SkPath* dst) const
< / pre >
2018-02-06 14:41:53 +00:00
< a href = "#Transform" > Transform< / a > < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , and weight by < a href = "#SkPath_transform_matrix" > matrix< / a > .
2018-01-26 17:56:22 +00:00
transform may change < a href = "#Verb" > Verbs< / a > and increase their number.
2017-08-25 15:51:49 +00:00
Transformed < 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
2018-01-04 21:11:51 +00:00
is replaced.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_transform_matrix" > < code > < strong > matrix < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
< a href = "SkMatrix_Reference#Matrix" > Matrix< / a > to apply to < a href = "#Path" > Path< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_transform_dst" > < code > < strong > dst < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
overwritten, transformed copy of < a href = "#Path" > Path< / a > ; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "99761add116ce3b0730557224c1b0105" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< 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_Reference#SkCanvas_concat" > SkCanvas::concat()< / a > < a href = "SkMatrix_Reference#SkMatrix" > SkMatrix< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_transform_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void transform(const SkMatrix& matrix)
< / pre >
2018-02-06 14:41:53 +00:00
< a href = "#Transform" > Transform< / a > < 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 > .
2018-01-26 17:56:22 +00:00
transform may change < a href = "#Verb" > Verbs< / a > and increase their number.
2017-08-25 15:51:49 +00:00
< a href = "#Path" > Path< / a > is replaced by transformed data.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_transform_2_matrix" > < code > < strong > matrix < / strong > < / code > < / a > < / td > < td >
2017-10-04 18:31:33 +00:00
< a href = "SkMatrix_Reference#Matrix" > Matrix< / a > to apply to < a href = "#Path" > Path< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "c40979a3b92a30cfb7bae36abcc1d805" > < / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< 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_Reference#SkCanvas_concat" > SkCanvas::concat()< / a > < a href = "SkMatrix_Reference#SkMatrix" > SkMatrix< / a >
2017-07-28 19:18:29 +00:00
---
## <a name="Last_Point"></a> Last Point
2017-08-25 15:51:49 +00:00
< a href = "#Path" > Path< / a > is defined cumulatively, often by adding a segment to the end of last
2017-11-27 15:44:06 +00:00
< 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 > .
2017-08-25 15:51:49 +00:00
< 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 > .
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getLastPt" > < / a >
2017-07-28 19:18:29 +00:00
## getLastPt
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool getLastPt(SkPoint* lastPt) const
< / pre >
2018-01-04 21:11:51 +00:00
Returns < 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,
2017-08-25 15:51:49 +00:00
storing (0, 0) if < a href = "#SkPath_getLastPt_lastPt" > lastPt< / a > is not nullptr.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_getLastPt_lastPt" > < code > < strong > lastPt < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
storage for final < a href = "SkPoint_Reference#Point" > Point< / a > in < a href = "#Point_Array" > Point Array< / a > ; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-02-15 22:31:24 +00:00
true if < a href = "#Point_Array" > Point Array< / a > contains one or more < a href = "SkPoint_Reference#Point" > Points< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "df8160dd7ac8aa4b40fce7286fe49952" >
#### Example Output
~~~~
last point: 35.2786, 52.9772
~~~~
< / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< a href = "#SkPath_setLastPt" > setLastPt< / a > < sup > < a href = "#SkPath_setLastPt_2" > [2]< / a > < / sup >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_setLastPt" > < / a >
2017-07-28 19:18:29 +00:00
## setLastPt
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void setLastPt(SkScalar x, SkScalar y)
< / pre >
2017-08-25 15:51:49 +00:00
Set < 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
< 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_setLastPt_x" > < code > < strong > x < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
set < a href = "#SkPath_setLastPt_x" > x< / a > -coordinate of < a href = "#Last_Point" > Last Point< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_setLastPt_y" > < code > < strong > y < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
set < a href = "#SkPath_setLastPt_y" > y< / a > -coordinate of < a href = "#Last_Point" > Last Point< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "542c5afaea5f57baa11d0561dd402e18" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getLastPt" > getLastPt< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_setLastPt_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void setLastPt(const SkPoint& p)
< / pre >
Set the last point on the path. If no points have been added,
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_setLastPt_2_p" > < code > < strong > p < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
set value of < a href = "#Last_Point" > Last Point< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "6fa5e8f9513b3225e106778592e27e94" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getLastPt" > getLastPt< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 15:51:49 +00:00
## <a name="SkPath_SegmentMask"></a> Enum SkPath::SegmentMask
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-25 15:51:49 +00:00
enum < a href = "#SkPath_SegmentMask" > SegmentMask< / a > {
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_kLine_SegmentMask" > kLine SegmentMask< / a > = 1 < < 0 ,
< a href = "#SkPath_kQuad_SegmentMask" > kQuad SegmentMask< / a > = 1 < < 1 ,
< a href = "#SkPath_kConic_SegmentMask" > kConic SegmentMask< / a > = 1 < < 2 ,
< a href = "#SkPath_kCubic_SegmentMask" > kCubic SegmentMask< / a > = 1 < < 3 ,
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< 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
2018-02-15 22:31:24 +00:00
instance, if < a href = "#Path" > Path< / a > only contains < a href = "undocumented#Line" > Lines< / a > , only the < a href = "#SkPath_kLine_SegmentMask" > kLine SegmentMask< / a > bit is set.
2017-07-28 19:18:29 +00:00
### Constants
< table >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< tr >
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
2018-03-05 18:26:16 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
Path kConic_SegmentMask is clear
Path kQuad_SegmentMask is set
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getSegmentMasks" > getSegmentMasks< / a > < a href = "#SkPath_Verb" > Verb< / a >
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getSegmentMasks" > < / a >
2017-07-28 19:18:29 +00:00
## getSegmentMasks
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
uint32_t getSegmentMasks() const
< / pre >
2017-08-25 15:51:49 +00:00
Returns a mask, where each set bit corresponds to a < a href = "#SkPath_SegmentMask" > SegmentMask< / a > constant
2018-01-26 17:56:22 +00:00
if < a href = "#Path" > Path< / a > contains one or more < a href = "#Verb" > Verbs< / a > of that type.
2018-02-15 22:31:24 +00:00
Returns zero if < a href = "#Path" > Path< / a > contains no < a href = "undocumented#Line" > Lines< / a > , or < a href = "undocumented#Curve" > Curves< / a > : < a href = "#Quad" > Quads< / a > , < a href = "#Conic" > Conics< / a > , or < a href = "#Cubic" > Cubics< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getSegmentMasks" > getSegmentMasks< / a > returns a cached result; it is very fast.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_SegmentMask" > SegmentMask< / a > bits or zero
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "dd9f620b419c8ca18cd306c881aadb5f" >
#### Example Output
~~~~
mask quad set
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_getSegmentMasks" > getSegmentMasks< / a > < a href = "#SkPath_Verb" > Verb< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_contains" > < / a >
2017-07-28 19:18:29 +00:00
## contains
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool contains(SkScalar x, SkScalar y) const
< / pre >
2017-08-25 15:51:49 +00:00
Returns 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
2018-01-04 21:11:51 +00:00
account < a href = "#SkPath_FillType" > FillType< / a > .
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
| < 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 |
2017-07-28 19:18:29 +00:00
| --- | --- |
2017-08-25 15:51:49 +00:00
| < a href = "#SkPath_kWinding_FillType" > kWinding FillType< / a > | a non-zero sum of < a href = "#Contour" > Contour< / a > < a href = "#Direction" > Directions< / a > . |
| < a href = "#SkPath_kEvenOdd_FillType" > kEvenOdd FillType< / a > | an odd number of < a href = "#Contour" > Contours< / a > . |
| < a href = "#SkPath_kInverseWinding_FillType" > kInverseWinding FillType< / a > | a zero sum of < a href = "#Contour" > Contour< / a > < a href = "#Direction" > Directions< / a > . |
| < a href = "#SkPath_kInverseEvenOdd_FillType" > kInverseEvenOdd FillType< / a > | and even number of < a href = "#Contour" > Contours< / a > . |
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_contains_x" > < code > < strong > x < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_contains_x" > x< / a > -coordinate of containment test< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_contains_y" > < code > < strong > y < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
< a href = "#SkPath_contains_y" > y< / a > -coordinate of containment test< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-11-27 15:44:06 +00:00
true if < a href = "SkPoint_Reference#Point" > Point< / a > is in < a href = "#Path" > Path< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "c0216b3f7ebd80b9589ae5728f08fc80" > < / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_conservativelyContainsRect" > conservativelyContainsRect< / a > < a href = "#Fill_Type" > Fill Type< / a > < a href = "undocumented#Op" > Op< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_dump" > < / a >
2017-07-28 19:18:29 +00:00
## dump
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void dump(SkWStream* stream, bool forceClose, bool dumpAsHex) const
< / pre >
2017-10-26 11:58:48 +00:00
Writes 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
standard output. Set < a href = "#SkPath_dump_forceClose" > forceClose< / a > to true to get edges used to fill < a href = "#Path" > Path< / a > .
Set < a href = "#SkPath_dump_dumpAsHex" > dumpAsHex< / a > true to generate exact binary representations
2018-02-15 22:31:24 +00:00
of floating point numbers used in < a href = "#Point_Array" > Point Array< / a > and < a href = "#Conic_Weight" > Conic Weights< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_dump_stream" > < code > < strong > stream < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
writable < a href = "undocumented#Stream" > Stream< / a > receiving < a href = "#Path" > Path< / a > text representation; may be nullptr< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_dump_forceClose" > < code > < strong > forceClose < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
true if missing < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > is output< / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_dump_dumpAsHex" > < code > < strong > dumpAsHex < / strong > < / code > < / a > < / td > < td >
2017-09-01 19:51:02 +00:00
true if < a href = "undocumented#SkScalar" > SkScalar< / a > values are written as hexadecimal< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "8036d764452a62f9953af50846f0f3c0" >
#### Example Output
~~~~
path.setFillType(SkPath::kWinding_FillType);
path.moveTo(0, 0);
path.quadTo(20, 30, 40, 50);
path.setFillType(SkPath::kWinding_FillType);
path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
path.quadTo(SkBits2Float(0x41a00000), SkBits2Float(0x41f00000), SkBits2Float(0x42200000), SkBits2Float(0x42480000)); // 20, 30, 40, 50
path.setFillType(SkPath::kWinding_FillType);
path.moveTo(0, 0);
path.quadTo(20, 30, 40, 50);
path.lineTo(0, 0);
path.close();
path.setFillType(SkPath::kWinding_FillType);
path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
path.quadTo(SkBits2Float(0x41a00000), SkBits2Float(0x41f00000), SkBits2Float(0x42200000), SkBits2Float(0x42480000)); // 20, 30, 40, 50
path.lineTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
path.close();
~~~~
< / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "SkRect_Reference#SkRect_dump" > SkRect::dump()< / a > < sup > < a href = "SkRect_Reference#SkRect_dump_2" > [2]< / a > < / sup > < a href = "undocumented#SkRRect_dump" > SkRRect::dump()< / a > < a href = "undocumented#SkPathMeasure_dump" > SkPathMeasure::dump()< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_dump_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void dump() const
< / pre >
2017-09-01 19:51:02 +00:00
Writes text representation of < a href = "#Path" > Path< / a > to standard output. The representation may be
2018-01-04 21:11:51 +00:00
directly compiled as C++ code. Floating point values are written
2017-08-25 15:51:49 +00:00
with limited precision; it may not be possible to reconstruct original < a href = "#Path" > Path< / a >
2017-07-28 19:18:29 +00:00
from output.
### Example
< div > < fiddle-embed name = "92e0032f85181795d1f8b5a2c8e4e4b7" >
#### Example Output
~~~~
path.setFillType(SkPath::kWinding_FillType);
path.moveTo(0, 0);
path.lineTo(0.857143f, 0.666667f);
path is not equal to copy
~~~~
< / fiddle-embed > < / div >
### See Also
2018-02-15 22:31:24 +00:00
< a href = "#SkPath_dumpHex" > dumpHex< / a > < a href = "SkRect_Reference#SkRect_dump" > SkRect::dump()< / a > < sup > < a href = "SkRect_Reference#SkRect_dump_2" > [2]< / a > < / sup > < a href = "undocumented#SkRRect_dump" > SkRRect::dump()< / a > < a href = "undocumented#SkPathMeasure_dump" > SkPathMeasure::dump()< / a > < a href = "#SkPath_writeToMemory" > writeToMemory< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_dumpHex" > < / a >
2017-07-28 19:18:29 +00:00
## dumpHex
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void dumpHex() const
< / pre >
2017-09-01 19:51:02 +00:00
Writes text representation of < a href = "#Path" > Path< / a > to standard output. The representation may be
2018-01-04 21:11:51 +00:00
directly compiled as C++ code. Floating point values are written
2017-07-28 19:18:29 +00:00
in hexadecimal to preserve their exact bit pattern. The output reconstructs the
2017-08-25 15:51:49 +00:00
original < a href = "#Path" > Path< / a > .
2017-07-28 19:18:29 +00:00
2018-01-04 21:11:51 +00:00
Use instead of < a href = "#SkPath_dump_2" > dump< / a > when submitting < a href = "http://bug.skia.org" > bug reports against Skia< / a > .
2017-09-21 16:31:06 +00:00
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "72a92fe058e8b3be6c8a30fad7fd1266" >
#### Example Output
~~~~
path.setFillType(SkPath::kWinding_FillType);
path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
path.lineTo(SkBits2Float(0x3f5b6db7), SkBits2Float(0x3f2aaaab)); // 0.857143f, 0.666667f
path is equal to copy
~~~~
< / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< a href = "#SkPath_dump" > dump< / a > < sup > < a href = "#SkPath_dump_2" > [2]< / a > < / sup >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_writeToMemory" > < / a >
2017-07-28 19:18:29 +00:00
## writeToMemory
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
size_t writeToMemory(void* buffer) const
< / pre >
2017-08-29 21:36:51 +00:00
Writes < a href = "#Path" > Path< / a > to < a href = "#SkPath_writeToMemory_buffer" > buffer< / a > , returning the number of bytes written.
2017-07-28 19:18:29 +00:00
Pass nullptr to obtain the storage size.
2017-08-29 21:36:51 +00:00
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
2017-08-25 15:51:49 +00:00
additionally writes computed information like < a href = "#SkPath_Convexity" > Convexity< / a > and bounds.
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
Use only be used in concert with < a href = "#SkPath_readFromMemory" > readFromMemory< / a > ;
the format used for < a href = "#Path" > Path< / a > in memory is not guaranteed.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_writeToMemory_buffer" > < code > < strong > buffer < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
storage for < a href = "#Path" > Path< / a > ; may be nullptr< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
size of storage required for < a href = "#Path" > Path< / a > ; always a multiple of 4
### Example
< div > < fiddle-embed name = "e5f16eda6a1c2d759556285f72598445" >
#### Example Output
~~~~
path is equal to copy
~~~~
< / fiddle-embed > < / div >
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-08-29 21:36:51 +00:00
---
< a name = "SkPath_serialize" > < / a >
## serialize
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-10-04 18:31:33 +00:00
sk_sp< SkData> serialize() const
2017-08-29 21:36:51 +00:00
< / pre >
Write < a href = "#Path" > Path< / a > to buffer, returning the buffer written to, wrapped in < a href = "undocumented#Data" > Data< / a > .
< 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
additionally writes computed information like < a href = "#SkPath_Convexity" > Convexity< / a > and bounds.
< a href = "#SkPath_serialize" > serialize< / a > should only be used in concert with < a href = "#SkPath_readFromMemory" > readFromMemory< / a > .
The format used for < a href = "#Path" > Path< / a > in memory is not guaranteed.
### Return Value
< a href = "#Path" > Path< / a > data wrapped in < a href = "undocumented#Data" > Data< / a > buffer
2017-07-28 19:18:29 +00:00
### Example
2017-08-29 21:36:51 +00:00
< div > < fiddle-embed name = "2c6aff73608cd198659db6d1eeaaae4f" >
#### Example Output
~~~~
path is equal to copy
~~~~
< / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2018-01-26 17:56:22 +00:00
< 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 >
2017-07-28 19:18:29 +00:00
---
2017-08-25 17:14:33 +00:00
< a name = "SkPath_readFromMemory" > < / a >
2017-07-28 19:18:29 +00:00
## readFromMemory
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
size_t readFromMemory(const void* buffer, size_t length)
< / pre >
2017-08-25 15:51:49 +00:00
Initializes < 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
2018-01-04 21:11:51 +00:00
data is inconsistent, or the < a href = "#SkPath_readFromMemory_length" > length< / a > is too small.
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
Reads < 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
2017-08-25 15:51:49 +00:00
additionally reads computed information like < a href = "#SkPath_Convexity" > Convexity< / a > and bounds.
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
Used only in concert with < a href = "#SkPath_writeToMemory" > writeToMemory< / a > ;
the format used for < a href = "#Path" > Path< / a > in memory is not guaranteed.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-25 15:51:49 +00:00
< table > < tr > < td > < a name = "SkPath_readFromMemory_buffer" > < code > < strong > buffer < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
storage for < a href = "#Path" > Path< / a > < / td >
2017-08-25 15:51:49 +00:00
< / tr > < tr > < td > < a name = "SkPath_readFromMemory_length" > < code > < strong > length < / strong > < / code > < / a > < / td > < td >
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_readFromMemory_buffer" > buffer< / a > size in bytes; must be multiple of 4< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
number of bytes read, or zero on failure
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "9c6edd836c573a0fd232d2b8aa11a678" >
#### Example Output
~~~~
length = 60; returned by readFromMemory = 0
length = 68; returned by readFromMemory = 64
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_writeToMemory" > writeToMemory< / a >
2017-07-28 19:18:29 +00:00
---
2018-02-07 12:27:09 +00:00
## <a name="Generation_ID"></a> Generation ID
2017-08-25 15:51:49 +00:00
< 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
< 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
2018-02-15 22:31:24 +00:00
not necessarily have matching < a href = "#Generation_ID" > Generation IDs< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
Empty < a href = "#Path" > Paths< / a > have a < a href = "#Generation_ID" > Generation ID< / a > of one.
2017-07-28 19:18:29 +00:00
2017-08-25 17:14:33 +00:00
< a name = "SkPath_getGenerationID" > < / a >
2017-07-28 19:18:29 +00:00
## getGenerationID
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
uint32_t getGenerationID() const
< / pre >
2018-01-26 17:56:22 +00:00
Returns a non-zero, globally unique value. A different value is returned
2017-08-25 15:51:49 +00:00
if < a href = "#Verb_Array" > Verb Array< / a > , < a href = "#Point_Array" > Point Array< / a > , or < a href = "#Conic_Weight" > Conic Weight< / a > changes.
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
Setting < a href = "#Fill_Type" > Fill Type< / a > does not change < a href = "#Generation_ID" > Generation ID< / a > .
2017-07-28 19:18:29 +00:00
2017-08-25 15:51:49 +00:00
Each time the path is modified, a different < a href = "#Generation_ID" > Generation ID< / a > will be returned.
2017-07-28 19:18:29 +00:00
2018-02-06 14:41:53 +00:00
< a href = "#Fill_Type" > Fill Type< / a > does affect < a href = "#Generation_ID" > Generation ID< / a > on Android framework.
2017-07-28 19:18:29 +00:00
### Return Value
2018-01-26 17:56:22 +00:00
non-zero, globally unique value
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "a0f166715d6479f91258d854e63e586d" >
#### Example Output
~~~~
empty genID = 1
1st lineTo genID = 2
empty genID = 1
2nd lineTo genID = 3
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_equal_operator" > operator==(const SkPath& a, const SkPath& b)< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_isValid" > < / a >
## isValid
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-29 21:36:51 +00:00
bool isValid() const
< / pre >
Returns if < a href = "#Path" > Path< / a > data is consistent. Corrupt < a href = "#Path" > Path< / a > data is detected if
internal values are out of range or internal storage does not match
array dimensions.
### Return Value
true if < a href = "#Path" > Path< / a > data is consistent
---
< a name = "SkPath_pathRefIsValid" > < / a >
## pathRefIsValid
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-29 21:36:51 +00:00
bool pathRefIsValid() const
< / pre >
2018-02-06 14:41:53 +00:00
soon
2017-08-29 21:36:51 +00:00
---
# <a name="SkPath::Iter"></a> Class SkPath::Iter
2017-08-25 15:51:49 +00:00
Iterates 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 > .
Provides options to treat open < a href = "#Contour" > Contours< / a > as closed, and to ignore
2017-07-28 19:18:29 +00:00
degenerate data.
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-29 21:36:51 +00:00
class < a href = "#SkPath_Iter_Iter" > Iter< / a > {
public:
< a href = "#SkPath_Iter_Iter" > Iter()< / a > ;
< a href = "#SkPath_Iter_Iter_2" > Iter(const SkPath& path, bool forceClose)< / a > ;
void < a href = "#SkPath_Iter_setPath" > setPath(const SkPath& path, bool forceClose)< / a > ;
< a href = "#SkPath_Verb" > Verb< / a > < a href = "#SkPath_Iter_next" > next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)< / a > ;
< a href = "undocumented#SkScalar" > SkScalar< / a > < a href = "#SkPath_Iter_conicWeight" > conicWeight< / a > const;
bool < a href = "#SkPath_Iter_isCloseLine" > isCloseLine< / a > const;
bool < a href = "#SkPath_Iter_isClosedContour" > isClosedContour< / a > const;
2018-03-05 18:26:16 +00:00
};
< / pre >
2017-08-29 21:36:51 +00:00
2017-07-28 19:18:29 +00:00
### Example
2017-08-29 21:36:51 +00:00
< 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
2018-03-05 18:26:16 +00:00
path of the glyph.
< / div > < / fiddle-embed > < / div >
2017-07-28 19:18:29 +00:00
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_RawIter" > RawIter< / a >
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
< a name = "SkPath_Iter_Iter" > < / a >
2017-07-28 19:18:29 +00:00
## Iter
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
Iter()
< / pre >
2017-08-29 21:36:51 +00:00
Initializes < 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 > .
Call < a href = "#SkPath_Iter_setPath" > setPath< / a > to initialize < a href = "#SkPath_Iter_Iter" > Iter< / a > at a later time.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Iter_Iter" > Iter< / a > of empty < a href = "#Path" > Path< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "01648775cb9b354b2f1836dad82a25ab" >
#### Example Output
~~~~
iter is done
iter is done
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Iter_setPath" > setPath< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_Iter_Iter_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
Iter(const SkPath& path, bool forceClose)
< / pre >
2017-08-29 21:36:51 +00:00
Sets < 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 > .
If < 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
open < a href = "#Contour" > Contour< / a > . < a href = "#SkPath_Iter_Iter_2_path" > path< / a > is not altered.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-29 21:36:51 +00:00
< table > < tr > < td > < a name = "SkPath_Iter_Iter_2_path" > < code > < strong > path < / strong > < / code > < / a > < / td > < td >
< a href = "#Path" > Path< / a > to iterate< / td >
< / tr > < tr > < td > < a name = "SkPath_Iter_Iter_2_forceClose" > < code > < strong > forceClose < / strong > < / code > < / a > < / td > < td >
true if open < a href = "#Contour" > Contours< / a > generate < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Iter_Iter" > Iter< / a > of < a href = "#SkPath_Iter_Iter_2_path" > path< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "13044dbf68885c0f15322c0633b633a3" >
#### Example Output
~~~~
open:
kMove_Verb {0, 0},
kQuad_Verb {0, 0}, {10, 20}, {30, 40},
kDone_Verb
closed:
kMove_Verb {0, 0},
kQuad_Verb {0, 0}, {10, 20}, {30, 40},
kLine_Verb {30, 40}, {0, 0},
kClose_Verb {0, 0},
kDone_Verb
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Iter_setPath" > setPath< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_Iter_setPath" > < / a >
2017-07-28 19:18:29 +00:00
## setPath
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void setPath(const SkPath& path, bool forceClose)
< / pre >
2017-08-29 21:36:51 +00:00
Sets < 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 > .
If < 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
open < a href = "#Contour" > Contour< / a > . < a href = "#SkPath_Iter_setPath_path" > path< / a > is not altered.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-29 21:36:51 +00:00
< table > < tr > < td > < a name = "SkPath_Iter_setPath_path" > < code > < strong > path < / strong > < / code > < / a > < / td > < td >
< a href = "#Path" > Path< / a > to iterate< / td >
< / tr > < tr > < td > < a name = "SkPath_Iter_setPath_forceClose" > < code > < strong > forceClose < / strong > < / code > < / a > < / td > < td >
true if open < a href = "#Contour" > Contours< / a > generate < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Example
< div > < fiddle-embed name = "6c9688008cea8937ad5cc188b38ecf16" >
#### Example Output
~~~~
quad open:
kMove_Verb {0, 0},
kQuad_Verb {0, 0}, {10, 20}, {30, 40},
kDone_Verb
conic closed:
kMove_Verb {0, 0},
kConic_Verb {0, 0}, {1, 2}, {3, 4}, weight = 0.5
kLine_Verb {3, 4}, {0, 0},
kClose_Verb {0, 0},
kDone_Verb
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Iter_Iter_2" > Iter(const SkPath& path, bool forceClose)< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_Iter_next" > < / a >
2017-07-28 19:18:29 +00:00
## next
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)
< / pre >
2018-01-26 17:56:22 +00:00
Returns next < a href = "#SkPath_Verb" > Verb< / a > in < a href = "#Verb_Array" > Verb Array< / a > , and advances < a href = "#SkPath_Iter_Iter" > Iter< / a > .
2017-08-25 15:51:49 +00:00
When < a href = "#Verb_Array" > Verb Array< / a > is exhausted, returns < a href = "#SkPath_kDone_Verb" > kDone Verb< / a > .
2017-08-30 12:58:10 +00:00
2018-02-15 22:31:24 +00:00
Zero to four < a href = "SkPoint_Reference#Point" > Points< / a > are stored in < a href = "#SkPath_Iter_next_pts" > pts< / a > , depending on the returned < a href = "#SkPath_Verb" > Verb< / a > .
2017-08-30 12:58:10 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_Iter_next_doConsumeDegenerates" > doConsumeDegenerates< / a > is true, skip consecutive < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > entries, returning
2018-02-15 22:31:24 +00:00
only the last in the series; and skip very small < a href = "undocumented#Line" > Lines< / a > , < a href = "#Quad" > Quads< / a > , and < a href = "#Conic" > Conics< / a > ; and
2017-08-25 15:51:49 +00:00
skip < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > following < a href = "#SkPath_kMove_Verb" > kMove Verb< / a > .
2018-02-15 22:31:24 +00:00
if < a href = "#SkPath_Iter_next_doConsumeDegenerates" > doConsumeDegenerates< / a > is true and < a href = "#SkPath_Iter_next_exact" > exact< / a > is true, only skip < a href = "undocumented#Line" > Lines< / a > , < a href = "#Quad" > Quads< / a > , and
2017-08-25 15:51:49 +00:00
< a href = "#Conic" > Conics< / a > with zero lengths.
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-29 21:36:51 +00:00
< table > < tr > < td > < a name = "SkPath_Iter_next_pts" > < code > < strong > pts < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
storage for < a href = "SkPoint_Reference#Point" > Point< / a > data describing returned < a href = "#SkPath_Verb" > Verb< / a > < / td >
2017-08-29 21:36:51 +00:00
< / tr > < tr > < td > < a name = "SkPath_Iter_next_doConsumeDegenerates" > < code > < strong > doConsumeDegenerates < / strong > < / code > < / a > < / td > < td >
2017-08-30 12:58:10 +00:00
if true, skip degenerate < a href = "#Verb" > Verbs< / a > < / td >
2017-08-29 21:36:51 +00:00
< / tr > < tr > < td > < a name = "SkPath_Iter_next_exact" > < code > < strong > exact < / strong > < / code > < / a > < / td > < td >
2017-08-30 12:58:10 +00:00
skip zero length curves< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-01-26 17:56:22 +00:00
next < a href = "#SkPath_Verb" > Verb< / a > from < a href = "#Verb_Array" > Verb Array< / a >
2017-07-28 19:18:29 +00:00
### Example
2017-08-25 15:51:49 +00:00
< 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 >
followed by the < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > , the zero length < a href = "undocumented#Line" > Line< / a > and the very small < a href = "undocumented#Line" > Line< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
skip degenerate if < a href = "#SkPath_Iter_next_exact" > exact< / a > skips the same as skip degenerate, but shows
2017-08-04 16:48:24 +00:00
the very small < a href = "undocumented#Line" > Line< / a > .
2017-07-28 19:18:29 +00:00
2018-03-05 18:26:16 +00:00
skip none shows all of the < a href = "#Verb" > Verbs< / a > and < a href = "SkPoint_Reference#Point" > Points< / a > in < a href = "#Path" > Path< / a > .
< / div >
2017-07-28 19:18:29 +00:00
#### Example Output
~~~~
skip degenerate:
kMove_Verb {20, 20},
kQuad_Verb {20, 20}, {10, 20}, {30, 40},
kDone_Verb
skip degenerate if exact:
kMove_Verb {20, 20},
kQuad_Verb {20, 20}, {10, 20}, {30, 40},
kMove_Verb {30, 30},
kLine_Verb {30, 30}, {30.00001, 30},
kDone_Verb
skip none:
kMove_Verb {10, 10},
kMove_Verb {20, 20},
kQuad_Verb {20, 20}, {10, 20}, {30, 40},
kMove_Verb {1, 1},
kClose_Verb {1, 1},
kMove_Verb {30, 30},
kLine_Verb {30, 30}, {30, 30},
kMove_Verb {30, 30},
kLine_Verb {30, 30}, {30.00001, 30},
kDone_Verb
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_Verb" > Verb< / a > < a href = "#SkPath_IsLineDegenerate" > IsLineDegenerate< / a > < a href = "#SkPath_IsCubicDegenerate" > IsCubicDegenerate< / a > < a href = "#SkPath_IsQuadDegenerate" > IsQuadDegenerate< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_Iter_conicWeight" > < / a >
2017-07-28 19:18:29 +00:00
## conicWeight
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
SkScalar conicWeight() const
< / pre >
2017-08-29 21:36:51 +00:00
Returns < a href = "#Conic_Weight" > Conic Weight< / a > if < a href = "#SkPath_Iter_next" > next< / a > returned < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_Iter_next" > next< / a > has not been called, or < a href = "#SkPath_Iter_next" > next< / a > did not return < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > ,
2017-07-28 19:18:29 +00:00
result is undefined.
### Return Value
2018-02-15 22:31:24 +00:00
< a href = "#Conic_Weight" > Conic Weight< / a > for < a href = "#Conic" > Conic< / a > < a href = "SkPoint_Reference#Point" > Points< / a > returned by < a href = "#SkPath_Iter_next" > next< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "f97cc1191cf2eef161d6b97fcba67b02" >
#### Example Output
~~~~
first verb is move
next verb is conic
conic points: {0,0}, {1,2}, {3,4}
conic weight: 0.5
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#Conic_Weight" > Conic Weight< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_Iter_isCloseLine" > < / a >
2017-07-28 19:18:29 +00:00
## isCloseLine
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isCloseLine() const
< / pre >
2017-08-29 21:36:51 +00:00
Returns true if last < a href = "#SkPath_kLine_Verb" > kLine Verb< / a > returned by < a href = "#SkPath_Iter_next" > next< / a > was generated
by < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > . When true, the end point returned by < a href = "#SkPath_Iter_next" > next< / a > is
2017-08-25 15:51:49 +00:00
also the start point of < a href = "#Contour" > Contour< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_Iter_next" > next< / a > has not been called, or < a href = "#SkPath_Iter_next" > next< / a > did not return < a href = "#SkPath_kLine_Verb" > kLine Verb< / a > ,
2017-07-28 19:18:29 +00:00
result is undefined.
### Return Value
2017-08-29 21:36:51 +00:00
true if last < a href = "#SkPath_kLine_Verb" > kLine Verb< / a > was generated by < a href = "#SkPath_kClose_Verb" > kClose Verb< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "345e0646a010f7dce571078d1321f4df" >
#### Example Output
~~~~
1st verb is move
moveTo point: {6,7}
2nd verb is conic
3rd verb is line
line points: {3,4}, {6,7}
line generated by close
4th verb is close
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#SkPath_close" > close< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_Iter_isClosedContour" > < / a >
2017-07-28 19:18:29 +00:00
## isClosedContour
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
bool isClosedContour() const
< / pre >
2017-08-29 21:36:51 +00:00
Returns true if subsequent calls to < a href = "#SkPath_Iter_next" > next< / a > return < a href = "#SkPath_kClose_Verb" > kClose Verb< / a > before returning
< 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
2018-01-26 17:56:22 +00:00
< a href = "#SkPath_Iter_Iter" > Iter< / a > may have been initialized with force close set to true.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
true if < a href = "#Contour" > Contour< / a > is closed
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "145ead5d4f5fb9ba0a0320cb6a5bf3e8" >
#### Example Output
~~~~
without close(), forceClose is false: isClosedContour returns false
with close(), forceClose is false: isClosedContour returns true
without close(), forceClose is true : isClosedContour returns true
with close(), forceClose is true : isClosedContour returns true
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_Iter_Iter_2" > Iter(const SkPath& path, bool forceClose)< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
# <a name="SkPath::RawIter"></a> Class SkPath::RawIter
2017-08-25 15:51:49 +00:00
Iterates 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 > .
2018-01-04 21:11:51 +00:00
< 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.
2017-07-28 19:18:29 +00:00
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-08-29 21:36:51 +00:00
class < a href = "#SkPath_RawIter_RawIter" > RawIter< / a > {
public:
< a href = "#SkPath_RawIter_RawIter" > RawIter()< / a > ;
< a href = "#SkPath_RawIter_RawIter_2" > RawIter(const SkPath& path)< / a > ;
void < a href = "#SkPath_RawIter_setPath" > setPath(const SkPath& path)< / a > ;
< a href = "#SkPath_Verb" > Verb< / a > < a href = "#SkPath_RawIter_next" > next(SkPoint pts[4])< / a > ;
< a href = "#SkPath_Verb" > Verb< / a > < a href = "#SkPath_RawIter_peek" > peek< / a > const;
< a href = "undocumented#SkScalar" > SkScalar< / a > < a href = "#SkPath_RawIter_conicWeight" > conicWeight< / a > const;
2018-03-05 18:26:16 +00:00
}
< / pre >
2017-08-29 21:36:51 +00:00
< a name = "SkPath_RawIter_RawIter" > < / a >
2017-07-28 19:18:29 +00:00
## RawIter
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
RawIter()
< / pre >
2017-08-29 21:36:51 +00:00
Initializes < 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 > .
2018-02-09 21:49:09 +00:00
Call < a href = "#SkPath_RawIter_setPath" > setPath< / a > to initialize < a href = "#SkPath_Iter" > SkPath::Iter< / a > at a later time.
2017-07-28 19:18:29 +00:00
### Return Value
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_RawIter_RawIter" > RawIter< / a > of empty < a href = "#Path" > Path< / a >
2017-07-28 19:18:29 +00:00
---
2018-01-26 17:56:22 +00:00
< a name = "SkPath_RawIter_RawIter_2" > < / a >
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
RawIter(const SkPath& path)
< / pre >
2017-08-29 21:36:51 +00:00
Sets < 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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-29 21:36:51 +00:00
< table > < tr > < td > < a name = "SkPath_RawIter_RawIter_2_path" > < code > < strong > path < / strong > < / code > < / a > < / td > < td >
< a href = "#Path" > Path< / a > to iterate< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_RawIter_RawIter" > RawIter< / a > of < a href = "#SkPath_RawIter_RawIter_2_path" > path< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_RawIter_setPath" > < / a >
2017-07-28 19:18:29 +00:00
## setPath
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
void setPath(const SkPath& path)
< / pre >
2018-02-09 21:49:09 +00:00
Sets < a href = "#SkPath_Iter" > SkPath::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 > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-29 21:36:51 +00:00
< table > < tr > < td > < a name = "SkPath_RawIter_setPath_path" > < code > < strong > path < / strong > < / code > < / a > < / td > < td >
< a href = "#Path" > Path< / a > to iterate< / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_RawIter_next" > < / a >
2017-07-28 19:18:29 +00:00
## next
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
Verb next(SkPoint pts[4])
< / pre >
2018-01-26 17:56:22 +00:00
Returns next < a href = "#SkPath_Verb" > Verb< / a > in < a href = "#Verb_Array" > Verb Array< / a > , and advances < a href = "#SkPath_RawIter_RawIter" > RawIter< / a > .
2017-08-25 15:51:49 +00:00
When < a href = "#Verb_Array" > Verb Array< / a > is exhausted, returns < a href = "#SkPath_kDone_Verb" > kDone Verb< / a > .
2018-02-15 22:31:24 +00:00
Zero to four < a href = "SkPoint_Reference#Point" > Points< / a > are stored in < a href = "#SkPath_RawIter_next_pts" > pts< / a > , depending on the returned < a href = "#SkPath_Verb" > Verb< / a > .
2017-07-28 19:18:29 +00:00
### Parameters
2017-08-29 21:36:51 +00:00
< table > < tr > < td > < a name = "SkPath_RawIter_next_pts" > < code > < strong > pts < / strong > < / code > < / a > < / td > < td >
2017-11-27 15:44:06 +00:00
storage for < a href = "SkPoint_Reference#Point" > Point< / a > data describing returned < a href = "#SkPath_Verb" > Verb< / a > < / td >
2017-07-28 19:18:29 +00:00
< / tr >
< / table >
### Return Value
2018-01-26 17:56:22 +00:00
next < a href = "#SkPath_Verb" > Verb< / a > from < a href = "#Verb_Array" > Verb Array< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "944a80c7ff8c04e1fecc4aec4a47ea60" >
#### Example Output
~~~~
kMove_Verb {50, 60},
kQuad_Verb {50, 60}, {10, 20}, {30, 40},
kClose_Verb {50, 60},
kMove_Verb {50, 60},
kLine_Verb {50, 60}, {30, 30},
kConic_Verb {30, 30}, {1, 2}, {3, 4}, weight = 0.5
kCubic_Verb {3, 4}, {-1, -2}, {-3, -4}, {-5, -6},
kDone_Verb
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_RawIter_peek" > peek< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_RawIter_peek" > < / a >
2017-07-28 19:18:29 +00:00
## peek
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
Verb peek() const
< / pre >
2018-01-26 17:56:22 +00:00
Returns next < a href = "#SkPath_Verb" > Verb< / a > , but does not advance < a href = "#SkPath_RawIter_RawIter" > RawIter< / a > .
2017-07-28 19:18:29 +00:00
### Return Value
2018-01-26 17:56:22 +00:00
next < a href = "#SkPath_Verb" > Verb< / a > from < a href = "#Verb_Array" > Verb Array< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "eb5fa5bea23059ce538e883502f828f5" >
#### Example Output
~~~~
#Volatile
peek Move == verb Move
peek Quad == verb Quad
peek Conic == verb Conic
peek Cubic == verb Cubic
peek Done == verb Done
peek Done == verb Done
~~~~
< / fiddle-embed > < / div >
2018-02-06 14:41:53 +00:00
StdOut isn't really volatile, it just produces the wrong result.
A simple fix changes the output of hairlines and needs to be
investigated to see if the change is correct or not.
https://skia-review.googlesource.com/c/21340/
2017-07-28 19:18:29 +00:00
### See Also
2017-08-29 21:36:51 +00:00
< a href = "#SkPath_RawIter_next" > next< / a >
2017-07-28 19:18:29 +00:00
---
2017-08-29 21:36:51 +00:00
< a name = "SkPath_RawIter_conicWeight" > < / a >
2017-07-28 19:18:29 +00:00
## conicWeight
2017-11-27 15:44:06 +00:00
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
2017-07-28 19:18:29 +00:00
SkScalar conicWeight() const
< / pre >
2017-08-29 21:36:51 +00:00
Returns < a href = "#Conic_Weight" > Conic Weight< / a > if < a href = "#SkPath_RawIter_next" > next< / a > returned < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > .
2017-07-28 19:18:29 +00:00
2017-08-29 21:36:51 +00:00
If < a href = "#SkPath_RawIter_next" > next< / a > has not been called, or < a href = "#SkPath_RawIter_next" > next< / a > did not return < a href = "#SkPath_kConic_Verb" > kConic Verb< / a > ,
2017-07-28 19:18:29 +00:00
result is undefined.
### Return Value
2018-02-15 22:31:24 +00:00
< a href = "#Conic_Weight" > Conic Weight< / a > for < a href = "#Conic" > Conic< / a > < a href = "SkPoint_Reference#Point" > Points< / a > returned by < a href = "#SkPath_RawIter_next" > next< / a >
2017-07-28 19:18:29 +00:00
### Example
< div > < fiddle-embed name = "9747e8177a50ea551471ba0b706f544b" >
#### Example Output
~~~~
first verb is move
next verb is conic
conic points: {0,0}, {1,2}, {3,4}
conic weight: 0.5
~~~~
< / fiddle-embed > < / div >
### See Also
2017-08-25 15:51:49 +00:00
< a href = "#Conic_Weight" > Conic Weight< / a >
2017-07-28 19:18:29 +00:00
---