| 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 SkOpSegment* fOther; | 15 SkOpSegment* fOther; |
| 16 SkPoint fPt; // computed when the curves are intersected | 16 SkPoint fPt; // computed when the curves are intersected |
| 17 double fT; | 17 double fT; |
| 18 double fOtherT; // value at fOther[fOtherIndex].fT | 18 double fOtherT; // value at fOther[fOtherIndex].fT |
| 19 int fOtherIndex; // can't be used during intersection | 19 int fOtherIndex; // can't be used during intersection |
| 20 int fFromAngleIndex; // (if t > 0) index into segment's angle array going n
egative in t |
| 21 int fToAngleIndex; // (if t < 1) index into segment's angle array going pos
itive in t |
| 20 int fWindSum; // accumulated from contours surrounding this one. | 22 int fWindSum; // accumulated from contours surrounding this one. |
| 21 int fOppSum; // for binary operators: the opposite winding sum | 23 int fOppSum; // for binary operators: the opposite winding sum |
| 22 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident | 24 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident |
| 23 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here | 25 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here |
| 26 bool fChased; // set after span has been added to chase array |
| 24 bool fDone; // if set, this span to next higher T has been processed | 27 bool fDone; // if set, this span to next higher T has been processed |
| 28 bool fLoop; // set when a cubic loops back to this point |
| 29 bool fSmall; // if set, consecutive points are almost equal |
| 30 bool fTiny; // if set, consecutive points are equal but consecutive ts are
not precisely equal |
| 25 bool fUnsortableStart; // set when start is part of an unsortable pair | 31 bool fUnsortableStart; // set when start is part of an unsortable pair |
| 26 bool fUnsortableEnd; // set when end is part of an unsortable pair | 32 bool fUnsortableEnd; // set when end is part of an unsortable pair |
| 27 bool fSmall; // if set, consecutive points are almost equal | |
| 28 bool fTiny; // if set, span may still be considered once for edge following | |
| 29 bool fLoop; // set when a cubic loops back to this point | |
| 30 | 33 |
| 31 #ifdef SK_DEBUG | 34 // available to testing only |
| 35 const SkOpSegment* debugToSegment(ptrdiff_t* ) const; |
| 32 void dump() const; | 36 void dump() const; |
| 33 #endif | 37 void dumpOne() const; |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 #endif | 40 #endif |
| OLD | NEW |