Chromium Code Reviews| Index: ui/gfx/geometry/quad_f.h |
| diff --git a/ui/gfx/geometry/quad_f.h b/ui/gfx/geometry/quad_f.h |
| index f9eb3bc662b2c88f635f49f18af228e90886cf8b..c726186350c3ad0dbd583776f73ecbd75235caf8 100644 |
| --- a/ui/gfx/geometry/quad_f.h |
| +++ b/ui/gfx/geometry/quad_f.h |
| @@ -23,14 +23,17 @@ namespace gfx { |
| // axis-aligned, unlike a Rect. |
| class GFX_EXPORT QuadF { |
| public: |
| - QuadF() {} |
| - QuadF(const PointF& p1, const PointF& p2, const PointF& p3, const PointF& p4) |
| + constexpr QuadF() {} |
|
danakj
2016/06/10 00:36:48
nit: = default?
Peter Kasting
2016/06/10 05:50:06
Fine with me, I have no preference. Done in all t
|
| + constexpr QuadF(const PointF& p1, |
| + const PointF& p2, |
| + const PointF& p3, |
| + const PointF& p4) |
| : p1_(p1), |
| p2_(p2), |
| p3_(p3), |
| p4_(p4) {} |
| - explicit QuadF(const RectF& rect) |
| + constexpr explicit QuadF(const RectF& rect) |
| : p1_(rect.x(), rect.y()), |
| p2_(rect.right(), rect.y()), |
| p3_(rect.right(), rect.bottom()), |
| @@ -43,10 +46,10 @@ class GFX_EXPORT QuadF { |
| void set_p3(const PointF& p) { p3_ = p; } |
| void set_p4(const PointF& p) { p4_ = p; } |
| - const PointF& p1() const { return p1_; } |
| - const PointF& p2() const { return p2_; } |
| - const PointF& p3() const { return p3_; } |
| - const PointF& p4() const { return p4_; } |
| + constexpr const PointF& p1() const { return p1_; } |
| + constexpr const PointF& p2() const { return p2_; } |
| + constexpr const PointF& p3() const { return p3_; } |
| + constexpr const PointF& p4() const { return p4_; } |
| // Returns true if the quad is an axis-aligned rectangle. |
| bool IsRectilinear() const; |