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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 /** | 237 /** |
238 * The logical operations that can be performed when combining two regions. | 238 * The logical operations that can be performed when combining two regions. |
239 */ | 239 */ |
240 enum Op { | 240 enum Op { |
241 kDifference_Op, //!< subtract the op region from the first region | 241 kDifference_Op, //!< subtract the op region from the first region |
242 kIntersect_Op, //!< intersect the two regions | 242 kIntersect_Op, //!< intersect the two regions |
243 kUnion_Op, //!< union (inclusive-or) the two regions | 243 kUnion_Op, //!< union (inclusive-or) the two regions |
244 kXOR_Op, //!< exclusive-or the two regions | 244 kXOR_Op, //!< exclusive-or the two regions |
245 /** subtract the first region from the op region */ | 245 /** subtract the first region from the op region */ |
246 kReverseDifference_Op, | 246 kReverseDifference_Op, |
247 kReplace_Op //!< replace the dst region with the op region | 247 kReplace_Op, //!< replace the dst region with the op region |
| 248 |
| 249 kLastOp = kReplace_Op |
248 }; | 250 }; |
249 | 251 |
| 252 static const int kOpCnt = kLastOp + 1; |
| 253 |
250 /** | 254 /** |
251 * Set this region to the result of applying the Op to this region and the | 255 * Set this region to the result of applying the Op to this region and the |
252 * specified rectangle: this = (this op rect). | 256 * specified rectangle: this = (this op rect). |
253 * Return true if the resulting region is non-empty. | 257 * Return true if the resulting region is non-empty. |
254 */ | 258 */ |
255 bool op(const SkIRect& rect, Op op) { return this->op(*this, rect, op); } | 259 bool op(const SkIRect& rect, Op op) { return this->op(*this, rect, op); } |
256 | 260 |
257 /** | 261 /** |
258 * Set this region to the result of applying the Op to this region and the | 262 * Set this region to the result of applying the Op to this region and the |
259 * specified rectangle: this = (this op rect). | 263 * specified rectangle: this = (this op rect). |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 static bool Oper(const SkRegion&, const SkRegion&, SkRegion::Op, SkRegion*); | 444 static bool Oper(const SkRegion&, const SkRegion&, SkRegion::Op, SkRegion*); |
441 | 445 |
442 friend struct RunHead; | 446 friend struct RunHead; |
443 friend class Iterator; | 447 friend class Iterator; |
444 friend class Spanerator; | 448 friend class Spanerator; |
445 friend class SkRgnBuilder; | 449 friend class SkRgnBuilder; |
446 friend class SkFlatRegion; | 450 friend class SkFlatRegion; |
447 }; | 451 }; |
448 | 452 |
449 #endif | 453 #endif |
OLD | NEW |