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

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

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizefconvert-gfx: . Created 5 years, 3 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/size.cc ('k') | ui/gfx/geometry/size_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/size_f.h
diff --git a/ui/gfx/geometry/size_f.h b/ui/gfx/geometry/size_f.h
index 66080f09c12d660c78bcab789e5e6caaeb38597e..2ee2f51973c635e96ad0236067d5ae9fedb88482 100644
--- a/ui/gfx/geometry/size_f.h
+++ b/ui/gfx/geometry/size_f.h
@@ -10,6 +10,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gfx_export.h"
namespace gfx {
@@ -22,6 +23,10 @@ class GFX_EXPORT SizeF {
: width_(fmaxf(0, width)), height_(fmaxf(0, height)) {}
~SizeF() {}
+ explicit SizeF(const Size& size)
+ : SizeF(static_cast<float>(size.width()),
+ static_cast<float>(size.height())) {}
+
float width() const { return width_; }
float height() const { return height_; }
« no previous file with comments | « ui/gfx/geometry/size.cc ('k') | ui/gfx/geometry/size_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698