Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: include/core/SkRect.h

Issue 742663002: add roundOut that returns its result (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRect.h
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 6bf3ffc2fc1c24241abdef72cc2c4b208ddf56e9..64e6abd08d2426af034f5f68b73f9dd0d7165bd8 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
« no previous file with comments | « no previous file | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698