blob: 50c76d2640cd8d33903646e64945d61151c5e446 [file] [log] [blame]
caryclark@google.com07393ca2013-04-08 11:47:37 +00001/*
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
12class SkOpSegment;
13
14struct SkOpSpan {
caryclark@google.com570863f2013-09-16 15:55:01 +000015 enum PointMatch {
16 kPointIsExact,
17 kPointIsNear
18 };
caryclark@google.com07393ca2013-04-08 11:47:37 +000019 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.com570863f2013-09-16 15:55:01 +000031 bool fSmall; // if set, consecutive points are almost equal
caryclark@google.com07393ca2013-04-08 11:47:37 +000032 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.com570863f2013-09-16 15:55:01 +000034 bool fNear; // set if point is near segment end point
35
36#ifdef SK_DEBUG
37 void dump() const;
38#endif
caryclark@google.com07393ca2013-04-08 11:47:37 +000039};
40
41#endif