| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return; | 127 return; |
| 128 } | 128 } |
| 129 | 129 |
| 130 fRect = rect; | 130 fRect = rect; |
| 131 memset(fRadii, 0, sizeof(fRadii)); | 131 memset(fRadii, 0, sizeof(fRadii)); |
| 132 fType = kRect_Type; | 132 fType = kRect_Type; |
| 133 | 133 |
| 134 SkDEBUGCODE(this->validate();) | 134 SkDEBUGCODE(this->validate();) |
| 135 } | 135 } |
| 136 | 136 |
| 137 static SkRRect MakeRect(const SkRect& r) { |
| 138 SkRRect rr; |
| 139 rr.setRect(r); |
| 140 return rr; |
| 141 } |
| 142 |
| 137 /** | 143 /** |
| 138 * Set this RR to match the supplied oval. All x radii will equal half the | 144 * Set this RR to match the supplied oval. All x radii will equal half the |
| 139 * width and all y radii will equal half the height. | 145 * width and all y radii will equal half the height. |
| 140 */ | 146 */ |
| 141 void setOval(const SkRect& oval) { | 147 void setOval(const SkRect& oval) { |
| 142 if (oval.isEmpty()) { | 148 if (oval.isEmpty()) { |
| 143 this->setEmpty(); | 149 this->setEmpty(); |
| 144 return; | 150 return; |
| 145 } | 151 } |
| 146 | 152 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // uninitialized data | 304 // uninitialized data |
| 299 | 305 |
| 300 void computeType(); | 306 void computeType(); |
| 301 bool checkCornerContainment(SkScalar x, SkScalar y) const; | 307 bool checkCornerContainment(SkScalar x, SkScalar y) const; |
| 302 | 308 |
| 303 // to access fRadii directly | 309 // to access fRadii directly |
| 304 friend class SkPath; | 310 friend class SkPath; |
| 305 }; | 311 }; |
| 306 | 312 |
| 307 #endif | 313 #endif |
| OLD | NEW |