diff options
author | Cary Clark <caryclark@skia.org> | 2018-04-11 16:54:35 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-12 14:18:50 +0000 |
commit | 47d7daea0beec404a82bff94ba0959a96cce0a66 (patch) | |
tree | 7d0f37cb8f3bbefc4961be0aeff33758fc656e92 /site | |
parent | 7b67b4af1fcfa76a0551f9055d2b6336c1a66b75 (diff) |
fix bm gm
gm bug7792 had wrong dimensions and clipped out half the draws
bm SkRect_Reference.bmh referred to SkIPoint::center.. which
has been removed.
Docs-Preview: https://skia.org/?cl=120640
Bug: skia:6898
Change-Id: Id4c59c82005e1060d0ca933d9a3650fe4f121264
Reviewed-on: https://skia-review.googlesource.com/120640
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'site')
-rw-r--r-- | site/user/api/SkIRect_Reference.md | 163 | ||||
-rw-r--r-- | site/user/api/SkRect_Reference.md | 4 | ||||
-rw-r--r-- | site/user/api/catalog.htm | 28 |
3 files changed, 2 insertions, 193 deletions
diff --git a/site/user/api/SkIRect_Reference.md b/site/user/api/SkIRect_Reference.md index f01542ccdd..ab76bb24be 100644 --- a/site/user/api/SkIRect_Reference.md +++ b/site/user/api/SkIRect_Reference.md @@ -46,8 +46,6 @@ its top, it is considered empty. | <a href="#SkIRect_MakeWH">MakeWH</a> | constructs from int input returning (0, 0, width, height) | | <a href="#SkIRect_MakeXYWH">MakeXYWH</a> | constructs from int input returning (x, y, width, height) | | <a href="#SkIRect_bottom">bottom</a> | returns larger bounds in y, if sorted | -| <a href="#SkIRect_centerX">centerX</a> | returns midpoint in x | -| <a href="#SkIRect_centerY">centerY</a> | returns midpoint in y | | <a href="#SkIRect_contains">contains</a> | returns true if <a href="SkIPoint_Reference#IPoint">IPoint</a> (x, y) is equal or inside | | <a href="#SkIRect_containsNoEmptyCheck">containsNoEmptyCheck</a> | returns true if contains unsorted <a href="#IRect">IRect</a> | | <a href="#SkIRect_height">height</a> | returns span in y | @@ -55,7 +53,6 @@ its top, it is considered empty. | <a href="#SkIRect_inset">inset</a> | moves the sides symmetrically about the center | | <a href="#SkIRect_intersect">intersect</a> | sets to shared area; returns true if not empty | | <a href="#SkIRect_intersectNoEmptyCheck">intersectNoEmptyCheck</a> | sets to shared area; returns true if not empty skips empty check | -| <a href="#SkIRect_is16Bit">is16Bit</a> | returns true if members fit in 16-bit word | | <a href="#SkIRect_isEmpty">isEmpty</a> | returns true if width or height are zero or negative or they exceed int32_t | | <a href="#SkIRect_isEmpty64">isEmpty64</a> | returns true if width or height are zero or negative | | <a href="#SkIRect_join">join</a> | sets to union of bounds | @@ -67,7 +64,6 @@ its top, it is considered empty. | <a href="#SkIRect_offset">offset</a> | translates sides without changing width and height | | <a href="#SkIRect_offsetTo">offsetTo</a> | translates to (x, y) without changing width and height | | <a href="#SkIRect_outset">outset</a> | moves the sides symmetrically about the center | -| <a href="#SkIRect_quickReject">quickReject</a> | returns true if rectangles do not intersect | | <a href="#SkIRect_right">right</a> | returns larger bounds in x, if sorted | | <a href="#SkIRect_set">set</a> | sets to (left, top, right, bottom) | | <a href="#SkIRect_setEmpty">setEmpty</a> | sets to (0, 0, 0, 0) | @@ -343,11 +339,8 @@ rect: -10, 35, 5, 60 isEmpty: false | name | description | | --- | --- | | <a href="#SkIRect_bottom">bottom</a> | returns larger bounds in y, if sorted | -| <a href="#SkIRect_centerX">centerX</a> | returns midpoint in x | -| <a href="#SkIRect_centerY">centerY</a> | returns midpoint in y | | <a href="#SkIRect_height">height</a> | returns span in y | | <a href="#SkIRect_height64">height64</a> | returns span in y as int64_t | -| <a href="#SkIRect_is16Bit">is16Bit</a> | returns true if members fit in 16-bit word | | <a href="#SkIRect_isEmpty">isEmpty</a> | returns true if width or height are zero or negative or they exceed int32_t | | <a href="#SkIRect_isEmpty64">isEmpty64</a> | returns true if width or height are zero or negative | | <a href="#SkIRect_left">left</a> | returns smaller bounds in x, if sorted | @@ -723,77 +716,6 @@ outset rect: 20, 30, 80, 90 size: 60, 60 --- -<a name="SkIRect_centerX"></a> -## centerX - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t centerX() const -</pre> - -Returns average of left edge and right edge. Result does not change if <a href="#IRect">IRect</a> -is sorted. - -Result is rounded down. - -### Return Value - -midpoint in x - -### Example - -<div><fiddle-embed name="549b840a9ceaaf7cb4e604f9f3d7108d"><div>Dividing by two rounds towards zero. <a href="#SkIRect_centerX">centerX</a> uses a bit shift and rounds down. -</div> - -#### Example Output - -~~~~ -left: 20 right: 41 centerX: 30 div2: 30 -left: -20 right: -41 centerX: -31 div2: -30 -left: -10 right: 11 centerX: 0 div2: 0 -~~~~ - -</fiddle-embed></div> - -### See Also - -<a href="#SkIRect_centerY">centerY</a> <a href="SkRect_Reference#SkRect_centerX">SkRect::centerX</a> - ---- - -<a name="SkIRect_centerY"></a> -## centerY - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -int32_t centerY() const -</pre> - -Returns average of top edge and bottom edge. Result does not change if <a href="#IRect">IRect</a> -is sorted. - -Result is rounded down. - -### Return Value - -midpoint in y - -### Example - -<div><fiddle-embed name="6449f7156330efbb3f344c0b787330a5"> - -#### Example Output - -~~~~ -left: 1073741824 right: 1073741826 centerX: 1073741825 -~~~~ - -</fiddle-embed></div> - -### See Also - -<a href="#SkIRect_centerX">centerX</a> <a href="SkRect_Reference#SkRect_centerY">SkRect::centerY</a> - ---- - <a name="SkIRect_isEmpty"></a> ## isEmpty @@ -953,39 +875,6 @@ test != sorted --- -<a name="SkIRect_is16Bit"></a> -## is16Bit - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool is16Bit() const -</pre> - -Returns true if all members: <a href="#SkIRect_fLeft">fLeft</a>, <a href="#SkIRect_fTop">fTop</a>, <a href="#SkIRect_fRight">fRight</a>, and <a href="#SkIRect_fBottom">fBottom</a>; values are -equal to or larger than -32768 and equal to or smaller than 32767. - -### Return Value - -true if members fit in 16-bit word - -### Example - -<div><fiddle-embed name="103e8d463e68e87e0f8f9454a7d3441c"> - -#### Example Output - -~~~~ -{-32768, -32768, 32767, 32767} fits in 16 bits -{-32768, -32768, 32768, 32768} does not fit in 16 bits -~~~~ - -</fiddle-embed></div> - -### See Also - -<a href="undocumented#SkTFitsIn">SkTFitsIn</a> - ---- - ## <a name="Set"></a> Set | name | description | @@ -1529,58 +1418,6 @@ describes an area: <a href="#SkIRect_fLeft">fLeft</a> is less than <a href="#SkI | <a href="#SkIRect_intersect">intersect</a> | sets to shared area; returns true if not empty | | | <a href="#SkIRect_intersect">intersect(const SkIRect& r)</a> | | <a href="#SkIRect_intersectNoEmptyCheck">intersectNoEmptyCheck</a> | sets to shared area; returns true if not empty skips empty check | -| <a href="#SkIRect_quickReject">quickReject</a> | returns true if rectangles do not intersect | - -<a name="SkIRect_quickReject"></a> -## quickReject - -<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0"> -bool quickReject(int l, int t, int r, int b) const -</pre> - -Constructs <a href="#IRect">IRect</a> (<a href="#SkIRect_quickReject_l">l</a>, <a href="#SkIRect_quickReject_t">t</a>, <a href="#SkIRect_quickReject_r">r</a>, <a href="#SkIRect_quickReject_b">b</a>) and returns true if constructed <a href="#IRect">IRect</a> does not -intersect <a href="#IRect">IRect</a>. Does not check to see if construction or <a href="#IRect">IRect</a> is empty. - -Is implemented with short circuit logic so that true can be returned after -a single compare. - -### Parameters - -<table> <tr> <td><a name="SkIRect_quickReject_l"> <code><strong>l </strong></code> </a></td> <td> -x minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_quickReject_t"> <code><strong>t </strong></code> </a></td> <td> -y minimum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_quickReject_r"> <code><strong>r </strong></code> </a></td> <td> -x maximum of constructed <a href="#IRect">IRect</a></td> - </tr> <tr> <td><a name="SkIRect_quickReject_b"> <code><strong>b </strong></code> </a></td> <td> -y maximum of constructed <a href="#IRect">IRect</a></td> - </tr> -</table> - -### Return Value - -true if construction and <a href="#IRect">IRect</a> have no area in common - -### Example - -<div><fiddle-embed name="f07146508efc516559d73853e6dadc78"><div><a href="#SkIRect_quickReject">quickReject</a> is the complement of <a href="#SkIRect_Intersects">Intersects</a>. -</div> - -#### Example Output - -~~~~ -rect (7, 11, 13, 17) test(13, 11, 15, 17) quickReject true; intersects false -rect (7, 11, 13, 17) test(7, 7, 13, 11) quickReject true; intersects false -rect (7, 11, 13, 17) test(12, 16, 14, 18) quickReject false; intersects true -~~~~ - -</fiddle-embed></div> - -### See Also - -<a href="#SkIRect_Intersects">Intersects</a> - ---- <a name="SkIRect_contains"></a> ## contains diff --git a/site/user/api/SkRect_Reference.md b/site/user/api/SkRect_Reference.md index f43af1407b..de3ab22dd9 100644 --- a/site/user/api/SkRect_Reference.md +++ b/site/user/api/SkRect_Reference.md @@ -906,7 +906,7 @@ left: -41 right: -20 centerX: -30.5 ### See Also -<a href="#SkRect_centerY">centerY</a> <a href="SkIRect_Reference#SkIRect_centerX">SkIRect::centerX</a> +<a href="#SkRect_centerY">centerY</a> --- @@ -938,7 +938,7 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38 ### See Also -<a href="#SkRect_centerX">centerX</a> <a href="SkIRect_Reference#SkIRect_centerY">SkIRect::centerY</a> +<a href="#SkRect_centerX">centerX</a> --- diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index 902d5375bf..a731ed91c7 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -700,20 +700,6 @@ "name": "SkIRect::bottom()", "stdout": "unsorted.fBottom: 5 unsorted.bottom(): 5\\nsorted.fBottom: 25 sorted.bottom(): 25\\n" }, - "SkIRect_centerX": { - "code": "void draw(SkCanvas* canvas) {\n SkIRect tests[] = {{20, 30, 41, 51}, {-20, -30, -41, -51}, {-10, -10, 11, 11}};\n for (auto rect : tests) {\n SkDebugf(\"left: %3d right: %3d centerX: %3d \", rect.left(), rect.right(), rect.centerX());\n SkDebugf(\"div2: %3d\\n\", (rect.left() + rect.right()) / 2);\n }\n}", - "hash": "549b840a9ceaaf7cb4e604f9f3d7108d", - "file": "SkIRect_Reference", - "name": "SkIRect::centerX", - "stdout": "left: 20 right: 41 centerX: 30 div2: 30\\nleft: -20 right: -41 centerX: -31 div2: -30\\nleft: -10 right: 11 centerX: 0 div2: 0\\n" - }, - "SkIRect_centerY": { - "code": "void draw(SkCanvas* canvas) {\n SkIRect rect = { 0, 0, 2, 2 };\n rect.offset(0x40000000, 0x40000000);\n SkDebugf(\"left: %d right: %d centerX: %d \", rect.left(), rect.right(), rect.centerX());\n}", - "hash": "6449f7156330efbb3f344c0b787330a5", - "file": "SkIRect_Reference", - "name": "SkIRect::centerY", - "stdout": "left: 1073741824 right: 1073741826 centerX: 1073741825" - }, "SkIRect_contains": { "code": "void draw(SkCanvas* canvas) {\n SkIRect rect = { 30, 50, 40, 60 };\n SkIPoint pts[] = { { 30, 50}, { 40, 50}, { 30, 60} };\n for (auto pt : pts) {\n SkDebugf(\"rect: (%d, %d, %d, %d) %s (%d, %d)\\n\",\n rect.left(), rect.top(), rect.right(), rect.bottom(),\n rect.contains(pt.x(), pt.y()) ? \"contains\" : \"does not contain\", pt.x(), pt.y());\n }\n}", "hash": "a7958a4e0668f5cf805a8e78eb57f51d", @@ -812,13 +798,6 @@ "name": "SkIRect::intersect_3", "stdout": "intersection: 30, 60, 50, 80\\n" }, - "SkIRect_is16Bit": { - "code": "void draw(SkCanvas* canvas) {\n SkIRect tests[] = {{-32768, -32768, 32767, 32767}, {-32768, -32768, 32768, 32768}};\n for (auto rect : tests) {\n SkDebugf(\"{%d, %d, %d, %d} %s in 16 bits\\n\", rect.fLeft, rect.fTop, rect.fRight,\n rect.fBottom, rect.is16Bit() ? \"fits\" : \"does not fit\");\n}\n}", - "hash": "103e8d463e68e87e0f8f9454a7d3441c", - "file": "SkIRect_Reference", - "name": "SkIRect::is16Bit", - "stdout": "{-32768, -32768, 32767, 32767} fits in 16 bits\\n{-32768, -32768, 32768, 32768} does not fit in 16 bits\\n" - }, "SkIRect_isEmpty": { "code": "void draw(SkCanvas* canvas) {\n SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};\n for (auto rect : tests) {\n SkDebugf(\"rect: {%d, %d, %d, %d} is\" \"%s empty\\n\", rect.left(), rect.top(), rect.right(),\n rect.bottom(), rect.isEmpty() ? \"\" : \" not\");\n rect.sort();\n SkDebugf(\"sorted: {%d, %d, %d, %d} is\" \"%s empty\\n\", rect.left(), rect.top(), rect.right(),\n rect.bottom(), rect.isEmpty() ? \"\" : \" not\");\n }\n}", "hash": "edaad064b6de249b7a7c768dfa000adc", @@ -917,13 +896,6 @@ "name": "SkIRect::outset()", "stdout": "rect: 5, 1, 55, 86\\n" }, - "SkIRect_quickReject": { - "code": "void draw(SkCanvas* canvas) {\n const SkIRect rect = {7, 11, 13, 17};\n const int32_t* r = &rect.fLeft;\n const SkIRect tests[] = { {13, 11, 15, 17}, { 7, 7, 13, 11 }, { 12, 16, 14, 18 } };\n for (auto& test : tests) {\n const int32_t* t = &test.fLeft;\n SkDebugf(\"rect (%d, %d, %d, %d) test(%d, %d, %d, %d) quickReject %s; intersects %s\\n\",\n r[0], r[1], r[2], r[3], t[0], t[1], t[2], t[3],\n rect.quickReject(t[0], t[1], t[2], t[3]) ? \"true\" : \"false\", \n SkIRect::Intersects(rect, test) ? \"true\" : \"false\");\n }\n}", - "hash": "f07146508efc516559d73853e6dadc78", - "file": "SkIRect_Reference", - "name": "SkIRect::quickReject", - "stdout": "rect (7, 11, 13, 17) test(13, 11, 15, 17) quickReject true; intersects false\\nrect (7, 11, 13, 17) test(7, 7, 13, 11) quickReject true; intersects false\\nrect (7, 11, 13, 17) test(12, 16, 14, 18) quickReject false; intersects true\\n" - }, "SkIRect_right": { "code": "void draw(SkCanvas* canvas) {\n SkIRect unsorted = { 15, 25, 10, 5 };\n SkDebugf(\"unsorted.fRight: %d unsorted.right(): %d\\n\", unsorted.fRight, unsorted.right());\n SkIRect sorted = unsorted.makeSorted();\n SkDebugf(\"sorted.fRight: %d sorted.right(): %d\\n\", sorted.fRight, sorted.right());\n}", "hash": "97e210976f1ee0387b30c70635cf114f", |