OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 FloatSize m_bottomLeft; | 97 FloatSize m_bottomLeft; |
98 FloatSize m_bottomRight; | 98 FloatSize m_bottomRight; |
99 }; | 99 }; |
100 | 100 |
101 FloatRoundedRect() { } | 101 FloatRoundedRect() { } |
102 explicit FloatRoundedRect(const FloatRect&, const Radii& = Radii()); | 102 explicit FloatRoundedRect(const FloatRect&, const Radii& = Radii()); |
103 FloatRoundedRect(float x, float y, float width, float height); | 103 FloatRoundedRect(float x, float y, float width, float height); |
104 FloatRoundedRect(const FloatRect&, const FloatSize& topLeft, const FloatSize
& topRight, const FloatSize& bottomLeft, const FloatSize& bottomRight); | 104 FloatRoundedRect(const FloatRect&, const FloatSize& topLeft, const FloatSize
& topRight, const FloatSize& bottomLeft, const FloatSize& bottomRight); |
105 | 105 |
106 const FloatRect& rect() const { return m_rect; } | 106 const FloatRect& rect() const { return m_rect; } |
107 const Radii& radii() const { return m_radii; } | 107 const Radii& getRadii() const { return m_radii; } |
108 bool isRounded() const { return !m_radii.isZero(); } | 108 bool isRounded() const { return !m_radii.isZero(); } |
109 bool isEmpty() const { return m_rect.isEmpty(); } | 109 bool isEmpty() const { return m_rect.isEmpty(); } |
110 | 110 |
111 void setRect(const FloatRect& rect) { m_rect = rect; } | 111 void setRect(const FloatRect& rect) { m_rect = rect; } |
112 void setRadii(const Radii& radii) { m_radii = radii; } | 112 void setRadii(const Radii& radii) { m_radii = radii; } |
113 | 113 |
114 void move(const FloatSize& size) { m_rect.move(size); } | 114 void move(const FloatSize& size) { m_rect.move(size); } |
115 void inflateWithRadii(int size); | 115 void inflateWithRadii(int size); |
116 void inflate(float size) { m_rect.inflate(size); } | 116 void inflate(float size) { m_rect.inflate(size); } |
117 | 117 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 | 198 |
199 inline bool operator!=(const FloatRoundedRect::Radii& a, const FloatRoundedRect:
:Radii& b) | 199 inline bool operator!=(const FloatRoundedRect::Radii& a, const FloatRoundedRect:
:Radii& b) |
200 { | 200 { |
201 return !(a == b); | 201 return !(a == b); |
202 } | 202 } |
203 | 203 |
204 | 204 |
205 inline bool operator==(const FloatRoundedRect& a, const FloatRoundedRect& b) | 205 inline bool operator==(const FloatRoundedRect& a, const FloatRoundedRect& b) |
206 { | 206 { |
207 return a.rect() == b.rect() && a.radii() == b.radii(); | 207 return a.rect() == b.rect() && a.getRadii() == b.getRadii(); |
208 } | 208 } |
209 | 209 |
210 // Redeclared here to avoid ODR issues. | 210 // Redeclared here to avoid ODR issues. |
211 // See platform/testing/GeometryPrinters.h. | 211 // See platform/testing/GeometryPrinters.h. |
212 void PrintTo(const FloatRoundedRect&, std::ostream*); | 212 void PrintTo(const FloatRoundedRect&, std::ostream*); |
213 void PrintTo(const FloatRoundedRect::Radii&, std::ostream*); | 213 void PrintTo(const FloatRoundedRect::Radii&, std::ostream*); |
214 | 214 |
215 } // namespace blink | 215 } // namespace blink |
216 | 216 |
217 #endif // FloatRoundedRect_h | 217 #endif // FloatRoundedRect_h |
OLD | NEW |