| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 rr.setRect(r); | 146 rr.setRect(r); |
| 147 return rr; | 147 return rr; |
| 148 } | 148 } |
| 149 | 149 |
| 150 static SkRRect MakeOval(const SkRect& oval) { | 150 static SkRRect MakeOval(const SkRect& oval) { |
| 151 SkRRect rr; | 151 SkRRect rr; |
| 152 rr.setOval(oval); | 152 rr.setOval(oval); |
| 153 return rr; | 153 return rr; |
| 154 } | 154 } |
| 155 | 155 |
| 156 static SkRRect MakeRectXY(const SkRect& rect, SkScalar xRad, SkScalar yRad)
{ |
| 157 SkRRect rr; |
| 158 rr.setRectXY(rect, xRad, yRad); |
| 159 return rr; |
| 160 } |
| 161 |
| 156 /** | 162 /** |
| 157 * Set this RR to match the supplied oval. All x radii will equal half the | 163 * Set this RR to match the supplied oval. All x radii will equal half the |
| 158 * width and all y radii will equal half the height. | 164 * width and all y radii will equal half the height. |
| 159 */ | 165 */ |
| 160 void setOval(const SkRect& oval) { | 166 void setOval(const SkRect& oval) { |
| 161 fRect = oval; | 167 fRect = oval; |
| 162 fRect.sort(); | 168 fRect.sort(); |
| 163 | 169 |
| 164 if (fRect.isEmpty()) { | 170 if (fRect.isEmpty()) { |
| 165 this->setEmpty(); | 171 this->setEmpty(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // uninitialized data | 325 // uninitialized data |
| 320 | 326 |
| 321 void computeType(); | 327 void computeType(); |
| 322 bool checkCornerContainment(SkScalar x, SkScalar y) const; | 328 bool checkCornerContainment(SkScalar x, SkScalar y) const; |
| 323 | 329 |
| 324 // to access fRadii directly | 330 // to access fRadii directly |
| 325 friend class SkPath; | 331 friend class SkPath; |
| 326 }; | 332 }; |
| 327 | 333 |
| 328 #endif | 334 #endif |
| OLD | NEW |