| 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 SkOpAngle; |
| 12 class SkOpSegment; | 13 class SkOpSegment; |
| 13 | 14 |
| 14 struct SkOpSpan { | 15 struct SkOpSpan { |
| 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 SkOpSegment* fOther; |
| 20 SkOpAngle* fFromAngle; // (if t > 0) index into segment's angle array going
negative in t |
| 21 SkOpAngle* fToAngle; // (if t < 1) index into segment's angle array going p
ositive in t |
| 19 int fOtherIndex; // can't be used during intersection | 22 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 | |
| 22 int fWindSum; // accumulated from contours surrounding this one. | 23 int fWindSum; // accumulated from contours surrounding this one. |
| 23 int fOppSum; // for binary operators: the opposite winding sum | 24 int fOppSum; // for binary operators: the opposite winding sum |
| 24 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident | 25 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident |
| 25 int fOppValue; // normally 0 -- when binary coincident edges combine, opp v
alue goes here | 26 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 | 27 bool fChased; // set after span has been added to chase array |
| 28 bool fCoincident; // set if span is bumped -- if set additional points aren
't inserted |
| 27 bool fDone; // if set, this span to next higher T has been processed | 29 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 | 30 bool fLoop; // set when a cubic loops back to this point |
| 31 bool fMultiple; // set if this is one of mutiple spans with identical t and
pt values |
| 32 bool fNear; // set if opposite end point is near but not equal to this one |
| 29 bool fSmall; // if set, consecutive points are almost equal | 33 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 | 34 bool fTiny; // if set, consecutive points are equal but consecutive ts are
not precisely equal |
| 31 | 35 |
| 32 // available to testing only | 36 // available to testing only |
| 33 const SkOpSegment* debugToSegment(ptrdiff_t* ) const; | 37 const SkOpSegment* debugToSegment(ptrdiff_t* ) const; |
| 34 void dump() const; | 38 void dump() const; |
| 35 void dumpOne() const; | 39 void dumpOne() const; |
| 36 }; | 40 }; |
| 37 | 41 |
| 38 #endif | 42 #endif |
| OLD | NEW |