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 SkOpAngle_DEFINED | 7 #ifndef SkOpAngle_DEFINED |
8 #define SkOpAngle_DEFINED | 8 #define SkOpAngle_DEFINED |
9 | 9 |
10 #include "SkLineParameters.h" | 10 #include "SkLineParameters.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 bool computeSector(); | 35 bool computeSector(); |
36 int convexHullOverlaps(const SkOpAngle* ) const; | 36 int convexHullOverlaps(const SkOpAngle* ) const; |
37 | 37 |
38 const SkOpAngle* debugAngle(int id) const; | 38 const SkOpAngle* debugAngle(int id) const; |
39 SkOpContour* debugContour(int id); | 39 SkOpContour* debugContour(int id); |
40 | 40 |
41 int debugID() const { | 41 int debugID() const { |
42 return SkDEBUGRELEASE(fID, -1); | 42 return SkDEBUGRELEASE(fID, -1); |
43 } | 43 } |
44 | 44 |
45 #if DEBUG_SORT || DEBUG_SWAP_TOP | 45 #if DEBUG_SORT |
46 void debugLoop() const; | 46 void debugLoop() const; |
47 #endif | 47 #endif |
48 | 48 |
49 #if DEBUG_ANGLE | 49 #if DEBUG_ANGLE |
50 SkString debugPart() const; | 50 SkString debugPart() const; |
51 #endif | 51 #endif |
52 const SkOpPtT* debugPtT(int id) const; | 52 const SkOpPtT* debugPtT(int id) const; |
53 const SkOpSegment* debugSegment(int id) const; | 53 const SkOpSegment* debugSegment(int id) const; |
| 54 int debugSign() const; |
54 const SkOpSpanBase* debugSpan(int id) const; | 55 const SkOpSpanBase* debugSpan(int id) const; |
55 void debugValidate() const; | 56 void debugValidate() const; |
56 void debugValidateNext() const; // in debug builds, verify that angle loop
is uncorrupted | 57 void debugValidateNext() const; // in debug builds, verify that angle loop
is uncorrupted |
57 double distEndRatio(double dist) const; | 58 double distEndRatio(double dist) const; |
58 // available to testing only | 59 // available to testing only |
59 void dump() const; | 60 void dump() const; |
60 void dumpCurves() const; | 61 void dumpCurves() const; |
61 void dumpLoop() const; | 62 void dumpLoop() const; |
62 void dumpOne(bool functionHeader) const; | 63 void dumpOne(bool functionHeader) const; |
63 void dumpTo(const SkOpSegment* fromSeg, const SkOpAngle* ) const; | 64 void dumpTo(const SkOpSegment* fromSeg, const SkOpAngle* ) const; |
64 void dumpTest() const; | 65 void dumpTest() const; |
65 | 66 |
66 SkOpSpanBase* end() const { | 67 SkOpSpanBase* end() const { |
67 return fEnd; | 68 return fEnd; |
68 } | 69 } |
69 | 70 |
70 bool endsIntersect(SkOpAngle* ); | 71 bool endsIntersect(SkOpAngle* ); |
71 bool endToSide(const SkOpAngle* rh, bool* inside) const; | 72 bool endToSide(const SkOpAngle* rh, bool* inside) const; |
72 SkOpAngle* findFirst(); | |
73 int findSector(SkPath::Verb verb, double x, double y) const; | 73 int findSector(SkPath::Verb verb, double x, double y) const; |
74 SkOpGlobalState* globalState() const; | 74 SkOpGlobalState* globalState() const; |
75 void insert(SkOpAngle* ); | 75 void insert(SkOpAngle* ); |
76 SkOpSpanBase* lastMarked() const; | 76 SkOpSpanBase* lastMarked() const; |
77 bool loopContains(const SkOpAngle* ) const; | 77 bool loopContains(const SkOpAngle* ) const; |
78 int loopCount() const; | 78 int loopCount() const; |
79 bool markStops(); | |
80 bool merge(SkOpAngle* ); | 79 bool merge(SkOpAngle* ); |
81 double midT() const; | 80 double midT() const; |
82 bool midToSide(const SkOpAngle* rh, bool* inside) const; | 81 bool midToSide(const SkOpAngle* rh, bool* inside) const; |
83 | 82 |
84 SkOpAngle* next() const { | 83 SkOpAngle* next() const { |
85 return fNext; | 84 return fNext; |
86 } | 85 } |
87 | 86 |
88 bool oppositePlanes(const SkOpAngle* rh) const; | 87 bool oppositePlanes(const SkOpAngle* rh) const; |
89 bool orderable(SkOpAngle* rh); // false == this < rh ; true == this > rh | 88 bool orderable(SkOpAngle* rh); // false == this < rh ; true == this > rh |
(...skipping 15 matching lines...) Expand all Loading... |
105 void setID(int id) { | 104 void setID(int id) { |
106 SkDEBUGCODE(fID = id); | 105 SkDEBUGCODE(fID = id); |
107 } | 106 } |
108 | 107 |
109 void setLastMarked(SkOpSpanBase* marked) { | 108 void setLastMarked(SkOpSpanBase* marked) { |
110 fLastMarked = marked; | 109 fLastMarked = marked; |
111 } | 110 } |
112 | 111 |
113 void setSector(); | 112 void setSector(); |
114 void setSpans(); | 113 void setSpans(); |
115 int sign() const; | |
116 | 114 |
117 SkOpSpanBase* start() const { | 115 SkOpSpanBase* start() const { |
118 return fStart; | 116 return fStart; |
119 } | 117 } |
120 | 118 |
121 SkOpSpan* starter(); | 119 SkOpSpan* starter(); |
122 bool tangentsDiverge(const SkOpAngle* rh, double s0xt0) const; | 120 bool tangentsDiverge(const SkOpAngle* rh, double s0xt0) const; |
123 | 121 |
124 bool unorderable() const { | 122 bool unorderable() const { |
125 return fUnorderable; | 123 return fUnorderable; |
126 } | 124 } |
127 | 125 |
128 SkDCurve fCurvePart; // the curve from start to end | 126 SkDCurve fCurvePart; // the curve from start to end |
129 double fSide; | 127 double fSide; |
130 SkLineParameters fTangentHalf; // used only to sort a pair of lines or line
-like sections | 128 SkLineParameters fTangentHalf; // used only to sort a pair of lines or line
-like sections |
131 SkOpAngle* fNext; | 129 SkOpAngle* fNext; |
132 SkOpSpanBase* fLastMarked; | 130 SkOpSpanBase* fLastMarked; |
133 SkDVector fSweep[2]; | 131 SkDVector fSweep[2]; |
134 SkOpSpanBase* fStart; | 132 SkOpSpanBase* fStart; |
135 SkOpSpanBase* fEnd; | 133 SkOpSpanBase* fEnd; |
136 SkOpSpanBase* fComputedEnd; | 134 SkOpSpanBase* fComputedEnd; |
137 int fSectorMask; | 135 int fSectorMask; |
138 int8_t fSectorStart; // in 32nds of a circle | 136 int8_t fSectorStart; // in 32nds of a circle |
139 int8_t fSectorEnd; | 137 int8_t fSectorEnd; |
140 bool fIsCurve; | 138 bool fIsCurve; |
141 bool fStop; // set if ordered angle is greater than the previous | |
142 bool fUnorderable; | 139 bool fUnorderable; |
143 bool fUnorderedSweep; // set when a cubic's first control point between the
sweep vectors | 140 bool fUnorderedSweep; // set when a cubic's first control point between the
sweep vectors |
144 bool fComputeSector; | 141 bool fComputeSector; |
145 bool fComputedSector; | 142 bool fComputedSector; |
146 bool fCheckCoincidence; | 143 bool fCheckCoincidence; |
147 SkDEBUGCODE(int fID); | 144 SkDEBUGCODE(int fID); |
148 | 145 |
149 }; | 146 }; |
150 | 147 |
151 | 148 |
152 | 149 |
153 #endif | 150 #endif |
OLD | NEW |