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 SkIntersections_DEFINE | 7 #ifndef SkIntersections_DEFINE |
8 #define SkIntersections_DEFINE | 8 #define SkIntersections_DEFINE |
9 | 9 |
10 #include "SkPathOpsCubic.h" | 10 #include "SkPathOpsCubic.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 void downDepth() { | 204 void downDepth() { |
205 SkASSERT(--fDepth >= 0); | 205 SkASSERT(--fDepth >= 0); |
206 } | 206 } |
207 | 207 |
208 void upDepth() { | 208 void upDepth() { |
209 SkASSERT(++fDepth < 16); | 209 SkASSERT(++fDepth < 16); |
210 } | 210 } |
211 | 211 |
212 void append(const SkIntersections& ); | 212 void append(const SkIntersections& ); |
213 static double Axial(const SkDQuad& , const SkDPoint& , bool vertical); | |
214 void cleanUpCoincidence(); | 213 void cleanUpCoincidence(); |
215 int coincidentUsed() const; | 214 int coincidentUsed() const; |
216 int cubicRay(const SkPoint pts[4], const SkDLine& line); | 215 int cubicRay(const SkPoint pts[4], const SkDLine& line); |
217 void flip(); | 216 void flip(); |
218 int horizontal(const SkDLine&, double y); | 217 int horizontal(const SkDLine&, double y); |
219 int horizontal(const SkDLine&, double left, double right, double y, bool fli
pped); | 218 int horizontal(const SkDLine&, double left, double right, double y, bool fli
pped); |
220 int horizontal(const SkDQuad&, double left, double right, double y, bool fli
pped); | 219 int horizontal(const SkDQuad&, double left, double right, double y, bool fli
pped); |
221 int horizontal(const SkDQuad&, double left, double right, double y, double t
Range[2]); | 220 int horizontal(const SkDQuad&, double left, double right, double y, double t
Range[2]); |
222 int horizontal(const SkDCubic&, double y, double tRange[3]); | 221 int horizontal(const SkDCubic&, double y, double tRange[3]); |
223 int horizontal(const SkDCubic&, double left, double right, double y, bool fl
ipped); | 222 int horizontal(const SkDCubic&, double left, double right, double y, bool fl
ipped); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 return 0; | 258 return 0; |
260 #endif | 259 #endif |
261 } | 260 } |
262 | 261 |
263 private: | 262 private: |
264 bool cubicCheckCoincidence(const SkDCubic& c1, const SkDCubic& c2); | 263 bool cubicCheckCoincidence(const SkDCubic& c1, const SkDCubic& c2); |
265 bool cubicExactEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic
2); | 264 bool cubicExactEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic
2); |
266 void cubicNearEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2
, const SkDRect& ); | 265 void cubicNearEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2
, const SkDRect& ); |
267 void cleanUpParallelLines(bool parallel); | 266 void cleanUpParallelLines(bool parallel); |
268 void computePoints(const SkDLine& line, int used); | 267 void computePoints(const SkDLine& line, int used); |
269 // used by addCoincident to remove ordinary intersections in range | |
270 // void remove(double one, double two, const SkDPoint& startPt, const SkDPoin
t& endPt); | |
271 | 268 |
272 SkDPoint fPt[9]; // FIXME: since scans store points as SkPoint, this should
also | 269 SkDPoint fPt[9]; // FIXME: since scans store points as SkPoint, this should
also |
273 double fT[2][9]; | 270 double fT[2][9]; |
274 uint16_t fIsCoincident[2]; // bit set for each curve's coincident T | 271 uint16_t fIsCoincident[2]; // bit set for each curve's coincident T |
275 unsigned char fUsed; | 272 unsigned char fUsed; |
276 unsigned char fMax; | 273 unsigned char fMax; |
277 bool fAllowNear; | 274 bool fAllowNear; |
278 bool fSwap; | 275 bool fSwap; |
279 #ifdef SK_DEBUG | 276 #ifdef SK_DEBUG |
280 int fDepth; | 277 int fDepth; |
281 #endif | 278 #endif |
282 }; | 279 }; |
283 | 280 |
284 extern int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine& ); | 281 extern int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine& ); |
285 extern int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar top, Sk
Scalar bottom, | 282 extern int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar top, Sk
Scalar bottom, |
286 SkScalar x, bool flipped); | 283 SkScalar x, bool flipped); |
287 | 284 |
288 #endif | 285 #endif |
OLD | NEW |