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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 * Transform by the specified matrix, and put the result in dst. | 285 * Transform by the specified matrix, and put the result in dst. |
286 * | 286 * |
287 * @param matrix SkMatrix specifying the transform. Must only contain | 287 * @param matrix SkMatrix specifying the transform. Must only contain |
288 * scale and/or translate, or this call will fail. | 288 * scale and/or translate, or this call will fail. |
289 * @param dst SkRRect to store the result. It is an error to use this, | 289 * @param dst SkRRect to store the result. It is an error to use this, |
290 * which would make this function no longer const. | 290 * which would make this function no longer const. |
291 * @return true on success, false on failure. If false, dst is unmodified. | 291 * @return true on success, false on failure. If false, dst is unmodified. |
292 */ | 292 */ |
293 bool transform(const SkMatrix& matrix, SkRRect* dst) const; | 293 bool transform(const SkMatrix& matrix, SkRRect* dst) const; |
294 | 294 |
295 #ifdef SK_DEVELOPER | 295 void dump(bool asHex) const; |
296 /** | 296 void dump() const { this->dump(false); } |
297 * Prints the rrect using SkDebugf. This is intended for Skia development de
bugging. Don't | 297 void dumpHex() const { this->dump(true); } |
298 * rely on the existence of this function or the formatting of its output. | |
299 */ | |
300 void dump() const; | |
301 #endif | |
302 | 298 |
303 private: | 299 private: |
304 SkRect fRect; | 300 SkRect fRect; |
305 // Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[] | 301 // Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[] |
306 SkVector fRadii[4]; | 302 SkVector fRadii[4]; |
307 // use an explicitly sized type so we're sure the class is dense (no uniniti
alized bytes) | 303 // use an explicitly sized type so we're sure the class is dense (no uniniti
alized bytes) |
308 mutable int32_t fType; | 304 mutable int32_t fType; |
309 // TODO: add padding so we can use memcpy for flattening and not copy | 305 // TODO: add padding so we can use memcpy for flattening and not copy |
310 // uninitialized data | 306 // uninitialized data |
311 | 307 |
312 void computeType() const; | 308 void computeType() const; |
313 bool checkCornerContainment(SkScalar x, SkScalar y) const; | 309 bool checkCornerContainment(SkScalar x, SkScalar y) const; |
314 | 310 |
315 // to access fRadii directly | 311 // to access fRadii directly |
316 friend class SkPath; | 312 friend class SkPath; |
317 }; | 313 }; |
318 | 314 |
319 #endif | 315 #endif |
OLD | NEW |