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

Unified Diff: ui/gfx/rect_conversions.h

Issue 11359172: ui: Remove implicit flooring in skia rect conversion methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToNearestRect Created 8 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 | « ui/compositor/layer_unittest.cc ('k') | ui/gfx/rect_conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect_conversions.h
diff --git a/ui/gfx/rect_conversions.h b/ui/gfx/rect_conversions.h
index c8170cce0acdad9f9671dde7e295ebc907ebf9f0..89e225dc43bed9aae9f6a15146ec0fea5bfac43f 100644
--- a/ui/gfx/rect_conversions.h
+++ b/ui/gfx/rect_conversions.h
@@ -16,6 +16,12 @@ UI_EXPORT Rect ToEnclosingRect(const RectF& rect);
// Returns the largest Rect that is enclosed by the given RectF.
UI_EXPORT Rect ToEnclosedRect(const RectF& rect);
+// Returns the Rect after snapping the corners of the RectF to an integer grid.
+// This should only be used when the RectF you provide is expected to be an
+// interger rect with floating poing error. If it is an arbitrary RectF, then
sky 2012/11/14 02:45:42 interger -> integer poing -> point
+// you should use a different method.
+UI_EXPORT Rect ToNearestRect(const RectF& rect);
+
// Returns a Rect obtained by flooring the values of the given RectF.
// Please prefer the previous two functions in new code.
UI_EXPORT Rect ToFlooredRectDeprecated(const RectF& rect);
« no previous file with comments | « ui/compositor/layer_unittest.cc ('k') | ui/gfx/rect_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698