| caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #ifndef SkOpSpan_DEFINED |
| 8 | #define SkOpSpan_DEFINED |
| 9 | |
| 10 | #include "SkPoint.h" |
| 11 | |
| 12 | class SkOpSegment; |
| 13 | |
| 14 | struct SkOpSpan { |
| caryclark@google.com | 570863f | 2013-09-16 15:55:01 +0000 | [diff] [blame] | 15 | enum PointMatch { |
| 16 | kPointIsExact, |
| 17 | kPointIsNear |
| 18 | }; |
| caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 19 | SkOpSegment* fOther; |
| 20 | SkPoint fPt; // computed when the curves are intersected |
| 21 | double fT; |
| 22 | double fOtherT; // value at fOther[fOtherIndex].fT |
| 23 | int fOtherIndex; // can't be used during intersection |
| 24 | int fWindSum; // accumulated from contours surrounding this one. |
| 25 | int fOppSum; // for binary operators: the opposite winding sum |
| 26 | int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident |
| 27 | int fOppValue; // normally 0 -- when binary coincident edges combine, opp value goes here |
| 28 | bool fDone; // if set, this span to next higher T has been processed |
| 29 | bool fUnsortableStart; // set when start is part of an unsortable pair |
| 30 | bool fUnsortableEnd; // set when end is part of an unsortable pair |
| caryclark@google.com | 570863f | 2013-09-16 15:55:01 +0000 | [diff] [blame] | 31 | bool fSmall; // if set, consecutive points are almost equal |
| caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 32 | bool fTiny; // if set, span may still be considered once for edge following |
| 33 | bool fLoop; // set when a cubic loops back to this point |
| caryclark@google.com | 570863f | 2013-09-16 15:55:01 +0000 | [diff] [blame] | 34 | bool fNear; // set if point is near segment end point |
| 35 | |
| 36 | #ifdef SK_DEBUG |
| 37 | void dump() const; |
| 38 | #endif |
| caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | #endif |