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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 * given radius becomes negative, it is pinned to 0. | 217 * given radius becomes negative, it is pinned to 0. |
218 * | 218 * |
219 * It is valid for dst == this. | 219 * It is valid for dst == this. |
220 */ | 220 */ |
221 void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const { | 221 void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const { |
222 this->inset(-dx, -dy, dst); | 222 this->inset(-dx, -dy, dst); |
223 } | 223 } |
224 void outset(SkScalar dx, SkScalar dy) { | 224 void outset(SkScalar dx, SkScalar dy) { |
225 this->inset(-dx, -dy, this); | 225 this->inset(-dx, -dy, this); |
226 } | 226 } |
| 227 |
| 228 /** |
| 229 * Translate the rrect by (dx, dy). |
| 230 */ |
| 231 void offset(SkScalar dx, SkScalar dy) { |
| 232 fRect.offset(dx, dy); |
| 233 } |
227 | 234 |
228 /** | 235 /** |
229 * Returns true if 'rect' is wholy inside the RR, and both | 236 * Returns true if 'rect' is wholy inside the RR, and both |
230 * are not empty. | 237 * are not empty. |
231 */ | 238 */ |
232 bool contains(const SkRect& rect) const; | 239 bool contains(const SkRect& rect) const; |
233 | 240 |
234 SkDEBUGCODE(void validate() const;) | 241 SkDEBUGCODE(void validate() const;) |
235 | 242 |
236 enum { | 243 enum { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // uninitialized data | 284 // uninitialized data |
278 | 285 |
279 void computeType() const; | 286 void computeType() const; |
280 bool checkCornerContainment(SkScalar x, SkScalar y) const; | 287 bool checkCornerContainment(SkScalar x, SkScalar y) const; |
281 | 288 |
282 // to access fRadii directly | 289 // to access fRadii directly |
283 friend class SkPath; | 290 friend class SkPath; |
284 }; | 291 }; |
285 | 292 |
286 #endif | 293 #endif |
OLD | NEW |