aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRect.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r--include/core/SkRect.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 98acb1cda3..8bfa57a8f9 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -730,7 +730,7 @@ struct SK_API SkRect {
/**
* Set the dst rectangle by rounding this rectangle's coordinates to their
- * nearest integer values using SkScalarRound.
+ * nearest integer values using SkScalarRoundToInt.
*/
void round(SkIRect* dst) const {
SkASSERT(dst);
@@ -772,6 +772,15 @@ struct SK_API SkRect {
SkScalarFloorToInt(fRight), SkScalarFloorToInt(fBottom));
}
+ /**
+ * Return a new SkIRect which is contains the rounded coordinates of this
+ * rect using SkScalarRoundToInt.
+ */
+ SkIRect round() const {
+ SkIRect ir;
+ this->round(&ir);
+ return ir;
+ }
/**
* Swap top/bottom or left/right if there are flipped (i.e. if width()