OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2005 The Android Open Source Project | 3 * Copyright 2005 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkRegion_DEFINED | 10 #ifndef SkRegion_DEFINED |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 /** Return true if this region consists of more than 1 rectangular area */ | 79 /** Return true if this region consists of more than 1 rectangular area */ |
80 bool isComplex() const { return !this->isEmpty() && !this->isRect(); } | 80 bool isComplex() const { return !this->isEmpty() && !this->isRect(); } |
81 | 81 |
82 /** | 82 /** |
83 * Return the bounds of this region. If the region is empty, returns an | 83 * Return the bounds of this region. If the region is empty, returns an |
84 * empty rectangle. | 84 * empty rectangle. |
85 */ | 85 */ |
86 const SkIRect& getBounds() const { return fBounds; } | 86 const SkIRect& getBounds() const { return fBounds; } |
87 | 87 |
88 /** | 88 /** |
| 89 * Returns a value that grows approximately linearly with the number of |
| 90 * intervals comprised in the region. Empty region will return 0, Rect |
| 91 * will return 1, Complex will return a value > 1. |
| 92 * |
| 93 * Use this to compare two regions, where the larger count likely |
| 94 * indicates a more complex region. |
| 95 */ |
| 96 int computeRegionComplexity() const; |
| 97 |
| 98 /** |
89 * Returns true if the region is non-empty, and if so, appends the | 99 * Returns true if the region is non-empty, and if so, appends the |
90 * boundary(s) of the region to the specified path. | 100 * boundary(s) of the region to the specified path. |
91 * If the region is empty, returns false, and path is left unmodified. | 101 * If the region is empty, returns false, and path is left unmodified. |
92 */ | 102 */ |
93 bool getBoundaryPath(SkPath* path) const; | 103 bool getBoundaryPath(SkPath* path) const; |
94 | 104 |
95 /** | 105 /** |
96 * Set the region to be empty, and return false, since the resulting | 106 * Set the region to be empty, and return false, since the resulting |
97 * region is empty | 107 * region is empty |
98 */ | 108 */ |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 static bool Oper(const SkRegion&, const SkRegion&, SkRegion::Op, SkRegion*); | 437 static bool Oper(const SkRegion&, const SkRegion&, SkRegion::Op, SkRegion*); |
428 | 438 |
429 friend struct RunHead; | 439 friend struct RunHead; |
430 friend class Iterator; | 440 friend class Iterator; |
431 friend class Spanerator; | 441 friend class Spanerator; |
432 friend class SkRgnBuilder; | 442 friend class SkRgnBuilder; |
433 friend class SkFlatRegion; | 443 friend class SkFlatRegion; |
434 }; | 444 }; |
435 | 445 |
436 #endif | 446 #endif |
OLD | NEW |