OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkRRect_DEFINED | 8 #ifndef SkRRect_DEFINED |
9 #define SkRRect_DEFINED | 9 #define SkRRect_DEFINED |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 // The radii are stored in UL, UR, LR, LL order. | 169 // The radii are stored in UL, UR, LR, LL order. |
170 enum Corner { | 170 enum Corner { |
171 kUpperLeft_Corner, | 171 kUpperLeft_Corner, |
172 kUpperRight_Corner, | 172 kUpperRight_Corner, |
173 kLowerRight_Corner, | 173 kLowerRight_Corner, |
174 kLowerLeft_Corner | 174 kLowerLeft_Corner |
175 }; | 175 }; |
176 | 176 |
177 const SkRect& rect() const { return fRect; } | 177 const SkRect& rect() const { return fRect; } |
178 const SkVector& radii(Corner corner) const { return fRadii[corner]; } | 178 const SkVector& radii(Corner corner) const { return fRadii[corner]; } |
179 const SkVector* getAllRadii() const { return fRadii; } | |
reed1
2013/11/04 17:46:52
// returns all 4 radii vectors, in Corner order.
scroggo
2013/11/04 19:52:54
It seems logical to me that this would return them
| |
179 const SkRect& getBounds() const { return fRect; } | 180 const SkRect& getBounds() const { return fRect; } |
180 | 181 |
181 /** | 182 /** |
182 * When a rrect is simple, all of its radii are equal. This returns one | 183 * When a rrect is simple, all of its radii are equal. This returns one |
183 * of those radii. This call requires the rrect to be non-complex. | 184 * of those radii. This call requires the rrect to be non-complex. |
184 */ | 185 */ |
185 const SkVector& getSimpleRadii() const { | 186 const SkVector& getSimpleRadii() const { |
186 SkASSERT(!this->isComplex()); | 187 SkASSERT(!this->isComplex()); |
187 return fRadii[0]; | 188 return fRadii[0]; |
188 } | 189 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 // uninitialized data | 299 // uninitialized data |
299 | 300 |
300 void computeType() const; | 301 void computeType() const; |
301 bool checkCornerContainment(SkScalar x, SkScalar y) const; | 302 bool checkCornerContainment(SkScalar x, SkScalar y) const; |
302 | 303 |
303 // to access fRadii directly | 304 // to access fRadii directly |
304 friend class SkPath; | 305 friend class SkPath; |
305 }; | 306 }; |
306 | 307 |
307 #endif | 308 #endif |
OLD | NEW |