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

Unified Diff: ui/gfx/geometry/point.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/insets_unittest.cc ('k') | ui/gfx/geometry/point3_f.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/point.h
diff --git a/ui/gfx/geometry/point.h b/ui/gfx/geometry/point.h
index 0d46751d9ea3067ee4b470dc96905820cfbbe51d..72aa17d393bb2bebd0fe42118ea7953ea5606a81 100644
--- a/ui/gfx/geometry/point.h
+++ b/ui/gfx/geometry/point.h
@@ -25,8 +25,8 @@ namespace gfx {
// A point has an x and y coordinate.
class GFX_EXPORT Point {
public:
- Point() : x_(0), y_(0) {}
- Point(int x, int y) : x_(x), y_(y) {}
+ constexpr Point() : x_(0), y_(0) {}
+ constexpr Point(int x, int y) : x_(x), y_(y) {}
#if defined(OS_WIN)
// |point| is a DWORD value that contains a coordinate. The x-coordinate is
// the low-order short and the y-coordinate is the high-order short. This
@@ -38,16 +38,14 @@ class GFX_EXPORT Point {
explicit Point(const CGPoint& point);
#endif
- ~Point() {}
-
#if defined(OS_WIN)
POINT ToPOINT() const;
#elif defined(OS_MACOSX)
CGPoint ToCGPoint() const;
#endif
- int x() const { return x_; }
- int y() const { return y_; }
+ constexpr int x() const { return x_; }
+ constexpr int y() const { return y_; }
void set_x(int x) { x_ = x; }
void set_y(int y) { y_ = y; }
« no previous file with comments | « ui/gfx/geometry/insets_unittest.cc ('k') | ui/gfx/geometry/point3_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698