diff options
author | Mike Reed <reed@google.com> | 2018-01-10 14:31:18 -0500 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2018-01-10 20:39:33 +0000 |
commit | d284949b595e2d7c6c6901c5b49e822a02a4d79f (patch) | |
tree | 7aebd5fb935638ba85f34112ccb3f9b39fd039a8 /docs | |
parent | 5366e59e8826a235d25f34f50ae1b93ee9675663 (diff) |
restore intersect methods to use old-style empty-checks on their inputs
Bug introduced when we made isEmpty check for int32_t width/height
Bug:800804
Change-Id: I59799c88fb02f176c1545dd0edae050b510df079
Reviewed-on: https://skia-review.googlesource.com/93302
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/SkIRect_Reference.bmh | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh index 48dcbd57d7..a1b62b046a 100644 --- a/docs/SkIRect_Reference.bmh +++ b/docs/SkIRect_Reference.bmh @@ -54,7 +54,8 @@ its top, it is considered empty. # 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. ## +# 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. ## # left() # Returns smaller bounds in x, if sorted. ## # makeInset # Constructs from sides moved symmetrically about the center. ## @@ -584,9 +585,7 @@ left: 1073741824 right: 1073741826 centerX: -1073741823 safe mid x: 1073741825 #Method bool isEmpty() const -Returns true if fLeft is equal to or greater than fRight, or if fTop is equal -to or greater than fBottom. Call sort() to reverse rectangles with negative -width() or height(). +Returns true if width() or height() . #Return true if width() or height() are zero or negative ## @@ -613,6 +612,37 @@ sorted: {20, 40, 20, 50} is empty # ------------------------------------------------------------------------------ +#Method bool isEmpty64() const + +Returns true if fLeft is equal to or greater than fRight, or if fTop is equal +to or greater than fBottom. Call sort() to reverse rectangles with negative +width64() or height64(). + +#Return true if width64() or height64() are zero or negative ## + +#Example +SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}}; +for (auto rect : tests) { +SkDebugf("rect: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(), +rect.bottom(), isEmpty64() ? "" : " not"); +rect.sort(); +SkDebugf("sorted: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(), +rect.bottom(), isEmpty64() ? "" : " not"); +} +#StdOut +rect: {20, 40, 10, 50} is empty +sorted: {10, 40, 20, 50} is not empty +rect: {20, 40, 20, 50} is empty +sorted: {20, 40, 20, 50} is empty +## +## + +#SeeAlso EmptyIRect MakeEmpty sort SkRect::isEmpty + +## + +# ------------------------------------------------------------------------------ + #Method bool operator==(const SkIRect& a, const SkIRect& b) Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are |