| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 { | 99 inline bool isSimpleCircular() const { |
| 100 return this->isSimple() && fRadii[0].fX == fRadii[0].fY; | 100 return this->isSimple() && fRadii[0].fX == fRadii[0].fY; |
| 101 } | 101 } |
| 102 inline bool isComplex() const { return kComplex_Type == this->getType(); } | 102 inline bool isComplex() const { return kComplex_Type == this->getType(); } |
| 103 | 103 |
| 104 bool allCornersCircular() const; |
| 105 |
| 104 SkScalar width() const { return fRect.width(); } | 106 SkScalar width() const { return fRect.width(); } |
| 105 SkScalar height() const { return fRect.height(); } | 107 SkScalar height() const { return fRect.height(); } |
| 106 | 108 |
| 107 /** | 109 /** |
| 108 * Set this RR to the empty rectangle (0,0,0,0) with 0 x & y radii. | 110 * Set this RR to the empty rectangle (0,0,0,0) with 0 x & y radii. |
| 109 */ | 111 */ |
| 110 void setEmpty() { | 112 void setEmpty() { |
| 111 fRect.setEmpty(); | 113 fRect.setEmpty(); |
| 112 memset(fRadii, 0, sizeof(fRadii)); | 114 memset(fRadii, 0, sizeof(fRadii)); |
| 113 fType = kEmpty_Type; | 115 fType = kEmpty_Type; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // uninitialized data | 286 // uninitialized data |
| 285 | 287 |
| 286 void computeType() const; | 288 void computeType() const; |
| 287 bool checkCornerContainment(SkScalar x, SkScalar y) const; | 289 bool checkCornerContainment(SkScalar x, SkScalar y) const; |
| 288 | 290 |
| 289 // to access fRadii directly | 291 // to access fRadii directly |
| 290 friend class SkPath; | 292 friend class SkPath; |
| 291 }; | 293 }; |
| 292 | 294 |
| 293 #endif | 295 #endif |
| OLD | NEW |