aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/SkIRect_Reference.bmh
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-09 11:31:53 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-09 16:54:52 +0000
commita766ca9af12e1175cfb01f4b516802da9197ba78 (patch)
tree738b9fa0c40ce361a45c6b2d49353f9b9431219d /docs/SkIRect_Reference.bmh
parent99578d24c0abd5b0e4fa2fc40b44fbec0c2bd627 (diff)
use 64bit math to compute is a rect is empty
Will work next to try to make isEmpty() private Bug: skia:7470 Bug:799715 Change-Id: I7b43028ecd86dca68e0c67225712516d2f2f88a2 Reviewed-on: https://skia-review.googlesource.com/92620 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'docs/SkIRect_Reference.bmh')
-rw-r--r--docs/SkIRect_Reference.bmh48
1 files changed, 47 insertions, 1 deletions
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh
index 7995ebe63b..48dcbd57d7 100644
--- a/docs/SkIRect_Reference.bmh
+++ b/docs/SkIRect_Reference.bmh
@@ -49,6 +49,7 @@ its top, it is considered empty.
# contains() # Returns true if points are equal or inside. ##
# containsNoEmptyCheck # Returns true if points are equal or inside. Skips empty check. ##
# height() # Returns span in y. ##
+# height64() # Returns span in y as int64_t. ##
# 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. ##
@@ -73,6 +74,7 @@ its top, it is considered empty.
# sort() # Orders sides from smaller to larger. ##
# top() # Returns smaller bounds in y, if sorted. ##
# width() # Returns span in x. ##
+# width64() # Returns span in y as int64_t. ##
# x() # Returns bounds left. ##
# y() # Returns bounds top. ##
#Table ##
@@ -417,7 +419,29 @@ large width: -5
##
##
-#SeeAlso height() SkRect::width()
+#SeeAlso height() width64() height64() SkRect::width()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method int64_t width64() const
+
+Returns span on the x-axis. This does not check if IRect is sorted, so the
+result may be negative. This is safer than calling width() since width() might
+overflow in its calculation.
+
+#Return fRight minus fLeft cast to int64_t ##
+
+#Example
+SkIRect large = { -2147483647, 1, 2147483644, 2 };
+SkDebugf("width: %d wdith64: %lld\n", large.width(), large.width64());
+#StdOut
+width: -5 width64: 4294967291
+##
+##
+
+#SeeAlso width() height() height64() SkRect::width()
##
@@ -447,6 +471,28 @@ large height: -5
# ------------------------------------------------------------------------------
+#Method int64_t height64() const
+
+Returns span on the y-axis. This does not check if IRect is sorted, so the
+result may be negative. This is safer than calling height() since height() might
+overflow in its calculation.
+
+#Return fBottom minus fTop cast to int64_t ##
+
+#Example
+SkIRect large = { 1, -2147483647, 2, 2147483644 };
+SkDebugf("height: %d height64: %lld\n", large.height(), large.height64());
+#StdOut
+height: -5 height64: 4294967291
+##
+##
+
+#SeeAlso width() height() width64() SkRect::height()
+
+##
+
+# ------------------------------------------------------------------------------
+
#Method SkISize size() const
Returns spans on the x-axis and y-axis. This does not check if IRect is sorted,