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 #ifndef SkOpSpan_DEFINED | 7 #ifndef SkOpSpan_DEFINED |
8 #define SkOpSpan_DEFINED | 8 #define SkOpSpan_DEFINED |
9 | 9 |
10 #include "SkPoint.h" | 10 #include "SkPoint.h" |
11 | 11 |
12 class SkOpSegment; | 12 class SkOpSegment; |
13 | 13 |
14 struct SkOpSpan { | 14 struct SkOpSpan { |
15 enum PointMatch { | |
16 kPointIsExact, | |
17 kPointIsNear | |
18 }; | |
19 SkOpSegment* fOther; | 15 SkOpSegment* fOther; |
20 SkPoint fPt; // computed when the curves are intersected | 16 SkPoint fPt; // computed when the curves are intersected |
21 double fT; | 17 double fT; |
22 double fOtherT; // value at fOther[fOtherIndex].fT | 18 double fOtherT; // value at fOther[fOtherIndex].fT |
23 int fOtherIndex; // can't be used during intersection | 19 int fOtherIndex; // can't be used during intersection |
24 int fWindSum; // accumulated from contours surrounding this one. | 20 int fWindSum; // accumulated from contours surrounding this one. |
25 int fOppSum; // for binary operators: the opposite winding sum | 21 int fOppSum; // for binary operators: the opposite winding sum |
26 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident | 22 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident |
27 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here | 23 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here |
28 bool fDone; // if set, this span to next higher T has been processed | 24 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 | 25 bool fUnsortableStart; // set when start is part of an unsortable pair |
30 bool fUnsortableEnd; // set when end is part of an unsortable pair | 26 bool fUnsortableEnd; // set when end is part of an unsortable pair |
31 bool fSmall; // if set, consecutive points are almost equal | 27 bool fSmall; // if set, consecutive points are almost equal |
32 bool fTiny; // if set, span may still be considered once for edge following | 28 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 | 29 bool fLoop; // set when a cubic loops back to this point |
34 bool fNear; // set if point is near segment end point | |
35 | 30 |
36 #ifdef SK_DEBUG | 31 #ifdef SK_DEBUG |
37 void dump() const; | 32 void dump() const; |
38 #endif | 33 #endif |
39 }; | 34 }; |
40 | 35 |
41 #endif | 36 #endif |
OLD | NEW |