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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 SkASSERT(kUnknown_Type != fType); | 89 SkASSERT(kUnknown_Type != fType); |
90 return fType; | 90 return fType; |
91 } | 91 } |
92 | 92 |
93 Type type() const { return this->getType(); } | 93 Type type() const { return this->getType(); } |
94 | 94 |
95 inline bool isEmpty() const { return kEmpty_Type == this->getType(); } | 95 inline bool isEmpty() const { return kEmpty_Type == this->getType(); } |
96 inline bool isRect() const { return kRect_Type == this->getType(); } | 96 inline bool isRect() const { return kRect_Type == this->getType(); } |
97 inline bool isOval() const { return kOval_Type == this->getType(); } | 97 inline bool isOval() const { return kOval_Type == this->getType(); } |
98 inline bool isSimple() const { return kSimple_Type == this->getType(); } | 98 inline bool isSimple() const { return kSimple_Type == this->getType(); } |
| 99 inline bool isSimpleCircular() const { |
| 100 return this->isSimple() && fRadii[0].fX == fRadii[0].fY; |
| 101 } |
99 inline bool isComplex() const { return kComplex_Type == this->getType(); } | 102 inline bool isComplex() const { return kComplex_Type == this->getType(); } |
100 | 103 |
101 SkScalar width() const { return fRect.width(); } | 104 SkScalar width() const { return fRect.width(); } |
102 SkScalar height() const { return fRect.height(); } | 105 SkScalar height() const { return fRect.height(); } |
103 | 106 |
104 /** | 107 /** |
105 * Set this RR to the empty rectangle (0,0,0,0) with 0 x & y radii. | 108 * Set this RR to the empty rectangle (0,0,0,0) with 0 x & y radii. |
106 */ | 109 */ |
107 void setEmpty() { | 110 void setEmpty() { |
108 fRect.setEmpty(); | 111 fRect.setEmpty(); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // uninitialized data | 277 // uninitialized data |
275 | 278 |
276 void computeType() const; | 279 void computeType() const; |
277 bool checkCornerContainment(SkScalar x, SkScalar y) const; | 280 bool checkCornerContainment(SkScalar x, SkScalar y) const; |
278 | 281 |
279 // to access fRadii directly | 282 // to access fRadii directly |
280 friend class SkPath; | 283 friend class SkPath; |
281 }; | 284 }; |
282 | 285 |
283 #endif | 286 #endif |
OLD | NEW |