2018-06-27 15:00:21 +00:00
SkRRect Reference
===
# <a name='RRect'>RRect</a>
# <a name='SkRRect'>Class SkRRect</a>
## <a name='Constant'>Constant</a>
SkRRect related constants are defined by < code > enum< / code > , < code > enum class< / code > , < code > #define< / code > , < code > const< / code > , and < code > constexpr< / code > .
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Topic</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_Corner' > Corner</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > corner radii order</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_Type' > Type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > specialization of < a href = '#RRect' > Round Rect</ a > geometry</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kComplex_Type' > kComplex Type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > non-zero width and height with arbitrary radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kEmpty_Type' > kEmpty Type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > zero width or height</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kLastType' > kLastType</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > largest < a href = '#SkRRect_Type' > Type</ a > value</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kLowerLeft_Corner' > kLowerLeft Corner</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > index of bottom-left corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kLowerRight_Corner' > kLowerRight Corner</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > index of bottom-right corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kNinePatch_Type' > kNinePatch Type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > non-zero width and height with axis-aligned radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kOval_Type' > kOval Type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > non-zero width and height filled with radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kRect_Type' > kRect Type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > non-zero width and height, and zeroed radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kSimple_Type' > kSimple Type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > non-zero width and height with equal radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kSizeInMemory' > kSizeInMemory</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > storage space for < a href = '#RRect' > Round Rect</ a ></ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kUpperLeft_Corner' > kUpperLeft Corner</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > index of top-left corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_kUpperRight_Corner' > kUpperRight Corner</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > index of top-right corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
2018-06-28 12:50:35 +00:00
## <a name='Related_Function'>Related_Function</a>
SkRRect global, < code > struct< / code > , and < code > class< / code > related member functions share a topic.
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Topic</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_Type' > Type</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > specialization of < a href = '#RRect' > Round Rect</ a > geometry</ td >
< / tr >
< / table >
2018-07-11 20:18:41 +00:00
< a href = '#SkRRect' > SkRRect< / a > describes a rounded rectangle with a bounds and a pair of radii for each corner.
The bounds and radii can be set so that < a href = '#SkRRect' > SkRRect< / a > describes a rectangle with sharp corners,
a < a href = 'undocumented#Circle' > Circle< / a > , an < a href = 'undocumented#Oval' > Oval< / a > , or a rectangle with one or more rounded corners.
2018-06-27 15:00:21 +00:00
2018-07-11 20:18:41 +00:00
< a href = '#SkRRect' > SkRRect< / a > allows implementing CSS properties that describe rounded corners.
< a href = '#SkRRect' > SkRRect< / a > may have up to eight different radii, one for each axis on each of its four
2018-06-27 15:00:21 +00:00
corners.
2018-07-11 20:18:41 +00:00
< a href = '#SkRRect' > SkRRect< / a > may modify the provided parameters when initializing bounds and radii.
If either axis radii is zero or less, radii are stored as zero; corner is square.
If corner curves overlap, radii are proportionally reduced to fit within bounds.
2018-06-27 15:00:21 +00:00
## Overview
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Topic</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#Constant' > Constants</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > enum and enum class, and their const values</ td >
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#Constructor' > Constructors</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > functions that construct < a href = '#SkRRect' > SkRRect</ a ></ td >
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#Member_Function' > Functions</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > global and class member functions</ td >
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#Operator' > Operators</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > operator overloading methods</ td >
< / tr >
2018-06-28 12:50:35 +00:00
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#Related_Function' > Related Functions</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > similar member functions grouped together</ td >
< / tr >
2018-06-27 15:00:21 +00:00
< / table >
## <a name='Constructor'>Constructor</a>
SkRRect can be constructed or initialized by these functions, including C++ class constructors.
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Topic</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeEmpty' > MakeEmpty</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > creates with zeroed bounds and corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeOval' > MakeOval</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > creates < a href = 'undocumented#Oval' > Oval</ a > to fit bounds</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeRect' > MakeRect</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > copies bounds and zeroes corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeRectXY' > MakeRectXY</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > creates rounded rectangle</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_empty_constructor' > SkRRect()</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > creates with zeroed bounds and corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_copy_const_SkRRect' > SkRRect(const SkRRect& rrect)</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > copies bounds and corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_makeOffset' > makeOffset</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > offsets bounds and radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
## <a name='Operator'>Operator</a>
SkRRect operators inline class member functions with arithmetic equivalents.
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Topic</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_notequal_operator' > operator!=(const SkRRect& a, const SkRRect& b)</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if members are unequal</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_copy_operator' > operator=(const SkRRect& rrect)</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > copies bounds and corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_equal_operator' > operator==(const SkRRect& a, const SkRRect& b)</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if members are equal</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
## <a name='Member_Function'>Member Function</a>
SkRRect member functions read and modify the structure properties.
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Topic</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeEmpty' > MakeEmpty</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > creates with zeroed bounds and corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeOval' > MakeOval</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > creates < a href = 'undocumented#Oval' > Oval</ a > to fit bounds</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeRect' > MakeRect</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > copies bounds and zeroes corner radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_MakeRectXY' > MakeRectXY</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > creates rounded rectangle</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_contains' > contains</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if < a href = 'SkRect_Reference#Rect' > Rect</ a > is inside</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_dump_2' > dump</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > sends text representation to standard output</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_dumpHex' > dumpHex</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > sends text representation using hexadecimal to standard output</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_getBounds' > getBounds</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns bounds</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_getSimpleRadii' > getSimpleRadii</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns corner radii for simple types</ td >
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_getType' > getType</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns < a href = '#SkRRect_Type' > Type</ a ></ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_height' > height</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns span in y-axis</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_inset' > inset</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > insets bounds and radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_isComplex' > isComplex</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if not empty, < a href = 'SkRect_Reference#Rect' > Rect</ a > , < a href = 'undocumented#Oval' > Oval</ a > , simple, or nine-patch</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_isEmpty' > isEmpty</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if width or height are zero</ td >
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_isNinePatch' > isNinePatch</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if not empty, < a href = 'SkRect_Reference#Rect' > Rect</ a > , < a href = 'undocumented#Oval' > Oval</ a > or simple; and radii are axis-aligned</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_isOval' > isOval</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if not empty, axes radii are equal, radii fill bounds</ td >
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_isRect' > isRect</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if not empty, and one radius at each corner is zero</ td >
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_isSimple' > isSimple</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns true if not empty, < a href = 'SkRect_Reference#Rect' > Rect</ a > or < a href = 'undocumented#Oval' > Oval</ a > ; and axes radii are equal</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_isValid' > isValid</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns if < a href = '#SkRRect_type' > type</ a > matches bounds and radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_makeOffset' > makeOffset</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > offsets bounds and radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_offset' > offset</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > offsets bounds and radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_outset' > outset</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > outsets bounds and radii</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_radii' > radii</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns x-axis and y-axis radii for one corner</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_readFromMemory' > readFromMemory</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > reads < a href = '#RRect' > Round Rect</ a > from buffer</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_rect' > rect</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns bounds</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_setEmpty' > setEmpty</ a ></ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > zeroes width, height, and corner radii</ td >
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_setNinePatch' > setNinePatch</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > replaces with rounded rectangle</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_setOval' > setOval</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > replaces with < a href = 'undocumented#Oval' > Oval</ a > to fit bounds</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_setRect' > setRect</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > sets < a href = '#RRect' > Round Rect</ a > bounds with zeroed corners</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_setRectRadii' > setRectRadii</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > replaces with rounded rectangle</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_setRectXY' > setRectXY</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > replaces with rounded rectangle</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_transform' > transform</ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > scales and offsets into copy</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_type' > type</ a ></ td >
2018-06-28 12:50:35 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns < a href = '#SkRRect_Type' > Type</ a ></ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_width' > width</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > returns span in x-axis</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a href = '#SkRRect_writeToMemory' > writeToMemory</ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > writes < a href = '#RRect' > Round Rect</ a > to buffer</ td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
< a name = 'SkRRect_empty_constructor' > < / a >
## SkRRect
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect' > SkRRect< / a > ()
2018-06-27 15:00:21 +00:00
< / pre >
2018-06-28 12:50:35 +00:00
Initializes bounds at (0, 0), the origin, with zero width and height.
Initializes corner radii to (0, 0), and sets type of < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
2018-06-27 15:00:21 +00:00
### Return Value
2018-06-28 12:50:35 +00:00
empty < a href = '#RRect' > Round Rect< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 12:50:35 +00:00
< div > < fiddle-embed name = "471e7aad0feaf9ec3a21757a317a64f5" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_setEmpty' > setEmpty< / a > < a href = '#SkRRect_isEmpty' > isEmpty< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_copy_const_SkRRect' > < / a >
## SkRRect
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect' > SkRRect< / a > (const < a href = '#SkRRect' > SkRRect< / a > & rrect)
2018-06-27 15:00:21 +00:00
< / pre >
2018-06-28 12:50:35 +00:00
Initializes to copy of < a href = '#SkRRect_copy_const_SkRRect_rrect' > rrect< / a > bounds and corner radii.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_copy_const_SkRRect_rrect' > < code > < strong > rrect< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds and corner to copy< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 12:50:35 +00:00
copy of < a href = '#SkRRect_copy_const_SkRRect_rrect' > rrect< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "ad8f5d49edfcee60eddfe2a955b6c5f5" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_copy_operator' > operator=(const SkRRect& rrect)< / a > < a href = '#SkRRect_MakeRect' > MakeRect< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_copy_operator' > < / a >
## operator=
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect' > SkRRect< / a > & < a href = '#SkRRect_copy_operator' > operator=(const SkRRect& rrect)< / a >
2018-06-27 15:00:21 +00:00
< / pre >
2018-06-28 12:50:35 +00:00
Copies < a href = '#SkRRect_copy_operator_rrect' > rrect< / a > bounds and corner radii.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_copy_operator_rrect' > < code > < strong > rrect< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds and corner to copy< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 12:50:35 +00:00
copy of < a href = '#SkRRect_copy_operator_rrect' > rrect< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "52926c98c1cca00606d3ea99f23fea3d" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_copy_const_SkRRect' > SkRRect(const SkRRect& rrect)< / a > < a href = '#SkRRect_MakeRect' > MakeRect< / a >
2018-06-27 15:00:21 +00:00
---
2018-06-28 12:50:35 +00:00
## <a name='Type'>Type</a>
2018-06-27 15:00:21 +00:00
## <a name='SkRRect_Type'>Enum SkRRect::Type</a>
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
enum < a href = '#SkRRect_Type' > Type< / a > {
< a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > ,
< a href = '#SkRRect_kRect_Type' > kRect Type< / a > ,
< a href = '#SkRRect_kOval_Type' > kOval Type< / a > ,
< a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > ,
< a href = '#SkRRect_kNinePatch_Type' > kNinePatch Type< / a > ,
< a href = '#SkRRect_kComplex_Type' > kComplex Type< / a > ,
< a href = '#SkRRect_kLastType' > kLastType< / a > = < a href = '#SkRRect_kComplex_Type' > kComplex Type< / a > ,
};
< / pre >
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_Type' > Type< / a > describes possible specializations of < a href = '#RRect' > Round Rect< / a > . Each < a href = '#SkRRect_Type' > Type< / a > is
exclusive; a < a href = '#RRect' > Round Rect< / a > may only have one type.
2018-07-11 20:18:41 +00:00
< a href = '#SkRRect_Type' > Type< / a > members become progressively less restrictive; larger values of
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_Type' > Type< / a > have more degrees of freedom than smaller values.
2018-06-27 15:00:21 +00:00
### Constants
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Const</ th >
< th style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > Value</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kEmpty_Type' >< code > SkRRect::kEmpty_Type</ code ></ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 0</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
< a href = '#RRect' > Round Rect< / a > has zero width or height. All radii are zero.
< / td >
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kRect_Type' >< code > SkRRect::kRect_Type</ code ></ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 1</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
< a href = '#RRect' > Round Rect< / a > has width and height. All radii are zero.
< / td >
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kOval_Type' >< code > SkRRect::kOval_Type</ code ></ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 2</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
< a href = '#RRect' > Round Rect< / a > has width and height. All four x-radii are equal,
and at least half the width. All four y-radii are equal,
and at least half the height.
< / td >
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kSimple_Type' >< code > SkRRect::kSimple_Type</ code ></ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 3</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
< a href = '#RRect' > Round Rect< / a > has width and height. All four x-radii are equal and
greater than zero, and all four y-radii are equal and greater than
zero. Either x-radii are less than half the width, or y-radii is
less than half the height, or both.
< / td >
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kNinePatch_Type' >< code > SkRRect::kNinePatch_Type</ code ></ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 4</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
< a href = '#RRect' > Round Rect< / a > has width and height. Left x-radii are equal, top
y-radii are equal, right x-radii are equal, and bottom y-radii
2018-06-28 12:50:35 +00:00
are equal. The radii do not describe a rect, oval, or simple type.
2018-06-27 15:00:21 +00:00
The centers of the corner ellipses form an axis-aligned rectangle
that divides the < a href = '#RRect' > Round Rect< / a > into nine rectangular patches; an
interior rectangle, four edges, and four corners.
< / td >
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kComplex_Type' >< code > SkRRect::kComplex_Type</ code ></ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 5</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
both radii are non-zero.
< / td >
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kLastType' >< code > SkRRect::kLastType</ code ></ a ></ td >
2018-07-11 20:18:41 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 5</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
2018-06-28 12:50:35 +00:00
largest Type value< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 12:50:35 +00:00
< div > < fiddle-embed name = "38a559936ea7c8d482098c189ee5c9b8" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = 'SkRect_Reference#Rect' > Rect< / a > < a href = 'SkPath_Reference#Path' > Path< / a >
2018-06-27 15:00:21 +00:00
< a name = 'SkRRect_getType' > < / a >
## getType
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
< a href = '#SkRRect_Type' > Type< / a > < a href = '#SkRRect_getType' > getType< / a > () const
< / pre >
2018-06-28 12:50:35 +00:00
Returns < a href = '#SkRRect_Type' > Type< / a > , one of: < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > , < a href = '#SkRRect_kRect_Type' > kRect Type< / a > , < a href = '#SkRRect_kOval_Type' > kOval Type< / a > , < a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > , < a href = '#SkRRect_kNinePatch_Type' > kNinePatch Type< / a > ,
< a href = '#SkRRect_kComplex_Type' > kComplex Type< / a > .
2018-06-27 15:00:21 +00:00
### Return Value
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_Type' > Type< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "ace8f4aebf90527d43e4b7291375c9ad" > < div > rrect2 is not a < a href = 'SkRect_Reference#Rect' > Rect< / a > ; < a href = '#SkRRect_inset' > inset< / a > has made it empty.
2018-06-28 12:50:35 +00:00
< / div > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_Type' > Type< / a > < a href = '#SkRRect_type' > type< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_type' > < / a >
## type
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
< a href = '#SkRRect_Type' > Type< / a > < a href = '#SkRRect_type' > type< / a > () const
< / pre >
2018-06-28 12:50:35 +00:00
Returns < a href = '#SkRRect_Type' > Type< / a > , one of: < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > , < a href = '#SkRRect_kRect_Type' > kRect Type< / a > , < a href = '#SkRRect_kOval_Type' > kOval Type< / a > , < a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > , < a href = '#SkRRect_kNinePatch_Type' > kNinePatch Type< / a > ,
< a href = '#SkRRect_kComplex_Type' > kComplex Type< / a > .
2018-06-27 15:00:21 +00:00
### Return Value
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_Type' > Type< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "1080805c8449406a4e26d694bc56d2dc" > < div > < a href = '#SkRRect_inset' > inset< / a > has made rrect2 empty.
2018-06-28 12:50:35 +00:00
< / div > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_Type' > Type< / a > < a href = '#SkRRect_getType' > getType< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_isEmpty' > < / a >
## isEmpty
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
inline bool < a href = '#SkRRect_isEmpty' > isEmpty< / a > () const
< / pre >
Returns true if < a href = '#SkRRect_rect' > rect< / a > .fLeft is equal to < a href = '#SkRRect_rect' > rect< / a > .fRight, or if < a href = '#SkRRect_rect' > rect< / a > .fTop is equal
to < a href = '#SkRRect_rect' > rect< / a > .fBottom.
### Return Value
true if < a href = '#SkRRect_width' > width< / a > or < a href = '#SkRRect_height' > height< / a > are zero
### Example
2018-07-16 05:29:00 +00:00
< div > < fiddle-embed name = "3afe4ea247923e06326aeb2b165c7485" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
< a href = 'SkRect_Reference#SkRect_isEmpty' > SkRect::isEmpty< / a > < a href = '#SkRRect_height' > height< / a > < a href = '#SkRRect_width' > width< / a >
---
< a name = 'SkRRect_isRect' > < / a >
## isRect
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
inline bool < a href = '#SkRRect_isRect' > isRect< / a > () const
< / pre >
2018-07-11 20:18:41 +00:00
Returns true if not empty, and if either x-axis or y-axis radius at each corner
is zero.
2018-06-27 15:00:21 +00:00
### Return Value
true if not empty, and one radius at each corner is zero
### Example
< div > < fiddle-embed name = "e2dcdad0e9cb7ba3e78a9871e9229753" > < / fiddle-embed > < / div >
### See Also
< a href = '#SkRRect_isEmpty' > isEmpty< / a > < a href = '#SkRRect_radii' > radii< / a >
---
< a name = 'SkRRect_isOval' > < / a >
## isOval
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
inline bool < a href = '#SkRRect_isOval' > isOval< / a > () const
< / pre >
Returns true if not empty, if all x-axis radii are equal, if all y-axis radii
are equal, x-axis radii are at least half the width, and y-axis radii are at
least half the height.
### Return Value
true if has identical geometry to < a href = 'undocumented#Oval' > Oval< / a >
### Example
2018-07-04 05:33:26 +00:00
< div > < fiddle-embed name = "ab9b3aef7896aee80b780789848fbba4" > < div > The first radii are scaled down proportionately until both x-axis and y-axis fit
2018-06-27 15:00:21 +00:00
within the bounds. After scaling, x-axis radius is smaller than half the width;
2018-07-11 20:18:41 +00:00
left < a href = '#RRect' > Round Rect< / a > is not an oval. The second radii are equal to half the
dimensions; right < a href = '#RRect' > Round Rect< / a > is an oval.
2018-06-27 15:00:21 +00:00
< / div > < / fiddle-embed > < / div >
### See Also
< a href = '#SkRRect_isEmpty' > isEmpty< / a > < a href = '#SkRRect_isSimple' > isSimple< / a > < a href = 'SkCanvas_Reference#SkCanvas_drawOval' > SkCanvas::drawOval< / a >
---
< a name = 'SkRRect_isSimple' > < / a >
## isSimple
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
inline bool < a href = '#SkRRect_isSimple' > isSimple< / a > () const
< / pre >
Returns true if not empty, if all x-axis radii are equal but not zero,
if all y-axis radii are equal but not zero; and x-axis radius is less than half
< a href = '#SkRRect_width' > width< / a > , or y-axis radius is less than half < a href = '#SkRRect_height' > height< / a > .
### Return Value
2018-07-11 20:18:41 +00:00
true if not empty, < a href = 'SkRect_Reference#Rect' > Rect< / a > or < a href = 'undocumented#Oval' > Oval< / a > ; and axes radii are equal
2018-06-27 15:00:21 +00:00
### Example
< div > < fiddle-embed name = "65bbb109483ed79edb32027cf71851eb" > < / fiddle-embed > < / div >
### See Also
< a href = '#SkRRect_isEmpty' > isEmpty< / a > < a href = '#SkRRect_isRect' > isRect< / a > < a href = '#SkRRect_isOval' > isOval< / a > < a href = '#SkRRect_isNinePatch' > isNinePatch< / a >
---
< a name = 'SkRRect_isNinePatch' > < / a >
## isNinePatch
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
inline bool < a href = '#SkRRect_isNinePatch' > isNinePatch< / a > () const
< / pre >
Returns true if < a href = '#SkRRect_isEmpty' > isEmpty< / a > , < a href = '#SkRRect_isRect' > isRect< / a > , < a href = '#SkRRect_isOval' > isOval< / a > , and < a href = '#SkRRect_isSimple' > isSimple< / a > return false; and if
left x-axis radii are equal, right x-axis radii are equal, top y-axis radii are
equal, and bottom y-axis radii are equal.
### Return Value
2018-07-11 20:18:41 +00:00
true if not empty, < a href = 'SkRect_Reference#Rect' > Rect< / a > , < a href = 'undocumented#Oval' > Oval< / a > or simple; and radii are axis-aligned
2018-06-27 15:00:21 +00:00
### Example
< div > < fiddle-embed name = "568cb730e66d0df09a7d9bd9d6142c9e" > < / fiddle-embed > < / div >
### See Also
< a href = '#SkRRect_isEmpty' > isEmpty< / a > < a href = '#SkRRect_isRect' > isRect< / a > < a href = '#SkRRect_isOval' > isOval< / a > < a href = '#SkRRect_isSimple' > isSimple< / a > < a href = '#SkRRect_isComplex' > isComplex< / a >
---
< a name = 'SkRRect_isComplex' > < / a >
## isComplex
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
inline bool < a href = '#SkRRect_isComplex' > isComplex< / a > () const
< / pre >
Returns true if < a href = '#SkRRect_isEmpty' > isEmpty< / a > , < a href = '#SkRRect_isRect' > isRect< / a > , < a href = '#SkRRect_isOval' > isOval< / a > , < a href = '#SkRRect_isSimple' > isSimple< / a > , and < a href = '#SkRRect_isNinePatch' > isNinePatch< / a > return false.
If true: width and height are greater than zero, at least one corner radii are
both greater than zero; left x-axis radii are not equal, or right x-axis radii
are not equal, or top y-axis radii are not equal, or bottom y-axis radii are not
equal.
### Return Value
2018-07-11 20:18:41 +00:00
true if not empty, < a href = 'SkRect_Reference#Rect' > Rect< / a > , < a href = 'undocumented#Oval' > Oval< / a > , simple, or nine-patch
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "e4ba9346ee5c2d37d5e504f8cc678544" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
< a href = '#SkRRect_isEmpty' > isEmpty< / a > < a href = '#SkRRect_isRect' > isRect< / a > < a href = '#SkRRect_isOval' > isOval< / a > < a href = '#SkRRect_isSimple' > isSimple< / a > < a href = '#SkRRect_isNinePatch' > isNinePatch< / a >
---
< a name = 'SkRRect_width' > < / a >
## width
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
< a href = 'undocumented#SkScalar' > SkScalar< / a > < a href = '#SkRRect_width' > width< / a > () const
< / pre >
Returns span on the x-axis. This does not check if result fits in 32-bit float;
result may be infinity.
### Return Value
bounds().fRight minus bounds().fLeft
### Example
< div > < fiddle-embed name = "c675a480b41dee157f84fa2550a2a53c" > < div > < a href = '#SkRRect_MakeRect' > SkRRect::MakeRect< / a > sorts its input, so < a href = '#SkRRect_width' > width< / a > is always zero or larger.
< / div >
#### Example Output
~~~~
unsorted width: 5
large width: inf
~~~~
< / fiddle-embed > < / div >
### See Also
< a href = 'SkRect_Reference#SkRect_width' > SkRect::width< / a > < a href = '#SkRRect_height' > height< / a > < a href = '#SkRRect_getBounds' > getBounds< / a >
---
< a name = 'SkRRect_height' > < / a >
## height
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
< a href = 'undocumented#SkScalar' > SkScalar< / a > < a href = '#SkRRect_height' > height< / a > () const
< / pre >
Returns span on the y-axis. This does not check if result fits in 32-bit float;
result may be infinity.
### Return Value
bounds().fBottom minus bounds().fTop
### Example
< div > < fiddle-embed name = "5a3eb1755164a7becec33cec6e6eca31" > < div > < a href = '#SkRRect_MakeRect' > SkRRect::MakeRect< / a > sorts its input, so < a href = '#SkRRect_height' > height< / a > is always zero or larger.
< / div >
#### Example Output
~~~~
unsorted height: 5
large height: inf
~~~~
< / fiddle-embed > < / div >
### See Also
< a href = 'SkRect_Reference#SkRect' > SkRect< / a > .< a href = '#SkRRect_height' > height< / a > < a href = '#SkRRect_width' > width< / a > < a href = '#SkRRect_getBounds' > getBounds< / a >
---
< a name = 'SkRRect_getSimpleRadii' > < / a >
## getSimpleRadii
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
< a href = 'SkPoint_Reference#SkVector' > SkVector< / a > < a href = '#SkRRect_getSimpleRadii' > getSimpleRadii< / a > () const
< / pre >
Returns top-left corner x-radii. If < a href = '#SkRRect_type' > type< / a > returns < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > , < a href = '#SkRRect_kRect_Type' > kRect Type< / a > ,
< a href = '#SkRRect_kOval_Type' > kOval Type< / a > , or < a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > , returns a value representative of all corner radii.
If < a href = '#SkRRect_type' > type< / a > returns < a href = '#SkRRect_kNinePatch_Type' > kNinePatch Type< / a > or < a href = '#SkRRect_kComplex_Type' > kComplex Type< / a > , at least one of the
remaining three corners has a different value.
### Return Value
corner radii for simple types
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "ebcc50ed30240e94de8439d21dd8171c" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
< a href = '#SkRRect_radii' > radii< / a > < a href = '#SkRRect_getBounds' > getBounds< / a > < a href = '#SkRRect_getType' > getType< / a > < a href = '#SkRRect_isSimple' > isSimple< / a >
---
< a name = 'SkRRect_setEmpty' > < / a >
## setEmpty
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_setEmpty' > setEmpty< / a > ()
< / pre >
Sets bounds to zero width and height at (0, 0), the origin. Sets
corner radii to zero and sets type to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "44e9a9c2c5ef1af2a616086ff46a9037" > < div > Nothing blue is drawn because < a href = '#RRect' > Round Rect< / a > is set to empty.
2018-06-27 15:00:21 +00:00
< / div > < / fiddle-embed > < / div >
### See Also
< a href = '#SkRRect_MakeEmpty' > MakeEmpty< / a > < a href = '#SkRRect_setRect' > setRect< / a >
---
< a name = 'SkRRect_setRect' > < / a >
## setRect
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_setRect' > setRect< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & rect)
< / pre >
Sets bounds to sorted rect, and sets corner radii to zero.
If set bounds has width and height, and sets type to < a href = '#SkRRect_kRect_Type' > kRect Type< / a > ;
otherwise, sets type to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
### Parameters
< table > < tr > < td > < a name = 'SkRRect_setRect_rect' > < code > < strong > rect< / strong > < / code > < / a > < / td >
< td > bounds to set< / td >
< / tr >
< / table >
### Example
2018-06-28 12:50:35 +00:00
< div > < fiddle-embed name = "3afc3ac9bebd1d7387822cc608571e82" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
< a href = '#SkRRect_MakeRect' > MakeRect< / a > < a href = '#SkRRect_setRectXY' > setRectXY< / a >
---
< a name = 'SkRRect_MakeEmpty' > < / a >
## MakeEmpty
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
static < a href = '#SkRRect' > SkRRect< / a > < a href = '#SkRRect_MakeEmpty' > MakeEmpty< / a > ()
< / pre >
2018-06-28 12:50:35 +00:00
Initializes bounds at (0, 0), the origin, with zero width and height.
Initializes corner radii to (0, 0), and sets type of < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
2018-06-27 15:00:21 +00:00
### Return Value
2018-06-28 12:50:35 +00:00
empty < a href = '#RRect' > Round Rect< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 12:50:35 +00:00
< div > < fiddle-embed name = "c6c6be3b3c137226adbb5b5af9203d27" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_empty_constructor' > SkRRect()< / a > < a href = 'SkRect_Reference#SkRect_MakeEmpty' > SkRect::MakeEmpty< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_MakeRect' > < / a >
## MakeRect
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
static < a href = '#SkRRect' > SkRRect< / a > < a href = '#SkRRect_MakeRect' > MakeRect< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & r)
< / pre >
2018-06-28 12:50:35 +00:00
Initializes to copy of < a href = '#SkRRect_MakeRect_r' > r< / a > bounds and zeroes corner radii.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_MakeRect_r' > < code > < strong > r< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds to copy< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 12:50:35 +00:00
copy of < a href = '#SkRRect_MakeRect_r' > r< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 12:50:35 +00:00
< div > < fiddle-embed name = "5295b07fe4d2cdcd077979a9e19854d9" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_setRect' > setRect< / a > < a href = '#SkRRect_MakeOval' > MakeOval< / a > < a href = '#SkRRect_MakeRectXY' > MakeRectXY< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_MakeOval' > < / a >
## MakeOval
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
static < a href = '#SkRRect' > SkRRect< / a > < a href = '#SkRRect_MakeOval' > MakeOval< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & oval)
< / pre >
2018-06-28 12:50:35 +00:00
Sets bounds to < a href = '#SkRRect_MakeOval_oval' > oval< / a > , x-axis radii to half < a href = '#SkRRect_MakeOval_oval' > oval< / a > .< a href = '#SkRRect_width' > width< / a > , and all y-axis radii
2018-07-11 20:18:41 +00:00
to half < a href = '#SkRRect_MakeOval_oval' > oval< / a > .< a href = '#SkRRect_height' > height< / a > . If < a href = '#SkRRect_MakeOval_oval' > oval< / a > bounds is empty, sets to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
2018-06-28 12:50:35 +00:00
Otherwise, sets to < a href = '#SkRRect_kOval_Type' > kOval Type< / a > .
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_MakeOval_oval' > < code > < strong > oval< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds of < a href = 'undocumented#Oval' > Oval< / a > < / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 12:50:35 +00:00
< a href = 'undocumented#Oval' > Oval< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-16 12:12:01 +00:00
< div > < fiddle-embed name = "0b99ee38fd154f769f6031242e02fa7a" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_setOval' > setOval< / a > < a href = '#SkRRect_MakeRect' > MakeRect< / a > < a href = '#SkRRect_MakeRectXY' > MakeRectXY< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_MakeRectXY' > < / a >
## MakeRectXY
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
static < a href = '#SkRRect' > SkRRect< / a > < a href = '#SkRRect_MakeRectXY' > MakeRectXY< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & rect, < a href = 'undocumented#SkScalar' > SkScalar< / a > xRad, < a href = 'undocumented#SkScalar' > SkScalar< / a > yRad)
< / pre >
2018-06-28 12:50:35 +00:00
Sets to rounded rectangle with the same radii for all four corners.
If rect is empty, sets to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
Otherwise, if < a href = '#SkRRect_MakeRectXY_xRad' > xRad< / a > and < a href = '#SkRRect_MakeRectXY_yRad' > yRad< / a > are zero, sets to < a href = '#SkRRect_kRect_Type' > kRect Type< / a > .
Otherwise, if < a href = '#SkRRect_MakeRectXY_xRad' > xRad< / a > is at least half rect.< a href = '#SkRRect_width' > width< / a > and < a href = '#SkRRect_MakeRectXY_yRad' > yRad< / a > is at least half
rect.< a href = '#SkRRect_height' > height< / a > , sets to < a href = '#SkRRect_kOval_Type' > kOval Type< / a > .
Otherwise, sets to < a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > .
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_MakeRectXY_rect' > < code > < strong > rect< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds of rounded rectangle< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_MakeRectXY_xRad' > < code > < strong > xRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > x-axis radius of corners< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_MakeRectXY_yRad' > < code > < strong > yRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > y-axis radius of corners< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 12:50:35 +00:00
rounded rectangle
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 12:50:35 +00:00
< div > < fiddle-embed name = "2b24a1247637cbc94f8b3c77d37ed3e2" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_setRectXY' > setRectXY< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_setOval' > < / a >
## setOval
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_setOval' > setOval< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & oval)
< / pre >
2018-06-28 12:50:35 +00:00
Sets bounds to < a href = '#SkRRect_setOval_oval' > oval< / a > , x-axis radii to half < a href = '#SkRRect_setOval_oval' > oval< / a > .< a href = '#SkRRect_width' > width< / a > , and all y-axis radii
2018-07-11 20:18:41 +00:00
to half < a href = '#SkRRect_setOval_oval' > oval< / a > .< a href = '#SkRRect_height' > height< / a > . If < a href = '#SkRRect_setOval_oval' > oval< / a > bounds is empty, sets to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
2018-06-28 12:50:35 +00:00
Otherwise, sets to < a href = '#SkRRect_kOval_Type' > kOval Type< / a > .
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_setOval_oval' > < code > < strong > oval< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds of < a href = 'undocumented#Oval' > Oval< / a > < / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 12:50:35 +00:00
< div > < fiddle-embed name = "cf418af29cbab6243ac16aacd1217ffe" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_MakeOval' > MakeOval< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_setRectXY' > < / a >
## setRectXY
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_setRectXY' > setRectXY< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & rect, < a href = 'undocumented#SkScalar' > SkScalar< / a > xRad, < a href = 'undocumented#SkScalar' > SkScalar< / a > yRad)
< / pre >
2018-06-28 12:50:35 +00:00
Sets to rounded rectangle with the same radii for all four corners.
If rect is empty, sets to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
Otherwise, if < a href = '#SkRRect_setRectXY_xRad' > xRad< / a > or < a href = '#SkRRect_setRectXY_yRad' > yRad< / a > is zero, sets to < a href = '#SkRRect_kRect_Type' > kRect Type< / a > .
Otherwise, if < a href = '#SkRRect_setRectXY_xRad' > xRad< / a > is at least half rect.< a href = '#SkRRect_width' > width< / a > and < a href = '#SkRRect_setRectXY_yRad' > yRad< / a > is at least half
rect.< a href = '#SkRRect_height' > height< / a > , sets to < a href = '#SkRRect_kOval_Type' > kOval Type< / a > .
Otherwise, sets to < a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > .
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_setRectXY_rect' > < code > < strong > rect< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds of rounded rectangle< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_setRectXY_xRad' > < code > < strong > xRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > x-axis radius of corners< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_setRectXY_yRad' > < code > < strong > yRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > y-axis radius of corners< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-07-04 05:33:26 +00:00
< div > < fiddle-embed name = "6ac569e40fb68c758319e85428b9ae95" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_MakeRectXY' > MakeRectXY< / a > < a href = 'SkPath_Reference#SkPath_addRoundRect' > SkPath::addRoundRect< / a > < sup > < a href = 'SkPath_Reference#SkPath_addRoundRect_2' > [2]< / a > < / sup >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_setNinePatch' > < / a >
## setNinePatch
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_setNinePatch' > setNinePatch< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & rect, < a href = 'undocumented#SkScalar' > SkScalar< / a > leftRad, < a href = 'undocumented#SkScalar' > SkScalar< / a > topRad, < a href = 'undocumented#SkScalar' > SkScalar< / a > rightRad,
< a href = 'undocumented#SkScalar' > SkScalar< / a > bottomRad)
< / pre >
2018-06-28 12:50:35 +00:00
Sets bounds to rect. Sets radii to (< a href = '#SkRRect_setNinePatch_leftRad' > leftRad< / a > , < a href = '#SkRRect_setNinePatch_topRad' > topRad< / a > ), (< a href = '#SkRRect_setNinePatch_rightRad' > rightRad< / a > , < a href = '#SkRRect_setNinePatch_topRad' > topRad< / a > ),
(< a href = '#SkRRect_setNinePatch_rightRad' > rightRad< / a > , < a href = '#SkRRect_setNinePatch_bottomRad' > bottomRad< / a > ), (< a href = '#SkRRect_setNinePatch_leftRad' > leftRad< / a > , < a href = '#SkRRect_setNinePatch_bottomRad' > bottomRad< / a > ).
If rect is empty, sets to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
Otherwise, if < a href = '#SkRRect_setNinePatch_leftRad' > leftRad< / a > and < a href = '#SkRRect_setNinePatch_rightRad' > rightRad< / a > are zero, sets to < a href = '#SkRRect_kRect_Type' > kRect Type< / a > .
Otherwise, if < a href = '#SkRRect_setNinePatch_topRad' > topRad< / a > and < a href = '#SkRRect_setNinePatch_bottomRad' > bottomRad< / a > are zero, sets to < a href = '#SkRRect_kRect_Type' > kRect Type< / a > .
Otherwise, if < a href = '#SkRRect_setNinePatch_leftRad' > leftRad< / a > and < a href = '#SkRRect_setNinePatch_rightRad' > rightRad< / a > are equal and at least half rect.< a href = '#SkRRect_width' > width< / a > , and
< a href = '#SkRRect_setNinePatch_topRad' > topRad< / a > and < a href = '#SkRRect_setNinePatch_bottomRad' > bottomRad< / a > are equal at least half rect.< a href = '#SkRRect_height' > height< / a > , sets to < a href = '#SkRRect_kOval_Type' > kOval Type< / a > .
Otherwise, if < a href = '#SkRRect_setNinePatch_leftRad' > leftRad< / a > and < a href = '#SkRRect_setNinePatch_rightRad' > rightRad< / a > are equal, and < a href = '#SkRRect_setNinePatch_topRad' > topRad< / a > and < a href = '#SkRRect_setNinePatch_bottomRad' > bottomRad< / a > are equal,
sets to < a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > . Otherwise, sets to < a href = '#SkRRect_kNinePatch_Type' > kNinePatch Type< / a > .
Nine patch refers to the nine parts defined by the radii: one center rectangle,
four edge patches, and four corner patches.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_setNinePatch_rect' > < code > < strong > rect< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds of rounded rectangle< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_setNinePatch_leftRad' > < code > < strong > leftRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > left-top and left-bottom x-axis radius< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_setNinePatch_topRad' > < code > < strong > topRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > left-top and right-top y-axis radius< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_setNinePatch_rightRad' > < code > < strong > rightRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > right-top and right-bottom x-axis radius< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_setNinePatch_bottomRad' > < code > < strong > bottomRad< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > left-bottom and right-bottom y-axis radius< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-07-07 05:34:31 +00:00
< div > < fiddle-embed name = "c4620df2eaba447b581688d3100053b1" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_setRectRadii' > setRectRadii< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_setRectRadii' > < / a >
## setRectRadii
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_setRectRadii' > setRectRadii< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & rect, const < a href = 'SkPoint_Reference#SkVector' > SkVector< / a > radii[4])
< / pre >
2018-06-28 12:50:35 +00:00
Sets bounds to rect. Sets radii array for individual control of all for corners.
If rect is empty, sets to < a href = '#SkRRect_kEmpty_Type' > kEmpty Type< / a > .
Otherwise, if one of each corner radii are zero, sets to < a href = '#SkRRect_kRect_Type' > kRect Type< / a > .
Otherwise, if all x-axis radii are equal and at least half rect.< a href = '#SkRRect_width' > width< / a > , and
all y-axis radii are equal at least half rect.< a href = '#SkRRect_height' > height< / a > , sets to < a href = '#SkRRect_kOval_Type' > kOval Type< / a > .
Otherwise, if all x-axis radii are equal, and all y-axis radii are equal,
sets to < a href = '#SkRRect_kSimple_Type' > kSimple Type< / a > . Otherwise, sets to < a href = '#SkRRect_kNinePatch_Type' > kNinePatch Type< / a > .
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_setRectRadii_rect' > < code > < strong > rect< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > bounds of rounded rectangle< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_setRectRadii_radii' > < code > < strong > radii< / strong > < / code > < / a > < / td >
2018-06-28 12:50:35 +00:00
< td > corner x-axis and y-axis radii< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "340d6c51efaa1f7f3d0dcaf8b0e90696" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 12:50:35 +00:00
< a href = '#SkRRect_setNinePatch' > setNinePatch< / a > < a href = 'SkPath_Reference#SkPath_addRoundRect' > SkPath::addRoundRect< / a > < sup > < a href = 'SkPath_Reference#SkPath_addRoundRect_2' > [2]< / a > < / sup >
2018-06-27 15:00:21 +00:00
---
## <a name='SkRRect_Corner'>Enum SkRRect::Corner</a>
< pre style = "padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0 " >
enum < a href = '#SkRRect_Corner' > Corner< / a > {
< a href = '#SkRRect_kUpperLeft_Corner' > kUpperLeft Corner< / a > ,
< a href = '#SkRRect_kUpperRight_Corner' > kUpperRight Corner< / a > ,
< a href = '#SkRRect_kLowerRight_Corner' > kLowerRight Corner< / a > ,
< a href = '#SkRRect_kLowerLeft_Corner' > kLowerLeft Corner< / a > ,
};
< / pre >
The radii are stored: top-left, top-right, bottom-right, bottom-left.
### Constants
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Const</ th >
< th style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > Value</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kUpperLeft_Corner' >< code > SkRRect::kUpperLeft_Corner</ code ></ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 0</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
2018-06-28 23:13:56 +00:00
index of top-left corner radii< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kUpperRight_Corner' >< code > SkRRect::kUpperRight_Corner</ code ></ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 1</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
2018-06-28 23:13:56 +00:00
index of top-right corner radii< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kLowerRight_Corner' >< code > SkRRect::kLowerRight_Corner</ code ></ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 2</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
2018-06-28 23:13:56 +00:00
index of bottom-right corner radii< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kLowerLeft_Corner' >< code > SkRRect::kLowerLeft_Corner</ code ></ a ></ td >
2018-06-28 23:13:56 +00:00
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 3</ td >
2018-06-27 15:00:21 +00:00
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
2018-06-28 23:13:56 +00:00
index of bottom-left corner radii< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "9205393f30b156e1507e88aa27f1dd91" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_radii' > radii< / a >
2018-06-27 15:00:21 +00:00
< a name = 'SkRRect_rect' > < / a >
## rect
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & < a href = '#SkRRect_rect' > rect< / a > () const
< / pre >
2018-06-28 23:13:56 +00:00
Returns bounds. Bounds may have zero width or zero height. Bounds right is
greater than or equal to left; bounds bottom is greater than or equal to top.
Result is identical to < a href = '#SkRRect_getBounds' > getBounds< / a > .
2018-06-27 15:00:21 +00:00
### Return Value
2018-06-28 23:13:56 +00:00
bounding box
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "6831adf4c536047f4709c686feb10c48" >
#### Example Output
~~~~
left bounds: (nan) 0
left bounds: (inf) 0
left bounds: (100) 60
left bounds: (50) 50
left bounds: (25) 25
~~~~
< / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_getBounds' > getBounds< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_radii' > < / a >
## radii
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
< a href = 'SkPoint_Reference#SkVector' > SkVector< / a > < a href = '#SkRRect_radii' > radii< / a > (< a href = '#SkRRect_Corner' > Corner< / a > corner) const
< / pre >
2018-06-28 23:13:56 +00:00
Returns < a href = 'undocumented#Scalar' > Scalar< / a > pair for radius of curve on x-axis and y-axis for one < a href = '#SkRRect_radii_corner' > corner< / a > .
Both radii may be zero. If not zero, both are positive and finite.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_radii_corner' > < code > < strong > corner< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > one of: < a href = '#SkRRect_kUpperLeft_Corner' > kUpperLeft Corner< / a > , < a href = '#SkRRect_kUpperRight_Corner' > kUpperRight Corner< / a > ,
< a href = '#SkRRect_kLowerRight_Corner' > kLowerRight Corner< / a > , < a href = '#SkRRect_kLowerLeft_Corner' > kLowerLeft Corner< / a > < / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 23:13:56 +00:00
x-axis and y-axis radii for one < a href = '#SkRRect_radii_corner' > corner< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 05:28:17 +00:00
< div > < fiddle-embed name = "8d5c88478528584913867ada423e0d59" > < div > Finite values are scaled proportionately to fit; other values are set to zero.
2018-07-11 20:18:41 +00:00
Scaled values cannot be larger than 25, half the bounding < a href = '#RRect' > Round Rect< / a > width.
2018-06-28 23:13:56 +00:00
Small scaled values are halved to scale in proportion to the y-axis < a href = '#SkRRect_radii_corner' > corner< / a >
radius, which is twice the bounds height.
< / div >
#### Example Output
~~~~
left corner: (nan) 0
left corner: (inf) 0
left corner: (100) 25
left corner: (50) 25
left corner: (25) 12.5
~~~~
< / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_Corner' > Corner< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_getBounds' > < / a >
## getBounds
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & < a href = '#SkRRect_getBounds' > getBounds< / a > () const
< / pre >
2018-06-28 23:13:56 +00:00
Returns bounds. Bounds may have zero width or zero height. Bounds right is
greater than or equal to left; bounds bottom is greater than or equal to top.
Result is identical to < a href = '#SkRRect_rect' > rect< / a > .
2018-06-27 15:00:21 +00:00
### Return Value
2018-06-28 23:13:56 +00:00
bounding box
2018-06-27 15:00:21 +00:00
### Example
2018-07-04 05:33:26 +00:00
< div > < fiddle-embed name = "4577e2dcb086b241bb43d8b89ee0b0dd" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_rect' > rect< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_equal_operator' > < / a >
## operator==
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
bool < a href = '#SkRRect_equal_operator' > operator==(const SkRRect& a, const SkRRect& b)< / a >
< / pre >
2018-06-28 23:13:56 +00:00
Returns true if bounds and radii in < a href = '#SkRRect_equal_operator_a' > a< / a > are equal to bounds and radii in < a href = '#SkRRect_equal_operator_b' > b< / a > .
< a href = '#SkRRect_equal_operator_a' > a< / a > and < a href = '#SkRRect_equal_operator_b' > b< / a > are not equal if either contain NaN. < a href = '#SkRRect_equal_operator_a' > a< / a > and < a href = '#SkRRect_equal_operator_b' > b< / a > are equal if members
contain zeroes width different signs.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_equal_operator_a' > < code > < strong > a< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > < a href = 'SkRect_Reference#Rect' > Rect< / a > bounds and radii to compare< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_equal_operator_b' > < code > < strong > b< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > < a href = 'SkRect_Reference#Rect' > Rect< / a > bounds and radii to compare< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 23:13:56 +00:00
true if members are equal
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "df181af37f1d2b06f0f45af73df7b47d" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_notequal_operator' > operator!=(const SkRRect& a, const SkRRect& b)< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_notequal_operator' > < / a >
## operator!=
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
bool < a href = '#SkRRect_notequal_operator' > operator!=(const SkRRect& a, const SkRRect& b)< / a >
< / pre >
2018-06-28 23:13:56 +00:00
Returns true if bounds and radii in < a href = '#SkRRect_notequal_operator_a' > a< / a > are not equal to bounds and radii in < a href = '#SkRRect_notequal_operator_b' > b< / a > .
< a href = '#SkRRect_notequal_operator_a' > a< / a > and < a href = '#SkRRect_notequal_operator_b' > b< / a > are not equal if either contain NaN. < a href = '#SkRRect_notequal_operator_a' > a< / a > and < a href = '#SkRRect_notequal_operator_b' > b< / a > are equal if members
contain zeroes width different signs.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_notequal_operator_a' > < code > < strong > a< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > < a href = 'SkRect_Reference#Rect' > Rect< / a > bounds and radii to compare< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_notequal_operator_b' > < code > < strong > b< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > < a href = 'SkRect_Reference#Rect' > Rect< / a > bounds and radii to compare< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 23:13:56 +00:00
true if members are not equal
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "505e47b3e6474ebdecdc04c3c2af2c34" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_equal_operator' > operator==(const SkRRect& a, const SkRRect& b)< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_inset' > < / a >
## inset
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_inset' > inset< / a > (< a href = 'undocumented#SkScalar' > SkScalar< / a > dx, < a href = 'undocumented#SkScalar' > SkScalar< / a > dy, < a href = '#SkRRect' > SkRRect< / a > * dst) const
< / pre >
2018-07-11 20:18:41 +00:00
Copies < a href = '#RRect' > Round Rect< / a > to < a href = '#SkRRect_inset_dst' > dst< / a > , then insets < a href = '#SkRRect_inset_dst' > dst< / a > bounds by < a href = '#SkRRect_inset_dx' > dx< / a > and < a href = '#SkRRect_inset_dy' > dy< / a > , and adjusts < a href = '#SkRRect_inset_dst' > dst< / a >
radii by < a href = '#SkRRect_inset_dx' > dx< / a > and < a href = '#SkRRect_inset_dy' > dy< / a > . < a href = '#SkRRect_inset_dx' > dx< / a > and < a href = '#SkRRect_inset_dy' > dy< / a > may be positive, negative, or zero. < a href = '#SkRRect_inset_dst' > dst< / a > may be
< a href = '#RRect' > Round Rect< / a > .
If either corner radius is zero, the corner has no curvature and is unchanged.
Otherwise, if adjusted radius becomes negative, pins radius to zero.
If < a href = '#SkRRect_inset_dx' > dx< / a > exceeds half < a href = '#SkRRect_inset_dst' > dst< / a > bounds width, < a href = '#SkRRect_inset_dst' > dst< / a > bounds left and right are set to
bounds x-axis center. If < a href = '#SkRRect_inset_dy' > dy< / a > exceeds half < a href = '#SkRRect_inset_dst' > dst< / a > bounds height, < a href = '#SkRRect_inset_dst' > dst< / a > bounds top and
bottom are set to bounds y-axis center.
If < a href = '#SkRRect_inset_dx' > dx< / a > or < a href = '#SkRRect_inset_dy' > dy< / a > cause the bounds to become infinite, < a href = '#SkRRect_inset_dst' > dst< / a > bounds is zeroed.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_inset_dx' > < code > < strong > dx< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > added to < a href = '#SkRRect_rect' > rect< / a > .fLeft, and subtracted from < a href = '#SkRRect_rect' > rect< / a > .fRight< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_inset_dy' > < code > < strong > dy< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > added to < a href = '#SkRRect_rect' > rect< / a > .fTop, and subtracted from < a href = '#SkRRect_rect' > rect< / a > .fBottom< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_inset_dst' > < code > < strong > dst< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > insets bounds and radii< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "f02f0110d5605dac6d14dcb8d1d8cb6e" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_outset' > outset< / a > < sup > < a href = '#SkRRect_outset_2' > [2]< / a > < / sup > < a href = '#SkRRect_offset' > offset< / a > < a href = '#SkRRect_makeOffset' > makeOffset< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_inset_2' > < / a >
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_inset' > inset< / a > (< a href = 'undocumented#SkScalar' > SkScalar< / a > dx, < a href = 'undocumented#SkScalar' > SkScalar< / a > dy)
< / pre >
2018-07-11 20:18:41 +00:00
Insets bounds by < a href = '#SkRRect_inset_2_dx' > dx< / a > and < a href = '#SkRRect_inset_2_dy' > dy< / a > , and adjusts radii by < a href = '#SkRRect_inset_2_dx' > dx< / a > and < a href = '#SkRRect_inset_2_dy' > dy< / a > . < a href = '#SkRRect_inset_2_dx' > dx< / a > and < a href = '#SkRRect_inset_2_dy' > dy< / a > may be
positive, negative, or zero.
If either corner radius is zero, the corner has no curvature and is unchanged.
Otherwise, if adjusted radius becomes negative, pins radius to zero.
If < a href = '#SkRRect_inset_2_dx' > dx< / a > exceeds half bounds width, bounds left and right are set to
bounds x-axis center. If < a href = '#SkRRect_inset_2_dy' > dy< / a > exceeds half bounds height, bounds top and
bottom are set to bounds y-axis center.
If < a href = '#SkRRect_inset_2_dx' > dx< / a > or < a href = '#SkRRect_inset_2_dy' > dy< / a > cause the bounds to become infinite, bounds is zeroed.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_inset_2_dx' > < code > < strong > dx< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > added to < a href = '#SkRRect_rect' > rect< / a > .fLeft, and subtracted from < a href = '#SkRRect_rect' > rect< / a > .fRight< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_inset_2_dy' > < code > < strong > dy< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > added to < a href = '#SkRRect_rect' > rect< / a > .fTop, and subtracted from < a href = '#SkRRect_rect' > rect< / a > .fBottom< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "da61054322550a2d5ac15114da23bd23" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_outset' > outset< / a > < sup > < a href = '#SkRRect_outset_2' > [2]< / a > < / sup > < a href = '#SkRRect_offset' > offset< / a > < a href = '#SkRRect_makeOffset' > makeOffset< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_outset' > < / a >
## outset
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_outset' > outset< / a > (< a href = 'undocumented#SkScalar' > SkScalar< / a > dx, < a href = 'undocumented#SkScalar' > SkScalar< / a > dy, < a href = '#SkRRect' > SkRRect< / a > * dst) const
< / pre >
2018-07-11 20:18:41 +00:00
Outsets < a href = '#SkRRect_outset_dst' > dst< / a > bounds by < a href = '#SkRRect_outset_dx' > dx< / a > and < a href = '#SkRRect_outset_dy' > dy< / a > , and adjusts radii by < a href = '#SkRRect_outset_dx' > dx< / a > and < a href = '#SkRRect_outset_dy' > dy< / a > . < a href = '#SkRRect_outset_dx' > dx< / a > and < a href = '#SkRRect_outset_dy' > dy< / a > may be
positive, negative, or zero.
If either corner radius is zero, the corner has no curvature and is unchanged.
Otherwise, if adjusted radius becomes negative, pins radius to zero.
If < a href = '#SkRRect_outset_dx' > dx< / a > exceeds half < a href = '#SkRRect_outset_dst' > dst< / a > bounds width, < a href = '#SkRRect_outset_dst' > dst< / a > bounds left and right are set to
bounds x-axis center. If < a href = '#SkRRect_outset_dy' > dy< / a > exceeds half < a href = '#SkRRect_outset_dst' > dst< / a > bounds height, < a href = '#SkRRect_outset_dst' > dst< / a > bounds top and
bottom are set to bounds y-axis center.
If < a href = '#SkRRect_outset_dx' > dx< / a > or < a href = '#SkRRect_outset_dy' > dy< / a > cause the bounds to become infinite, < a href = '#SkRRect_outset_dst' > dst< / a > bounds is zeroed.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_outset_dx' > < code > < strong > dx< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > subtracted from < a href = '#SkRRect_rect' > rect< / a > .fLeft, and added to < a href = '#SkRRect_rect' > rect< / a > .fRight< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_outset_dy' > < code > < strong > dy< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > subtracted from < a href = '#SkRRect_rect' > rect< / a > .fTop, and added to < a href = '#SkRRect_rect' > rect< / a > .fBottom< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_outset_dst' > < code > < strong > dst< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > outset bounds and radii< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "4d69b6d9c7726c47c42827d79fc7899c" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_inset' > inset< / a > < sup > < a href = '#SkRRect_inset_2' > [2]< / a > < / sup > < a href = '#SkRRect_offset' > offset< / a > < a href = '#SkRRect_makeOffset' > makeOffset< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_outset_2' > < / a >
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_outset' > outset< / a > (< a href = 'undocumented#SkScalar' > SkScalar< / a > dx, < a href = 'undocumented#SkScalar' > SkScalar< / a > dy)
< / pre >
2018-07-11 20:18:41 +00:00
Outsets bounds by < a href = '#SkRRect_outset_2_dx' > dx< / a > and < a href = '#SkRRect_outset_2_dy' > dy< / a > , and adjusts radii by < a href = '#SkRRect_outset_2_dx' > dx< / a > and < a href = '#SkRRect_outset_2_dy' > dy< / a > . < a href = '#SkRRect_outset_2_dx' > dx< / a > and < a href = '#SkRRect_outset_2_dy' > dy< / a > may be
positive, negative, or zero.
If either corner radius is zero, the corner has no curvature and is unchanged.
Otherwise, if adjusted radius becomes negative, pins radius to zero.
If < a href = '#SkRRect_outset_2_dx' > dx< / a > exceeds half bounds width, bounds left and right are set to
bounds x-axis center. If < a href = '#SkRRect_outset_2_dy' > dy< / a > exceeds half bounds height, bounds top and
bottom are set to bounds y-axis center.
If < a href = '#SkRRect_outset_2_dx' > dx< / a > or < a href = '#SkRRect_outset_2_dy' > dy< / a > cause the bounds to become infinite, bounds is zeroed.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_outset_2_dx' > < code > < strong > dx< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > subtracted from < a href = '#SkRRect_rect' > rect< / a > .fLeft, and added to < a href = '#SkRRect_rect' > rect< / a > .fRight< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_outset_2_dy' > < code > < strong > dy< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > subtracted from < a href = '#SkRRect_rect' > rect< / a > .fTop, and added to < a href = '#SkRRect_rect' > rect< / a > .fBottom< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "4391cced86653dcd0f84439a5c0bb3f2" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_inset' > inset< / a > < sup > < a href = '#SkRRect_inset_2' > [2]< / a > < / sup > < a href = '#SkRRect_offset' > offset< / a > < a href = '#SkRRect_makeOffset' > makeOffset< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_offset' > < / a >
## offset
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_offset' > offset< / a > (< a href = 'undocumented#SkScalar' > SkScalar< / a > dx, < a href = 'undocumented#SkScalar' > SkScalar< / a > dy)
< / pre >
2018-07-11 20:18:41 +00:00
Translates < a href = '#RRect' > Round Rect< / a > by (< a href = '#SkRRect_offset_dx' > dx< / a > , < a href = '#SkRRect_offset_dy' > dy< / a > ).
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_offset_dx' > < code > < strong > dx< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > offset added to < a href = '#SkRRect_rect' > rect< / a > .fLeft and < a href = '#SkRRect_rect' > rect< / a > .fRight< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_offset_dy' > < code > < strong > dy< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > offset added to < a href = '#SkRRect_rect' > rect< / a > .fTop and < a href = '#SkRRect_rect' > rect< / a > .fBottom< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "a45cdd46ef2fe0df62d84d41713e82e2" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_makeOffset' > makeOffset< / a > < a href = '#SkRRect_inset' > inset< / a > < sup > < a href = '#SkRRect_inset_2' > [2]< / a > < / sup > < a href = '#SkRRect_outset' > outset< / a > < sup > < a href = '#SkRRect_outset_2' > [2]< / a > < / sup >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_makeOffset' > < / a >
## makeOffset
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
< a href = '#SkRRect' > SkRRect< / a > SK_WARN_UNUSED_RESULT < a href = '#SkRRect_makeOffset' > makeOffset< / a > (< a href = 'undocumented#SkScalar' > SkScalar< / a > dx, < a href = 'undocumented#SkScalar' > SkScalar< / a > dy) const
< / pre >
2018-07-11 20:18:41 +00:00
Returns < a href = '#RRect' > Round Rect< / a > translated by (< a href = '#SkRRect_makeOffset_dx' > dx< / a > , < a href = '#SkRRect_makeOffset_dy' > dy< / a > ).
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_makeOffset_dx' > < code > < strong > dx< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > offset added to < a href = '#SkRRect_rect' > rect< / a > .fLeft and < a href = '#SkRRect_rect' > rect< / a > .fRight< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_makeOffset_dy' > < code > < strong > dy< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > offset added to < a href = '#SkRRect_rect' > rect< / a > .fTop and < a href = '#SkRRect_rect' > rect< / a > .fBottom< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 23:13:56 +00:00
< a href = '#RRect' > Round Rect< / a > bounds offset by (< a href = '#SkRRect_makeOffset_dx' > dx< / a > , < a href = '#SkRRect_makeOffset_dy' > dy< / a > ), with unchanged corner radii
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "c433aa41eaf5e419e3349fb970a08151" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_offset' > offset< / a > < a href = '#SkRRect_inset' > inset< / a > < sup > < a href = '#SkRRect_inset_2' > [2]< / a > < / sup > < a href = '#SkRRect_outset' > outset< / a > < sup > < a href = '#SkRRect_outset_2' > [2]< / a > < / sup >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_contains' > < / a >
## contains
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
bool < a href = '#SkRRect_contains' > contains< / a > (const < a href = 'SkRect_Reference#SkRect' > SkRect< / a > & rect) const
< / pre >
2018-06-28 23:13:56 +00:00
Returns true if rect is inside the bounds and corner radii, and if
< a href = '#RRect' > Round Rect< / a > and rect are not empty.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_contains_rect' > < code > < strong > rect< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > area tested for containment< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 23:13:56 +00:00
true if < a href = '#RRect' > Round Rect< / a > contains rect
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "884447c809921cfaebc87aeb63dedd48" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = 'SkRect_Reference#SkRect_contains' > SkRect::contains< / a > < sup > < a href = 'SkRect_Reference#SkRect_contains_2' > [2]< / a > < / sup > < sup > < a href = 'SkRect_Reference#SkRect_contains_3' > [3]< / a > < / sup >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_isValid' > < / a >
## isValid
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
bool < a href = '#SkRRect_isValid' > isValid< / a > () const
< / pre >
2018-07-11 20:18:41 +00:00
Returns true if bounds and radii values are finite and describe a < a href = '#RRect' > Round Rect< / a >
< a href = '#SkRRect_Type' > Type< / a > that matches < a href = '#SkRRect_getType' > getType< / a > . All < a href = '#RRect' > Round Rect< / a > methods construct valid types,
even if the input values are not valid. Invalid < a href = '#RRect' > Round Rect< / a > data can only
be generated by corrupting memory.
2018-06-27 15:00:21 +00:00
### Return Value
2018-07-11 20:18:41 +00:00
true if bounds and radii match < a href = '#SkRRect_type' > type< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "d28709aa457742391842a9ab1f21b5fa" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-07-11 20:18:41 +00:00
< a href = '#SkRRect_Type' > Type< / a > < a href = '#SkRRect_getType' > getType< / a >
2018-06-27 15:00:21 +00:00
---
### Constants
< table style = 'border-collapse: collapse; width: 62.5em' >
< tr >< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Const</ th >
< th style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > Value</ th >
< th style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' > Description</ th ></ tr >
< tr style = 'background-color: #f0f0f0 ; ' >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >< a name = 'SkRRect_kSizeInMemory' >< code > SkRRect::kSizeInMemory</ code ></ a ></ td >
< td style = 'text-align: center; border: 2px solid #dddddd ; padding: 8px; ' > 48</ td >
< td style = 'text-align: left; border: 2px solid #dddddd ; padding: 8px; ' >
2018-07-11 20:18:41 +00:00
Space required to serialize < a href = '#SkRRect' > SkRRect< / a > into a buffer. Always a multiple of four.
2018-06-27 15:00:21 +00:00
< / td >
< / tr >
< / table >
< a name = 'SkRRect_writeToMemory' > < / a >
## writeToMemory
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
size_t < a href = '#SkRRect_writeToMemory' > writeToMemory< / a > (void* buffer) const
< / pre >
2018-07-11 20:18:41 +00:00
Writes < a href = '#RRect' > Round Rect< / a > to < a href = '#SkRRect_writeToMemory_buffer' > buffer< / a > . Writes < a href = '#SkRRect_kSizeInMemory' > kSizeInMemory< / a > bytes, and returns
< a href = '#SkRRect_kSizeInMemory' > kSizeInMemory< / a > , the number of bytes written.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_writeToMemory_buffer' > < code > < strong > buffer< / strong > < / code > < / a > < / td >
2018-07-11 20:18:41 +00:00
< td > storage for < a href = '#RRect' > Round Rect< / a > < / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-07-11 20:18:41 +00:00
bytes written, < a href = '#SkRRect_kSizeInMemory' > kSizeInMemory< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "1466c844a78fd05a7362537347e360ca" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-07-11 20:18:41 +00:00
< a href = '#SkRRect_readFromMemory' > readFromMemory< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_readFromMemory' > < / a >
## readFromMemory
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
size_t < a href = '#SkRRect_readFromMemory' > readFromMemory< / a > (const void* buffer, size_t length)
< / pre >
2018-07-11 20:18:41 +00:00
Reads < a href = '#RRect' > Round Rect< / a > from < a href = '#SkRRect_readFromMemory_buffer' > buffer< / a > , reading < a href = '#SkRRect_kSizeInMemory' > kSizeInMemory< / a > bytes.
Returns < a href = '#SkRRect_kSizeInMemory' > kSizeInMemory< / a > , bytes read if < a href = '#SkRRect_readFromMemory_length' > length< / a > is at least < a href = '#SkRRect_kSizeInMemory' > kSizeInMemory< / a > .
Otherwise, returns zero.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_readFromMemory_buffer' > < code > < strong > buffer< / strong > < / code > < / a > < / td >
< td > memory to read from< / td >
< / tr >
< tr > < td > < a name = 'SkRRect_readFromMemory_length' > < code > < strong > length< / strong > < / code > < / a > < / td >
2018-07-11 20:18:41 +00:00
< td > size of < a href = '#SkRRect_readFromMemory_buffer' > buffer< / a > < / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-07-11 20:18:41 +00:00
bytes read, or 0 if < a href = '#SkRRect_readFromMemory_length' > length< / a > is less than < a href = '#SkRRect_kSizeInMemory' > kSizeInMemory< / a >
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "b877c0adff35470865a57aa150bf5329" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-07-11 20:18:41 +00:00
< a href = '#SkRRect_writeToMemory' > writeToMemory< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_transform' > < / a >
## transform
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
bool < a href = '#SkRRect_transform' > transform< / a > (const < a href = 'SkMatrix_Reference#SkMatrix' > SkMatrix< / a > & matrix, < a href = '#SkRRect' > SkRRect< / a > * dst) const
< / pre >
2018-06-28 23:13:56 +00:00
Transforms by < a href = '#RRect' > Round Rect< / a > by < a href = '#SkRRect_transform_matrix' > matrix< / a > , storing result in < a href = '#SkRRect_transform_dst' > dst< / a > .
Returns true if < a href = '#RRect' > Round Rect< / a > transformed can be represented by another < a href = '#RRect' > Round Rect< / a > .
Returns false if < a href = '#SkRRect_transform_matrix' > matrix< / a > contains transformations other than scale and translate.
Asserts in debug builds if < a href = '#RRect' > Round Rect< / a > equals < a href = '#SkRRect_transform_dst' > dst< / a > .
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_transform_matrix' > < code > < strong > matrix< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > < a href = 'SkMatrix_Reference#SkMatrix' > SkMatrix< / a > specifying the transform< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< tr > < td > < a name = 'SkRRect_transform_dst' > < code > < strong > dst< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > < a href = '#SkRRect' > SkRRect< / a > to store the result< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Return Value
2018-06-28 23:13:56 +00:00
true if transformation succeeded.
2018-06-27 15:00:21 +00:00
### Example
2018-07-11 20:18:41 +00:00
< div > < fiddle-embed name = "99ccc6862bb9fe3ca35228eee9f9725d" > < / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-07-11 20:18:41 +00:00
< a href = 'SkPath_Reference#SkPath_transform' > SkPath::transform< / a > < sup > < a href = 'SkPath_Reference#SkPath_transform_2' > [2]< / a > < / sup >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_dump' > < / a >
## dump
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_dump' > dump< / a > (bool asHex) const
< / pre >
2018-06-28 23:13:56 +00:00
Writes text representation of < a href = '#RRect' > Round Rect< / a > to standard output.
Set < a href = '#SkRRect_dump_asHex' > asHex< / a > true to generate exact binary representations
of floating point numbers.
2018-06-27 15:00:21 +00:00
### Parameters
< table > < tr > < td > < a name = 'SkRRect_dump_asHex' > < code > < strong > asHex< / strong > < / code > < / a > < / td >
2018-06-28 23:13:56 +00:00
< td > true if < a href = 'undocumented#SkScalar' > SkScalar< / a > values are written as hexadecimal< / td >
2018-06-27 15:00:21 +00:00
< / tr >
< / table >
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "265b8d23288dc8026ff788e809360af7" >
#### Example Output
~~~~
SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);
const SkPoint corners[] = {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab), /* 0.666667 */
SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab) /* 0.666667 */);
const SkPoint corners[] = {
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
};
~~~~
< / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_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 = 'SkPath_Reference#SkPath_dump' > SkPath::dump< / a > < sup > < a href = 'SkPath_Reference#SkPath_dump_2' > [2]< / a > < / sup > < a href = 'undocumented#SkPathMeasure_dump' > SkPathMeasure::dump< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_dump_2' > < / a >
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_dump' > dump< / a > () const
< / pre >
2018-06-28 23:13:56 +00:00
Writes text representation of < a href = '#RRect' > Round Rect< / a > to standard output. The representation
may be directly compiled as C++ code. Floating point values are written
with limited precision; it may not be possible to reconstruct original
< a href = '#RRect' > Round Rect< / a > from output.
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "f850423c7c0c4f803d479ecd92221059" >
#### Example Output
~~~~
SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);
const SkPoint corners[] = {
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
};
rrect is not equal to copy
~~~~
< / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_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 = 'SkPath_Reference#SkPath_dump' > SkPath::dump< / a > < sup > < a href = 'SkPath_Reference#SkPath_dump_2' > [2]< / a > < / sup > < a href = 'undocumented#SkPathMeasure_dump' > SkPathMeasure::dump< / a >
2018-06-27 15:00:21 +00:00
---
< a name = 'SkRRect_dumpHex' > < / a >
## dumpHex
< pre style = "padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0 " >
void < a href = '#SkRRect_dumpHex' > dumpHex< / a > () const
< / pre >
2018-06-28 23:13:56 +00:00
Writes text representation of < a href = '#RRect' > Round Rect< / a > to standard output. The representation
may be directly compiled as C++ code. Floating point values are written
in hexadecimal to preserve their exact bit pattern. The output reconstructs the
original < a href = '#RRect' > Round Rect< / a > .
2018-06-27 15:00:21 +00:00
### Example
2018-06-28 23:13:56 +00:00
< div > < fiddle-embed name = "c73f5e2644d949b859f05bd367883454" >
#### Example Output
~~~~
SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab), /* 0.666667 */
SkBits2Float(0x3f5b6db7), /* 0.857143 */
SkBits2Float(0x3f2aaaab) /* 0.666667 */);
const SkPoint corners[] = {
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
{ SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */
};
rrect is equal to copy
~~~~
< / fiddle-embed > < / div >
2018-06-27 15:00:21 +00:00
### See Also
2018-06-28 23:13:56 +00:00
< a href = '#SkRRect_dump' > dump< / a > < sup > < a href = '#SkRRect_dump_2' > [2]< / a > < / sup > < a href = 'SkRect_Reference#SkRect_dumpHex' > SkRect::dumpHex< / a > < a href = 'SkPath_Reference#SkPath_dumpHex' > SkPath::dumpHex< / a >
2018-06-27 15:00:21 +00:00
---