From 47d7daea0beec404a82bff94ba0959a96cce0a66 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 11 Apr 2018 16:54:35 -0400 Subject: 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 Reviewed-by: Cary Clark --- site/user/api/SkIRect_Reference.md | 163 ------------------------------------- site/user/api/SkRect_Reference.md | 4 +- site/user/api/catalog.htm | 28 ------- 3 files changed, 2 insertions(+), 193 deletions(-) (limited to 'site') 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. | MakeWH | constructs from int input returning (0, 0, width, height) | | MakeXYWH | constructs from int input returning (x, y, width, height) | | bottom | returns larger bounds in y, if sorted | -| centerX | returns midpoint in x | -| centerY | returns midpoint in y | | contains | returns true if IPoint (x, y) is equal or inside | | containsNoEmptyCheck | returns true if contains unsorted IRect | | height | returns span in y | @@ -55,7 +53,6 @@ its top, it is considered empty. | inset | moves the sides symmetrically about the center | | intersect | sets to shared area; returns true if not empty | | intersectNoEmptyCheck | sets to shared area; returns true if not empty skips empty check | -| is16Bit | returns true if members fit in 16-bit word | | isEmpty | returns true if width or height are zero or negative or they exceed int32_t | | isEmpty64 | returns true if width or height are zero or negative | | join | sets to union of bounds | @@ -67,7 +64,6 @@ its top, it is considered empty. | offset | translates sides without changing width and height | | offsetTo | translates to (x, y) without changing width and height | | outset | moves the sides symmetrically about the center | -| quickReject | returns true if rectangles do not intersect | | right | returns larger bounds in x, if sorted | | set | sets to (left, top, right, bottom) | | setEmpty | sets to (0, 0, 0, 0) | @@ -343,11 +339,8 @@ rect: -10, 35, 5, 60 isEmpty: false | name | description | | --- | --- | | bottom | returns larger bounds in y, if sorted | -| centerX | returns midpoint in x | -| centerY | returns midpoint in y | | height | returns span in y | | height64 | returns span in y as int64_t | -| is16Bit | returns true if members fit in 16-bit word | | isEmpty | returns true if width or height are zero or negative or they exceed int32_t | | isEmpty64 | returns true if width or height are zero or negative | | left | returns smaller bounds in x, if sorted | @@ -723,77 +716,6 @@ outset rect: 20, 30, 80, 90 size: 60, 60 --- - -## centerX - -
-int32_t centerX() const
-
- -Returns average of left edge and right edge. Result does not change if IRect -is sorted. - -Result is rounded down. - -### Return Value - -midpoint in x - -### Example - -
Dividing by two rounds towards zero. centerX uses a bit shift and rounds down. -
- -#### 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 -~~~~ - -
- -### See Also - -centerY SkRect::centerX - ---- - - -## centerY - -
-int32_t centerY() const
-
- -Returns average of top edge and bottom edge. Result does not change if IRect -is sorted. - -Result is rounded down. - -### Return Value - -midpoint in y - -### Example - -
- -#### Example Output - -~~~~ -left: 1073741824 right: 1073741826 centerX: 1073741825 -~~~~ - -
- -### See Also - -centerX SkRect::centerY - ---- - ## isEmpty @@ -953,39 +875,6 @@ test != sorted --- - -## is16Bit - -
-bool is16Bit() const
-
- -Returns true if all members: fLeft, fTop, fRight, and fBottom; 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 - -
- -#### Example Output - -~~~~ -{-32768, -32768, 32767, 32767} fits in 16 bits -{-32768, -32768, 32768, 32768} does not fit in 16 bits -~~~~ - -
- -### See Also - -SkTFitsIn - ---- - ## Set | name | description | @@ -1529,58 +1418,6 @@ describes an area: fLeft is less than intersect | sets to shared area; returns true if not empty | | | intersect(const SkIRect& r) | | intersectNoEmptyCheck | sets to shared area; returns true if not empty skips empty check | -| quickReject | returns true if rectangles do not intersect | - - -## quickReject - -
-bool quickReject(int l, int t, int r, int b) const
-
- -Constructs IRect (l, t, r, b) and returns true if constructed IRect does not -intersect IRect. Does not check to see if construction or IRect is empty. - -Is implemented with short circuit logic so that true can be returned after -a single compare. - -### Parameters - - - - - - -
l -x minimum of constructed IRect
t -y minimum of constructed IRect
r -x maximum of constructed IRect
b -y maximum of constructed IRect
- -### Return Value - -true if construction and IRect have no area in common - -### Example - -
quickReject is the complement of Intersects. -
- -#### 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 -~~~~ - -
- -### See Also - -Intersects - ---- ## 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 -centerY SkIRect::centerX +centerY --- @@ -938,7 +938,7 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38 ### See Also -centerX SkIRect::centerY +centerX --- 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 @@ -699,20 +699,6 @@ "file": "SkIRect_Reference", "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}", @@ -811,13 +797,6 @@ "file": "SkIRect_Reference", "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}", @@ -916,13 +895,6 @@ "file": "SkIRect_Reference", "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}", -- cgit v1.2.3