aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2014-11-19 05:03:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-19 05:03:18 -0800
commitb07a94f1cba3976596ae1a7f23d8c2043ba353f3 (patch)
tree9c2d202dc47a62742f950cb9702abc5e4327cf34 /include/core
parentb50612cbda6c289ac6d859810c37a2a03f0ae26a (diff)
add roundOut that returns its result
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkRect.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 6bf3ffc2fc..64e6abd08d 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -803,9 +803,8 @@ public:
}
/**
- * Expand this rectangle by rounding its coordinates "out", choosing the
- * floor of top and left, and the ceil of right and bottom. If this rect
- * is already on integer coordinates, then it will be unchanged.
+ * Set the dst rectangle by rounding "out" this rectangle, choosing the
+ * SkScalarFloorToScalar of top and left, and the SkScalarCeilToScalar of right and bottom.
*
* It is safe for this == dst
*/
@@ -828,16 +827,20 @@ public:
SkScalarFloorToInt(fRight), SkScalarFloorToInt(fBottom));
}
- /**
- * Return a new SkIRect which is contains the rounded coordinates of this
- * rect using SkScalarRoundToInt.
- */
+ //! Returns the result of calling round(&dst)
SkIRect round() const {
SkIRect ir;
this->round(&ir);
return ir;
}
-
+
+ //! Returns the result of calling roundOut(&dst)
+ SkIRect roundOut() const {
+ SkIRect ir;
+ this->roundOut(&ir);
+ return ir;
+ }
+
/**
* Swap top/bottom or left/right if there are flipped (i.e. if width()
* or height() would have returned a negative value.) This should be called