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..18328c9c0c3858989473a7d68ebb640be67e4ef9 100644 |
--- a/ui/gfx/geometry/quad_f.h |
+++ b/ui/gfx/geometry/quad_f.h |
@@ -23,14 +23,14 @@ 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) |
- : p1_(p1), |
- p2_(p2), |
- p3_(p3), |
- p4_(p4) {} |
- |
- explicit QuadF(const RectF& rect) |
+ constexpr QuadF() = default; |
+ constexpr QuadF(const PointF& p1, |
+ const PointF& p2, |
+ const PointF& p3, |
+ const PointF& p4) |
+ : p1_(p1), p2_(p2), p3_(p3), p4_(p4) {} |
+ |
+ constexpr explicit QuadF(const RectF& rect) |
: p1_(rect.x(), rect.y()), |
p2_(rect.right(), rect.y()), |
p3_(rect.right(), rect.bottom()), |
@@ -43,10 +43,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; |