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

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

Issue 2051343002: Make various gfx classes more amenable to use as compile-time constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete destructor Created 4 years, 6 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/point3_f.h ('k') | ui/gfx/geometry/quad_f.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/point_f.h
diff --git a/ui/gfx/geometry/point_f.h b/ui/gfx/geometry/point_f.h
index 8fcb98a923265f6949e579e480499ea75a158758..c03458ba7be204fd9f844dbe2e6b57e62f048fc8 100644
--- a/ui/gfx/geometry/point_f.h
+++ b/ui/gfx/geometry/point_f.h
@@ -18,15 +18,14 @@ namespace gfx {
// A floating version of gfx::Point.
class GFX_EXPORT PointF {
public:
- PointF() : x_(0.f), y_(0.f) {}
- PointF(float x, float y) : x_(x), y_(y) {}
- ~PointF() {}
+ constexpr PointF() : x_(0.f), y_(0.f) {}
+ constexpr PointF(float x, float y) : x_(x), y_(y) {}
- explicit PointF(const Point& p)
+ constexpr explicit PointF(const Point& p)
: PointF(static_cast<float>(p.x()), static_cast<float>(p.y())) {}
- float x() const { return x_; }
- float y() const { return y_; }
+ constexpr float x() const { return x_; }
+ constexpr float y() const { return y_; }
void set_x(float x) { x_ = x; }
void set_y(float y) { y_ = y; }
« no previous file with comments | « ui/gfx/geometry/point3_f.h ('k') | ui/gfx/geometry/quad_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698