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

Unified Diff: ui/gfx/geometry/rect_f.h

Issue 1315053003: gfx: Remove implicit conversions from gfx::Rect to gfx::RectF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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/gfx/geometry/rect.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/rect_f.h
diff --git a/ui/gfx/geometry/rect_f.h b/ui/gfx/geometry/rect_f.h
index 3b132667e40d321f3b0e6b0d74c1495612844af7..703ad0b1ed0c2e350afd0aa45ef36acd52167b1e 100644
--- a/ui/gfx/geometry/rect_f.h
+++ b/ui/gfx/geometry/rect_f.h
@@ -9,6 +9,7 @@
#include <string>
#include "ui/gfx/geometry/point_f.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size_f.h"
#include "ui/gfx/geometry/vector2d_f.h"
@@ -31,6 +32,13 @@ class GFX_EXPORT RectF {
RectF(const PointF& origin, const SizeF& size)
: origin_(origin), size_(size) {}
+ explicit RectF(const Rect& r)
+ // TODO(danakj): Change these to checked_cast?
+ : RectF(static_cast<float>(r.x()),
+ static_cast<float>(r.y()),
+ static_cast<float>(r.width()),
+ static_cast<float>(r.height())) {}
+
#if defined(OS_MACOSX)
explicit RectF(const CGRect& r);
// Construct an equivalent CoreGraphics object.
« no previous file with comments | « ui/gfx/geometry/rect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698