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 SkPathOpsTypes_DEFINED | 7 #ifndef SkPathOpsTypes_DEFINED |
8 #define SkPathOpsTypes_DEFINED | 8 #define SkPathOpsTypes_DEFINED |
9 | 9 |
10 #include <float.h> // for FLT_EPSILON | 10 #include <float.h> // for FLT_EPSILON |
(...skipping 27 matching lines...) Expand all Loading... |
38 enum Phase { | 38 enum Phase { |
39 kIntersecting, | 39 kIntersecting, |
40 kWalking, | 40 kWalking, |
41 kFixWinding, | 41 kFixWinding, |
42 }; | 42 }; |
43 | 43 |
44 enum { | 44 enum { |
45 kMaxWindingTries = 10 | 45 kMaxWindingTries = 10 |
46 }; | 46 }; |
47 | 47 |
| 48 bool allocatedOpSpan() const { |
| 49 return fAllocatedOpSpan; |
| 50 } |
| 51 |
48 SkChunkAlloc* allocator() { | 52 SkChunkAlloc* allocator() { |
49 return fAllocator; | 53 return fAllocator; |
50 } | 54 } |
51 | 55 |
52 bool angleCoincidence() const { | 56 bool angleCoincidence() const { |
53 return fAngleCoincidence; | 57 return fAngleCoincidence; |
54 } | 58 } |
55 | 59 |
56 void bumpNested() { | 60 void bumpNested() { |
57 ++fNested; | 61 ++fNested; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 124 } |
121 | 125 |
122 int nextSpanID() { | 126 int nextSpanID() { |
123 return ++fSpanID; | 127 return ++fSpanID; |
124 } | 128 } |
125 #endif | 129 #endif |
126 | 130 |
127 Phase phase() const { | 131 Phase phase() const { |
128 return fPhase; | 132 return fPhase; |
129 } | 133 } |
| 134 |
| 135 void resetAllocatedOpSpan() { |
| 136 fAllocatedOpSpan = false; |
| 137 } |
| 138 |
| 139 void setAllocatedOpSpan() { |
| 140 fAllocatedOpSpan = true; |
| 141 } |
130 | 142 |
131 void setAngleCoincidence() { | 143 void setAngleCoincidence() { |
132 fAngleCoincidence = true; | 144 fAngleCoincidence = true; |
133 } | 145 } |
134 | 146 |
135 void setCoincidence(SkOpCoincidence* coincidence) { | 147 void setCoincidence(SkOpCoincidence* coincidence) { |
136 fCoincidence = coincidence; | 148 fCoincidence = coincidence; |
137 } | 149 } |
138 | 150 |
139 void setContourHead(SkOpContourHead* contourHead) { | 151 void setContourHead(SkOpContourHead* contourHead) { |
(...skipping 12 matching lines...) Expand all Loading... |
152 | 164 |
153 bool windingFailed() const { | 165 bool windingFailed() const { |
154 return fWindingFailed; | 166 return fWindingFailed; |
155 } | 167 } |
156 | 168 |
157 private: | 169 private: |
158 SkChunkAlloc* fAllocator; | 170 SkChunkAlloc* fAllocator; |
159 SkOpCoincidence* fCoincidence; | 171 SkOpCoincidence* fCoincidence; |
160 SkOpContourHead* fContourHead; | 172 SkOpContourHead* fContourHead; |
161 int fNested; | 173 int fNested; |
| 174 bool fAllocatedOpSpan; |
162 bool fWindingFailed; | 175 bool fWindingFailed; |
163 bool fAngleCoincidence; | 176 bool fAngleCoincidence; |
164 Phase fPhase; | 177 Phase fPhase; |
165 #ifdef SK_DEBUG | 178 #ifdef SK_DEBUG |
166 const char* fDebugTestName; | 179 const char* fDebugTestName; |
167 int fAngleID; | 180 int fAngleID; |
168 int fCoinID; | 181 int fCoinID; |
169 int fContourID; | 182 int fContourID; |
170 int fPtTID; | 183 int fPtTID; |
171 int fSegmentID; | 184 int fSegmentID; |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 */ | 591 */ |
579 inline int SkDSideBit(double x) { | 592 inline int SkDSideBit(double x) { |
580 return 1 << SKDSide(x); | 593 return 1 << SKDSide(x); |
581 } | 594 } |
582 | 595 |
583 inline double SkPinT(double t) { | 596 inline double SkPinT(double t) { |
584 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; | 597 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; |
585 } | 598 } |
586 | 599 |
587 #endif | 600 #endif |
OLD | NEW |