diff options
author | Cary Clark <caryclark@skia.org> | 2018-06-28 19:13:56 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-28 23:17:47 +0000 |
commit | 53498e973e52889869d0e6c4f9b186ed65d6d892 (patch) | |
tree | e64b476ccad6d7d842343914808d67f8d3e4b1dc /site | |
parent | 24d18ced1ad79d0af22b335d7fb01238915214ef (diff) |
fix blank catalog images
Some catalog images are blank because
the image wasn't selected in the fiddle
example.
Also continue to add documentation and
examples for SkRRect
R=caryclark@google.com
NOTRY=true
Docs-Preview: https://skia.org/?cl=138382
Bug: skia:6898
Change-Id: I282a14ffcbaf2f8383294724900960f5ba40a2aa
Reviewed-on: https://skia-review.googlesource.com/138382
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'site')
-rw-r--r-- | site/user/api/SkBlendMode_Reference.md | 14 | ||||
-rw-r--r-- | site/user/api/SkPath_Reference.md | 6 | ||||
-rw-r--r-- | site/user/api/SkRRect_Reference.md | 317 | ||||
-rw-r--r-- | site/user/api/SkRect_Reference.md | 2 | ||||
-rw-r--r-- | site/user/api/catalog.htm | 137 |
5 files changed, 296 insertions, 180 deletions
diff --git a/site/user/api/SkBlendMode_Reference.md b/site/user/api/SkBlendMode_Reference.md index d1bb465851..d860b27e55 100644 --- a/site/user/api/SkBlendMode_Reference.md +++ b/site/user/api/SkBlendMode_Reference.md @@ -823,7 +823,7 @@ component with source if source is darker. ### Example -<div><fiddle-embed name="8c5065ba642f815602000f6b53cefc48"></fiddle-embed></div> +<div><fiddle-embed name="23c974d2759f523ca2f4a78ae86855c3"></fiddle-embed></div> ## <a name='Lighten'>Lighten</a> @@ -838,7 +838,7 @@ component with source if source is lighter. ### Example -<div><fiddle-embed name="bbbe1a7b2587e76f9b2c7996b188a054"></fiddle-embed></div> +<div><fiddle-embed name="95cb08b8c8db3af3b2c9ad56ae7d6bc1"></fiddle-embed></div> ## <a name='Color_Dodge'>Color Dodge</a> @@ -943,7 +943,7 @@ the product of <a href='undocumented#Unpremultiply'>Unpremultiplied</a> source a ### Example -<div><fiddle-embed name="145418271d58afc4070e7df42095c750"></fiddle-embed></div> +<div><fiddle-embed name="eb29c896f008dfbef09e16b85114fc3a"></fiddle-embed></div> ## <a name='Hue'>Hue</a> @@ -957,7 +957,7 @@ source hue, leaving destination luminosity and saturation unchanged. ### Example -<div><fiddle-embed name="ade7ea4d06775cb252a1d15c7a8112d3"></fiddle-embed></div> +<div><fiddle-embed name="41e45570d682397d3b8ff2f51bd9c574"></fiddle-embed></div> ## <a name='Saturation'>Saturation</a> @@ -971,7 +971,7 @@ source hue, leaving destination luminosity and saturation unchanged. ### Example -<div><fiddle-embed name="4a99f5f6738b18afd92a4cb2bd762bf0"></fiddle-embed></div> +<div><fiddle-embed name="a48698975d236573cef512f94a7e360b"></fiddle-embed></div> ## <a name='Color'>Color</a> @@ -985,7 +985,7 @@ source hue and saturation, leaving destination luminosity unchanged. ### Example -<div><fiddle-embed name="953eb53ac00e22d098c1a1290379282e"></fiddle-embed></div> +<div><fiddle-embed name="5d7c6e23a34ca9bf3ba8cda4cdc94cc4"></fiddle-embed></div> ## <a name='Luminosity'>Luminosity</a> @@ -999,7 +999,7 @@ source luminosity, leaving destination hue and saturation unchanged. ### Example -<div><fiddle-embed name="7161fa58aa064ee229ae346cb2e165c4"></fiddle-embed></div> +<div><fiddle-embed name="7d42fe34ae20dd9e12c39dc3950e9989"></fiddle-embed></div> <a name='SkBlendMode_Name'></a> ## SkBlendMode_Name diff --git a/site/user/api/SkPath_Reference.md b/site/user/api/SkPath_Reference.md index f213448922..51210da825 100644 --- a/site/user/api/SkPath_Reference.md +++ b/site/user/api/SkPath_Reference.md @@ -524,7 +524,7 @@ SkPath member functions read and modify the structure properties. </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump_2'>dump</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to stream</td> </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dumpHex'>dumpHex</a></td> @@ -2525,7 +2525,7 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553 </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPath_dump_2'>dump</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using floats to standard output</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to stream</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td> @@ -5433,7 +5433,7 @@ path.close(); ### See Also -<a href='SkRect_Reference#SkRect_dump'>SkRect::dump()</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='SkRRect_Reference#SkRRect_dump'>SkRRect::dump()</a><sup><a href='SkRRect_Reference#SkRRect_dump_2'>[2]</a></sup> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump()</a> +<a href='#SkPath_dumpHex'>dumpHex</a> <a href='SkRect_Reference#SkRect_dump'>SkRect::dump()</a><sup><a href='SkRect_Reference#SkRect_dump_2'>[2]</a></sup> <a href='SkRRect_Reference#SkRRect_dump'>SkRRect::dump()</a><sup><a href='SkRRect_Reference#SkRRect_dump_2'>[2]</a></sup> <a href='undocumented#SkPathMeasure_dump'>SkPathMeasure::dump()</a> --- diff --git a/site/user/api/SkRRect_Reference.md b/site/user/api/SkRRect_Reference.md index c72c227aca..c2f16d38ab 100644 --- a/site/user/api/SkRRect_Reference.md +++ b/site/user/api/SkRRect_Reference.md @@ -14,7 +14,7 @@ SkRRect related constants are defined by <code>enum</code>, <code>enum class</co <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> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>corner radii order</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_Type'>Type</a></td> @@ -34,11 +34,11 @@ SkRRect related constants are defined by <code>enum</code>, <code>enum class</co </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kLowerLeft_Corner'>kLowerLeft Corner</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of bottom-left corner radii</td> </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> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of bottom-right corner radii</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kNinePatch_Type'>kNinePatch Type</a></td> @@ -62,11 +62,11 @@ SkRRect related constants are defined by <code>enum</code>, <code>enum class</co </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> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of top-left corner radii</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_kUpperRight_Corner'>kUpperRight Corner</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>index of top-right corner radii</td> </tr> </table> @@ -157,7 +157,7 @@ SkRRect can be constructed or initialized by these functions, including C++ clas </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_makeOffset'>makeOffset</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td> </tr> </table> @@ -170,7 +170,7 @@ SkRRect operators inline class member functions with arithmetic equivalents. <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> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are unequal</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_copy_operator'>operator=(const SkRRect& rrect)</a></td> @@ -178,7 +178,7 @@ SkRRect operators inline class member functions with arithmetic equivalents. </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> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if members are equal</td> </tr> </table> @@ -207,19 +207,19 @@ SkRRect member functions read and modify the structure properties. </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_contains'>contains</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkRect_Reference#Rect'>Rect</a> is inside</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_dump_2'>dump</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation to standard output</td> </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_dumpHex'>dumpHex</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sends text representation using hexadecimal to standard output</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_getBounds'>getBounds</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds</td> </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_getSimpleRadii'>getSimpleRadii</a></td> @@ -235,7 +235,7 @@ SkRRect member functions read and modify the structure properties. </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_inset'>inset</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>insets bounds and radii</td> </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_isComplex'>isComplex</a></td> @@ -267,19 +267,19 @@ SkRRect member functions read and modify the structure properties. </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_makeOffset'>makeOffset</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td> </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_offset'>offset</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>offsets bounds and radii</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_outset'>outset</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>outsets bounds and radii</td> </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_radii'>radii</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns x-axis and y-axis radii for one corner</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_readFromMemory'>readFromMemory</a></td> @@ -287,7 +287,7 @@ SkRRect member functions read and modify the structure properties. </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_rect'>rect</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds</td> </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_setEmpty'>setEmpty</a></td> @@ -315,7 +315,7 @@ SkRRect member functions read and modify the structure properties. </tr> <tr> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_transform'>transform</a></td> - <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>incomplete</td> + <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and offsets into copy</td> </tr> <tr style='background-color: #f0f0f0; '> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkRRect_type'>type</a></td> @@ -1129,7 +1129,7 @@ sets to <a href='#SkRRect_kSimple_Type'>kSimple Type</a>. Otherwise, sets to <a ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="4589dd49da291f8cd414db96c12851c7"></fiddle-embed></div> ### See Also @@ -1158,37 +1158,37 @@ The radii are stored: top-left, top-right, bottom-right, bottom-left. <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> - <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> -incomplete</td> +index of top-left corner radii</td> </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> - <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> -incomplete</td> +index of top-right corner radii</td> </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> - <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> -incomplete</td> +index of bottom-right corner radii</td> </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> - <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>#Line # incomplete ##</td> + <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td> <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '> -incomplete</td> +index of bottom-left corner radii</td> </tr> </table> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="9205393f30b156e1507e88aa27f1dd91"></fiddle-embed></div> ### See Also -incomplete +<a href='#SkRRect_radii'>radii</a> <a name='SkRRect_rect'></a> ## rect @@ -1197,17 +1197,33 @@ incomplete const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkRRect_rect'>rect</a>() const </pre> +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>. + ### Return Value -incomplete +bounding box ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<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> ### See Also -incomplete +<a href='#SkRRect_getBounds'>getBounds</a> --- @@ -1218,24 +1234,44 @@ incomplete <a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkRRect_radii'>radii</a>(<a href='#SkRRect_Corner'>Corner</a> corner) const </pre> +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. + ### Parameters <table> <tr> <td><a name='SkRRect_radii_corner'><code><strong>corner</strong></code></a></td> - <td>incomplete</td> + <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> </tr> </table> ### Return Value -incomplete +x-axis and y-axis radii for one <a href='#SkRRect_radii_corner'>corner</a> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="8d5c88478528584913867ada423e0d59"><div>Finite values are scaled proportionately to fit; other values are set to zero. +Scaled values cannot be larger than 25, half the bounding rect width. +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> ### See Also -incomplete +<a href='#SkRRect_Corner'>Corner</a> --- @@ -1246,17 +1282,21 @@ incomplete const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='#SkRRect_getBounds'>getBounds</a>() const </pre> +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>. + ### Return Value -incomplete +bounding box ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="4577e2dcb086b241bb43d8b89ee0b0dd"></fiddle-embed></div> ### See Also -incomplete +<a href='#SkRRect_rect'>rect</a> --- @@ -1267,27 +1307,32 @@ incomplete bool <a href='#SkRRect_equal_operator'>operator==(const SkRRect& a, const SkRRect& b)</a> </pre> +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. + ### Parameters <table> <tr> <td><a name='SkRRect_equal_operator_a'><code><strong>a</strong></code></a></td> - <td>incomplete</td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td> </tr> <tr> <td><a name='SkRRect_equal_operator_b'><code><strong>b</strong></code></a></td> - <td>incomplete</td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td> </tr> </table> ### Return Value -incomplete +true if members are equal ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="df181af37f1d2b06f0f45af73df7b47d"></fiddle-embed></div> ### See Also -incomplete +<a href='#SkRRect_notequal_operator'>operator!=(const SkRRect& a, const SkRRect& b)</a> --- @@ -1298,27 +1343,32 @@ incomplete bool <a href='#SkRRect_notequal_operator'>operator!=(const SkRRect& a, const SkRRect& b)</a> </pre> +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. + ### Parameters <table> <tr> <td><a name='SkRRect_notequal_operator_a'><code><strong>a</strong></code></a></td> - <td>incomplete</td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td> </tr> <tr> <td><a name='SkRRect_notequal_operator_b'><code><strong>b</strong></code></a></td> - <td>incomplete</td> + <td><a href='SkRect_Reference#Rect'>Rect</a> bounds and radii to compare</td> </tr> </table> ### Return Value -incomplete +true if members are not equal ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="505e47b3e6474ebdecdc04c3c2af2c34"></fiddle-embed></div> ### See Also -incomplete +<a href='#SkRRect_equal_operator'>operator==(const SkRRect& a, const SkRRect& b)</a> --- @@ -1342,23 +1392,23 @@ It is valid for <a href='#SkRRect_inset_dst'>dst</a> == this. ### Parameters <table> <tr> <td><a name='SkRRect_inset_dx'><code><strong>dx</strong></code></a></td> - <td>incomplete</td> + <td>added to <a href='#SkRRect_rect'>rect</a>.fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>.fRight</td> </tr> <tr> <td><a name='SkRRect_inset_dy'><code><strong>dy</strong></code></a></td> - <td>incomplete</td> + <td>added to <a href='#SkRRect_rect'>rect</a>.fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>.fBottom</td> </tr> <tr> <td><a name='SkRRect_inset_dst'><code><strong>dst</strong></code></a></td> - <td>incomplete</td> + <td>insets bounds and radii</td> </tr> </table> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="f02f0110d5605dac6d14dcb8d1d8cb6e"></fiddle-embed></div> ### See Also -incomplete +<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> --- @@ -1371,20 +1421,20 @@ void <a href='#SkRRect_inset'>inset</a>(<a href='undocumented#SkScalar'>SkScalar ### Parameters <table> <tr> <td><a name='SkRRect_inset_2_dx'><code><strong>dx</strong></code></a></td> - <td>incomplete</td> + <td>added to <a href='#SkRRect_rect'>rect</a>.fLeft, and subtracted from <a href='#SkRRect_rect'>rect</a>.fRight</td> </tr> <tr> <td><a name='SkRRect_inset_2_dy'><code><strong>dy</strong></code></a></td> - <td>incomplete</td> + <td>added to <a href='#SkRRect_rect'>rect</a>.fTop, and subtracted from <a href='#SkRRect_rect'>rect</a>.fBottom</td> </tr> </table> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="da61054322550a2d5ac15114da23bd23"></fiddle-embed></div> ### See Also -incomplete +<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> --- @@ -1404,23 +1454,23 @@ It is valid for <a href='#SkRRect_outset_dst'>dst</a> == this. ### Parameters <table> <tr> <td><a name='SkRRect_outset_dx'><code><strong>dx</strong></code></a></td> - <td>incomplete</td> + <td>subtracted from <a href='#SkRRect_rect'>rect</a>.fLeft, and added to <a href='#SkRRect_rect'>rect</a>.fRight</td> </tr> <tr> <td><a name='SkRRect_outset_dy'><code><strong>dy</strong></code></a></td> - <td>incomplete</td> + <td>subtracted from <a href='#SkRRect_rect'>rect</a>.fTop, and added to <a href='#SkRRect_rect'>rect</a>.fBottom</td> </tr> <tr> <td><a name='SkRRect_outset_dst'><code><strong>dst</strong></code></a></td> - <td>incomplete</td> + <td>outset bounds and radii</td> </tr> </table> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="4d69b6d9c7726c47c42827d79fc7899c"></fiddle-embed></div> ### See Also -incomplete +<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> --- @@ -1433,20 +1483,20 @@ void <a href='#SkRRect_outset'>outset</a>(<a href='undocumented#SkScalar'>SkScal ### Parameters <table> <tr> <td><a name='SkRRect_outset_2_dx'><code><strong>dx</strong></code></a></td> - <td>incomplete</td> + <td>subtracted from <a href='#SkRRect_rect'>rect</a>.fLeft, and added to <a href='#SkRRect_rect'>rect</a>.fRight</td> </tr> <tr> <td><a name='SkRRect_outset_2_dy'><code><strong>dy</strong></code></a></td> - <td>incomplete</td> + <td>subtracted from <a href='#SkRRect_rect'>rect</a>.fTop, and added to <a href='#SkRRect_rect'>rect</a>.fBottom</td> </tr> </table> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="4391cced86653dcd0f84439a5c0bb3f2"></fiddle-embed></div> ### See Also -incomplete +<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> --- @@ -1457,25 +1507,25 @@ incomplete void <a href='#SkRRect_offset'>offset</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) </pre> -Translate the rrect by (<a href='#SkRRect_offset_dx'>dx</a>, <a href='#SkRRect_offset_dy'>dy</a>). +Translates the rrect by (<a href='#SkRRect_offset_dx'>dx</a>, <a href='#SkRRect_offset_dy'>dy</a>). ### Parameters <table> <tr> <td><a name='SkRRect_offset_dx'><code><strong>dx</strong></code></a></td> - <td>incomplete</td> + <td>offset added to <a href='#SkRRect_rect'>rect</a>.fLeft and <a href='#SkRRect_rect'>rect</a>.fRight</td> </tr> <tr> <td><a name='SkRRect_offset_dy'><code><strong>dy</strong></code></a></td> - <td>incomplete</td> + <td>offset added to <a href='#SkRRect_rect'>rect</a>.fTop and <a href='#SkRRect_rect'>rect</a>.fBottom</td> </tr> </table> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="a45cdd46ef2fe0df62d84d41713e82e2"></fiddle-embed></div> ### See Also -incomplete +<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> --- @@ -1489,24 +1539,24 @@ incomplete ### Parameters <table> <tr> <td><a name='SkRRect_makeOffset_dx'><code><strong>dx</strong></code></a></td> - <td>incomplete</td> + <td>offset added to <a href='#SkRRect_rect'>rect</a>.fLeft and <a href='#SkRRect_rect'>rect</a>.fRight</td> </tr> <tr> <td><a name='SkRRect_makeOffset_dy'><code><strong>dy</strong></code></a></td> - <td>incomplete</td> + <td>offset added to <a href='#SkRRect_rect'>rect</a>.fTop and <a href='#SkRRect_rect'>rect</a>.fBottom</td> </tr> </table> ### Return Value -incomplete +<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 ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<div><fiddle-embed name="c433aa41eaf5e419e3349fb970a08151"></fiddle-embed></div> ### See Also -incomplete +<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> --- @@ -1517,19 +1567,19 @@ incomplete bool <a href='#SkRRect_contains'>contains</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& rect) const </pre> -Returns true if 'rect' is wholy inside the RR, and both -are not empty. +Returns true if rect is inside the bounds and corner radii, and if +<a href='#RRect'>Round Rect</a> and rect are not empty. ### Parameters <table> <tr> <td><a name='SkRRect_contains_rect'><code><strong>rect</strong></code></a></td> - <td>incomplete</td> + <td>area tested for containment</td> </tr> </table> ### Return Value -incomplete +true if <a href='#RRect'>Round Rect</a> contains rect ### Example @@ -1537,7 +1587,7 @@ incomplete ### See Also -incomplete +<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> --- @@ -1657,25 +1707,25 @@ incomplete bool <a href='#SkRRect_transform'>transform</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& matrix, <a href='#SkRRect'>SkRRect</a>* dst) const </pre> -Transform by the specified <a href='#SkRRect_transform_matrix'>matrix</a>, and put the result in <a href='#SkRRect_transform_dst'>dst</a>. +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>. ### Parameters <table> <tr> <td><a name='SkRRect_transform_matrix'><code><strong>matrix</strong></code></a></td> - <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> specifying the transform. Must only contain -scale and/or translate, or this call will fail. -</td> + <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> specifying the transform</td> </tr> <tr> <td><a name='SkRRect_transform_dst'><code><strong>dst</strong></code></a></td> - <td><a href='#SkRRect'>SkRRect</a> to store the result. It is an error to use this, -which would make this function no longer const. -</td> + <td><a href='#SkRRect'>SkRRect</a> to store the result</td> </tr> </table> ### Return Value -true on success, false on failure. +true if transformation succeeded. ### Example @@ -1694,20 +1744,48 @@ incomplete void <a href='#SkRRect_dump'>dump</a>(bool asHex) const </pre> +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. + ### Parameters <table> <tr> <td><a name='SkRRect_dump_asHex'><code><strong>asHex</strong></code></a></td> - <td>incomplete</td> + <td>true if <a href='undocumented#SkScalar'>SkScalar</a> values are written as hexadecimal</td> </tr> </table> ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<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> ### See Also -incomplete +<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> --- @@ -1717,13 +1795,33 @@ incomplete void <a href='#SkRRect_dump'>dump</a>() const </pre> +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. + ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<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> ### See Also -incomplete +<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> --- @@ -1734,13 +1832,36 @@ incomplete void <a href='#SkRRect_dumpHex'>dumpHex</a>() const </pre> +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>. + ### Example -<div><fiddle-embed name="882e8e0103048009a25cfc20400492f7"></fiddle-embed></div> +<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> ### See Also -incomplete +<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> --- diff --git a/site/user/api/SkRect_Reference.md b/site/user/api/SkRect_Reference.md index 02438608ca..e0402bf2f6 100644 --- a/site/user/api/SkRect_Reference.md +++ b/site/user/api/SkRect_Reference.md @@ -2531,7 +2531,7 @@ rect: (30, 50, 40, 60) does not contain (29, 59) ### See Also -<a href='SkIRect_Reference#SkIRect_contains'>SkIRect::contains</a><sup><a href='SkIRect_Reference#SkIRect_contains_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_3'>[3]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_4'>[4]</a></sup> +<a href='SkIRect_Reference#SkIRect_contains'>SkIRect::contains</a><sup><a href='SkIRect_Reference#SkIRect_contains_2'>[2]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_3'>[3]</a></sup><sup><a href='SkIRect_Reference#SkIRect_contains_4'>[4]</a></sup> <a href='SkRRect_Reference#SkRRect_contains'>SkRRect::contains</a> --- diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index 49f322a881..db6e59418c 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -2702,6 +2702,27 @@ "name": "SkPoint::y()", "stdout": "pt1.fY == pt1.y()\\n" }, + "SkRRect_dump": { + "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});\n for (bool dumpAsHex : { false, true } ) {\n rrect.dump(dumpAsHex);\n }\n}", + "hash": "265b8d23288dc8026ff788e809360af7", + "file": "SkRRect_Reference", + "name": "SkRRect::dump()", + "stdout": "SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);\\nconst SkPoint corners[] = {\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n};\\nSkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab), /* 0.666667 */\\n SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab) /* 0.666667 */);\\nconst SkPoint corners[] = {\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n};\\n" + }, + "SkRRect_dumpHex": { + "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});\n rrect.dumpHex();\n SkRect bounds = SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */\n SkBits2Float(0x3f2aaaab), /* 0.666667 */\n SkBits2Float(0x3f5b6db7), /* 0.857143 */\n SkBits2Float(0x3f2aaaab) /* 0.666667 */);\n const SkPoint corners[] = {\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\n };\n SkRRect copy;\n copy.setRectRadii(bounds, corners);\n SkDebugf(\"rrect is \" \"%s\" \"equal to copy\\n\", rrect == copy ? \"\" : \"not \");\n}", + "hash": "c73f5e2644d949b859f05bd367883454", + "file": "SkRRect_Reference", + "name": "SkRRect::dumpHex", + "stdout": "SkRect::MakeLTRB(SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab), /* 0.666667 */\\n SkBits2Float(0x3f5b6db7), /* 0.857143 */\\n SkBits2Float(0x3f2aaaab) /* 0.666667 */);\\nconst SkPoint corners[] = {\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n { SkBits2Float(0x00000000), SkBits2Float(0x00000000) }, /* 0.000000 0.000000 */\\n};\\nrrect is equal to copy\\n" + }, + "SkRRect_dump_2": { + "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({6.f / 7, 2.f / 3, 6.f / 7, 2.f / 3});\n rrect.dump();\n SkRect bounds = SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);\n const SkPoint corners[] = {\n { 0, 0 },\n { 0, 0 },\n { 0, 0 },\n { 0, 0 },\n };\n SkRRect copy;\n copy.setRectRadii(bounds, corners);\n SkDebugf(\"rrect is \" \"%s\" \"equal to copy\\n\", rrect == copy ? \"\" : \"not \");\n}", + "hash": "f850423c7c0c4f803d479ecd92221059", + "file": "SkRRect_Reference", + "name": "SkRRect::dump_2", + "stdout": "SkRect::MakeLTRB(0.857143f, 0.666667f, 0.857143f, 0.666667f);\\nconst SkPoint corners[] = {\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n { 0, 0 },\\n};\\nrrect is not equal to copy\\n" + }, "SkRRect_height": { "code": "void draw(SkCanvas* canvas) {\n SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 20 });\n SkDebugf(\"unsorted height: %g\\n\", unsorted.height());\n SkRRect large = SkRRect::MakeRect({ 1, -FLT_MAX, 2, FLT_MAX });\n SkDebugf(\"large height: %.0f\\n\", large.height());\n}", "hash": "5a3eb1755164a7becec33cec6e6eca31", @@ -2709,6 +2730,20 @@ "name": "SkRRect::height()", "stdout": "unsorted height: 5\\nlarge height: inf\\n" }, + "SkRRect_radii": { + "code": "void draw(SkCanvas* canvas) {\n for (SkScalar radiusX : { SK_ScalarNaN, SK_ScalarInfinity, 100.f, 50.f, 25.f} ) {\n SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, radiusX, 200);\n SkDebugf(\"left corner: (%g) %g\\n\", radiusX, rrect1.radii(SkRRect::kUpperLeft_Corner).fX);\n }\n}", + "hash": "8d5c88478528584913867ada423e0d59", + "file": "SkRRect_Reference", + "name": "SkRRect::radii()", + "stdout": "left corner: (nan) 0\\nleft corner: (inf) 0\\nleft corner: (100) 25\\nleft corner: (50) 25\\nleft corner: (25) 12.5\\n" + }, + "SkRRect_rect": { + "code": "void draw(SkCanvas* canvas) {\n for (SkScalar left : { SK_ScalarNaN, SK_ScalarInfinity, 100.f, 50.f, 25.f} ) {\n SkRRect rrect1 = SkRRect::MakeRectXY({left, 20, 60, 220}, 50, 200);\n SkDebugf(\"left bounds: (%g) %g\\n\", left, rrect1.rect().fLeft);\n }\n}", + "hash": "6831adf4c536047f4709c686feb10c48", + "file": "SkRRect_Reference", + "name": "SkRRect::rect()", + "stdout": "left bounds: (nan) 0\\nleft bounds: (inf) 0\\nleft bounds: (100) 60\\nleft bounds: (50) 50\\nleft bounds: (25) 25\\n" + }, "SkRRect_width": { "code": "void draw(SkCanvas* canvas) {\n SkRRect unsorted = SkRRect::MakeRect({ 15, 25, 10, 5 });\n SkDebugf(\"unsorted width: %g\\n\", unsorted.width());\n SkRRect large = SkRRect::MakeRect({ -FLT_MAX, 1, FLT_MAX, 2 });\n SkDebugf(\"large width: %.0f\\n\", large.width());\n}", "hash": "c675a480b41dee157f84fa2550a2a53c", @@ -3297,7 +3332,7 @@ "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kColor);\n}", "width": 256, "height": 256, - "hash": "953eb53ac00e22d098c1a1290379282e", + "hash": "5d7c6e23a34ca9bf3ba8cda4cdc94cc4", "file": "SkBlendMode_Reference", "name": "Color" }, @@ -3321,7 +3356,7 @@ "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n SkColor colors[] = { SK_ColorWHITE, SK_ColorBLACK };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n paint.setBlendMode(SkBlendMode::kDarken);\n canvas->drawPaint(paint);\n}", "width": 256, "height": 256, - "hash": "8c5065ba642f815602000f6b53cefc48", + "hash": "23c974d2759f523ca2f4a78ae86855c3", "file": "SkBlendMode_Reference", "name": "Darken" }, @@ -3393,7 +3428,7 @@ "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kHue);\n}", "width": 256, "height": 256, - "hash": "ade7ea4d06775cb252a1d15c7a8112d3", + "hash": "41e45570d682397d3b8ff2f51bd9c574", "file": "SkBlendMode_Reference", "name": "Hue" }, @@ -3401,7 +3436,7 @@ "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n SkColor colors[] = { SK_ColorBLACK, SK_ColorWHITE };\n SkPoint horz[] = { { 0, 0 }, { 256, 0 } };\n SkPaint paint;\n paint.setShader(SkGradientShader::MakeLinear(horz, colors, nullptr, SK_ARRAY_COUNT(colors),\n SkShader::kClamp_TileMode));\n paint.setBlendMode(SkBlendMode::kLighten);\n canvas->drawPaint(paint);\n}", "width": 256, "height": 256, - "hash": "bbbe1a7b2587e76f9b2c7996b188a054", + "hash": "95cb08b8c8db3af3b2c9ad56ae7d6bc1", "file": "SkBlendMode_Reference", "name": "Lighten" }, @@ -3409,7 +3444,7 @@ "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kLuminosity);\n}", "width": 256, "height": 256, - "hash": "7161fa58aa064ee229ae346cb2e165c4", + "hash": "7d42fe34ae20dd9e12c39dc3950e9989", "file": "SkBlendMode_Reference", "name": "Luminosity" }, @@ -3425,7 +3460,7 @@ "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawImage(image, 128, 0);\n canvas->drawImage(image, 0, 128);\n canvas->drawImage(image, 128, 128);\n SkPaint paint;\n paint.setBlendMode(SkBlendMode::kDstATop);\n SkColor alphas[] = { SK_ColorBLACK, SK_ColorTRANSPARENT };\n SkPoint vert[] = { { 0, 0 }, { 0, 256 } };\n paint.setShader(SkGradientShader::MakeLinear(vert, alphas, nullptr, SK_ARRAY_COUNT(alphas),\n SkShader::kClamp_TileMode));\n canvas->drawPaint(paint);\n canvas->clipRect( { 30, 30, 226, 226 } );\n canvas->drawColor(0x80bb9977, SkBlendMode::kMultiply);\n}", "width": 256, "height": 256, - "hash": "145418271d58afc4070e7df42095c750", + "hash": "eb29c896f008dfbef09e16b85114fc3a", "file": "SkBlendMode_Reference", "name": "Multiply" }, @@ -3449,7 +3484,7 @@ "code": "void draw(SkCanvas* canvas) {\n canvas->drawImage(image, 0, 0);\n canvas->drawColor(0xFF00FF00, SkBlendMode::kSaturation);\n}", "width": 256, "height": 256, - "hash": "4a99f5f6738b18afd92a4cb2bd762bf0", + "hash": "a48698975d236573cef512f94a7e360b", "file": "SkBlendMode_Reference", "name": "Saturation" }, @@ -7566,10 +7601,10 @@ "name": "SkRGBToHSV" }, "SkRRect_Corner": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n SkRRect rrect;\n SkVector corners[] = {{25, 17}, {17, 19}, {19, 15}, {15, 15}};\n rrect.setRectRadii({30, 10, 100, 60}, corners);\n canvas->drawRRect(rrect, paint);\n paint.setColor(SK_ColorWHITE);\n const SkRect r = rrect.getBounds();\n canvas->drawLine(r.fLeft, r.fTop + rrect.radii(SkRRect::kUpperLeft_Corner).fY,\n r.fRight, r.fTop + rrect.radii(SkRRect::kUpperRight_Corner).fY, paint);\n canvas->drawLine(r.fLeft, r.fBottom - rrect.radii(SkRRect::kLowerLeft_Corner).fY,\n r.fRight, r.fBottom - rrect.radii(SkRRect::kLowerRight_Corner).fY, paint);\n canvas->drawLine(r.fLeft + rrect.radii(SkRRect::kUpperLeft_Corner).fX, r.fTop,\n r.fLeft + rrect.radii(SkRRect::kLowerLeft_Corner).fX, r.fBottom, paint);\n canvas->drawLine(r.fRight - rrect.radii(SkRRect::kUpperRight_Corner).fX, r.fTop,\n r.fRight - rrect.radii(SkRRect::kLowerRight_Corner).fX, r.fBottom, paint);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 70, + "hash": "9205393f30b156e1507e88aa27f1dd91", "file": "SkRRect_Reference", "name": "SkRRect::Corner" }, @@ -7637,30 +7672,6 @@ "file": "SkRRect_Reference", "name": "SkRRect::operator=(const SkRRect& rrect)" }, - "SkRRect_dump": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkRRect_Reference", - "name": "SkRRect::dump()" -}, - "SkRRect_dumpHex": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkRRect_Reference", - "name": "SkRRect::dumpHex" -}, - "SkRRect_dump_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkRRect_Reference", - "name": "SkRRect::dump_2" -}, "SkRRect_empty_constructor": { "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect;\n SkPaint p;\n p.setStyle(SkPaint::kStroke_Style);\n p.setStrokeWidth(10);\n canvas->drawRRect(rrect, p);\n rrect.setRect({10, 10, 100, 50});\n canvas->drawRRect(rrect, p);\n}", "width": 256, @@ -7670,18 +7681,18 @@ "name": "SkRRect::SkRRect()" }, "SkRRect_equal_operator": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 200);\n SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 25, 100);\n SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());\n canvas->drawRRect(rrect1, SkPaint());\n std::string str = \"rrect1 \" + std::string(rrect1 == rrect2 ? \"=\" : \"!\") + \"= rrect2\";\n canvas->drawString(str.c_str(), 10, 240, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect2, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect3, SkPaint());\n str = \"rrect2 \" + std::string(rrect2 == rrect3 ? \"=\" : \"!\") + \"= rrect3\";\n canvas->drawString(str.c_str(), -20, 240, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "df181af37f1d2b06f0f45af73df7b47d", "file": "SkRRect_Reference", "name": "SkRRect::operator==(const SkRRect& a, const SkRRect& b)" }, "SkRRect_getBounds": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkRRect rrect = SkRRect::MakeRectXY({20, 20, 220, 100}, 15, 15);\n canvas->drawRRect(rrect, paint);\n paint.setColor(SK_ColorWHITE);\n rrect = SkRRect::MakeOval(rrect.getBounds());\n canvas->drawRRect(rrect, paint);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 120, + "hash": "4577e2dcb086b241bb43d8b89ee0b0dd", "file": "SkRRect_Reference", "name": "SkRRect::getBounds" }, @@ -7702,18 +7713,18 @@ "name": "SkRRect::getType" }, "SkRRect_inset": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.inset(-3, 3, &rrect);\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "f02f0110d5605dac6d14dcb8d1d8cb6e", "file": "SkRRect_Reference", "name": "SkRRect::inset()" }, "SkRRect_inset_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({10, 20, 180, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.inset(3, 3);\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "da61054322550a2d5ac15114da23bd23", "file": "SkRRect_Reference", "name": "SkRRect::inset_2" }, @@ -7782,53 +7793,45 @@ "name": "SkRRect::kSizeInMemory" }, "SkRRect_makeOffset": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect = rrect.makeOffset(-3, 3);\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "c433aa41eaf5e419e3349fb970a08151", "file": "SkRRect_Reference", "name": "SkRRect::makeOffset" }, "SkRRect_notequal_operator": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect1 = SkRRect::MakeRectXY({10, 20, 60, 220}, 50, 100);\n SkRRect rrect2 = SkRRect::MakeRectXY(rrect1.rect(), 50, 50);\n SkRRect rrect3 = SkRRect::MakeOval(rrect1.rect());\n canvas->drawRRect(rrect1, SkPaint());\n std::string str = \"rrect1 \" + std::string(rrect1 == rrect2 ? \"=\" : \"!\") + \"= rrect2\";\n canvas->drawString(str.c_str(), 10, 240, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect2, SkPaint());\n canvas->translate(70, 0);\n canvas->drawRRect(rrect3, SkPaint());\n str = \"rrect2 \" + std::string(rrect2 == rrect3 ? \"=\" : \"!\") + \"= rrect3\";\n canvas->drawString(str.c_str(), -20, 240, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "505e47b3e6474ebdecdc04c3c2af2c34", "file": "SkRRect_Reference", "name": "SkRRect::operator!=(const SkRRect& a, const SkRRect& b)" }, "SkRRect_offset": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.offset(3, 3);\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "a45cdd46ef2fe0df62d84d41713e82e2", "file": "SkRRect_Reference", "name": "SkRRect::offset()" }, "SkRRect_outset": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.outset(-3, 3, &rrect);\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "4d69b6d9c7726c47c42827d79fc7899c", "file": "SkRRect_Reference", "name": "SkRRect::outset()" }, "SkRRect_outset_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect.outset(3, 3);\n }\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "4391cced86653dcd0f84439a5c0bb3f2", "file": "SkRRect_Reference", "name": "SkRRect::outset_2" }, - "SkRRect_radii": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkRRect_Reference", - "name": "SkRRect::radii()" -}, "SkRRect_readFromMemory": { "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", "width": 256, @@ -7837,14 +7840,6 @@ "file": "SkRRect_Reference", "name": "SkRRect::readFromMemory" }, - "SkRRect_rect": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkRRect_Reference", - "name": "SkRRect::rect()" -}, "SkRRect_setEmpty": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});\n canvas->drawRRect(rrect, paint);\n rrect.setEmpty();\n paint.setColor(SK_ColorBLUE);\n canvas->drawRRect(rrect, paint);\n}", "width": 256, @@ -7878,10 +7873,10 @@ "name": "SkRRect::setRect" }, "SkRRect_setRectRadii": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setStrokeWidth(15);\n paint.setStrokeCap(SkPaint::kSquare_Cap);\n paint.setAntiAlias(true);\n float intervals[] = { 5, 21.75f };\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));\n SkPath path;\n SkRRect rrect;\n SkVector corners[] = {{15, 17}, {17, 19}, {19, 15}, {15, 15}};\n rrect.setRectRadii({20, 20, 100, 100}, corners);\n path.addRRect(rrect, SkPath::kCW_Direction);\n canvas->drawPath(path, paint);\n path.rewind();\n path.addRRect(rrect, SkPath::kCCW_Direction, 1);\n canvas->translate(120, 0);\n canvas->drawPath(path, paint);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "4589dd49da291f8cd414db96c12851c7", "file": "SkRRect_Reference", "name": "SkRRect::setRectRadii" }, |