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 SkOpAngle; 13 class SkOpSegment; 14 15 struct SkOpSpan { 16 SkPoint fPt; // computed when the curves are intersected 17 double 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 positive in t 22 int fOtherIndex; // can't be used during intersection 23 int fWindSum; // accumulated from contours surrounding this one. 24 int fOppSum; // for binary operators: the opposite winding sum 25 int fWindValue; // 0 == canceled; 1 == normal; >1 == coincident 26 int fOppValue; // normally 0 -- when binary coincident edges combine, opp value goes here 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 29 bool fDone; // if set, this span to next higher T has been processed 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 33 bool fSmall; // if set, consecutive points are almost equal 34 bool fTiny; // if set, consecutive points are equal but consecutive ts are not precisely equal 35 36 // available to testing only 37 const SkOpSegment* debugToSegment(ptrdiff_t* ) const; 38 void dump() const; 39 void dumpOne() const; 40 }; 41 42 #endif 43