| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 int quadQuad(const SkPoint a[3], const SkPoint b[3]) { | 177 int quadQuad(const SkPoint a[3], const SkPoint b[3]) { |
| 178 SkDQuad aQuad; | 178 SkDQuad aQuad; |
| 179 aQuad.set(a); | 179 aQuad.set(a); |
| 180 SkDQuad bQuad; | 180 SkDQuad bQuad; |
| 181 bQuad.set(b); | 181 bQuad.set(b); |
| 182 fMax = 4; | 182 fMax = 4; |
| 183 return intersect(aQuad, bQuad); | 183 return intersect(aQuad, bQuad); |
| 184 } | 184 } |
| 185 | 185 |
| 186 int quadRay(const SkPoint pts[3], const SkDLine& line); | |
| 187 void removeOne(int index); | |
| 188 | |
| 189 // leaves flip, swap, max alone | 186 // leaves flip, swap, max alone |
| 190 void reset() { | 187 void reset() { |
| 191 fAllowNear = true; | 188 fAllowNear = true; |
| 192 fUsed = 0; | 189 fUsed = 0; |
| 193 } | 190 } |
| 194 | 191 |
| 195 void setMax(int max) { | 192 void setMax(int max) { |
| 196 fMax = max; | 193 fMax = max; |
| 197 } | 194 } |
| 198 | 195 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 211 } | 208 } |
| 212 | 209 |
| 213 void downDepth() { | 210 void downDepth() { |
| 214 SkASSERT(--fDepth >= 0); | 211 SkASSERT(--fDepth >= 0); |
| 215 } | 212 } |
| 216 | 213 |
| 217 void upDepth() { | 214 void upDepth() { |
| 218 SkASSERT(++fDepth < 16); | 215 SkASSERT(++fDepth < 16); |
| 219 } | 216 } |
| 220 | 217 |
| 218 void append(const SkIntersections& ); |
| 221 static double Axial(const SkDQuad& , const SkDPoint& , bool vertical); | 219 static double Axial(const SkDQuad& , const SkDPoint& , bool vertical); |
| 222 void cleanUpCoincidence(); | 220 void cleanUpCoincidence(); |
| 223 int coincidentUsed() const; | 221 int coincidentUsed() const; |
| 224 int cubicRay(const SkPoint pts[4], const SkDLine& line); | 222 int cubicRay(const SkPoint pts[4], const SkDLine& line); |
| 225 void flip(); | 223 void flip(); |
| 226 int horizontal(const SkDLine&, double y); | 224 int horizontal(const SkDLine&, double y); |
| 227 int horizontal(const SkDLine&, double left, double right, double y, bool fli
pped); | 225 int horizontal(const SkDLine&, double left, double right, double y, bool fli
pped); |
| 228 int horizontal(const SkDQuad&, double left, double right, double y, bool fli
pped); | 226 int horizontal(const SkDQuad&, double left, double right, double y, bool fli
pped); |
| 229 int horizontal(const SkDQuad&, double left, double right, double y, double t
Range[2]); | 227 int horizontal(const SkDQuad&, double left, double right, double y, double t
Range[2]); |
| 230 int horizontal(const SkDCubic&, double y, double tRange[3]); | 228 int horizontal(const SkDCubic&, double y, double tRange[3]); |
| 231 int horizontal(const SkDCubic&, double left, double right, double y, bool fl
ipped); | 229 int horizontal(const SkDCubic&, double left, double right, double y, bool fl
ipped); |
| 232 int horizontal(const SkDCubic&, double left, double right, double y, double
tRange[3]); | 230 int horizontal(const SkDCubic&, double left, double right, double y, double
tRange[3]); |
| 233 // FIXME : does not respect swap | 231 // FIXME : does not respect swap |
| 234 int insert(double one, double two, const SkDPoint& pt); | 232 int insert(double one, double two, const SkDPoint& pt); |
| 235 void insertNear(double one, double two, const SkDPoint& pt); | 233 void insertNear(double one, double two, const SkDPoint& pt); |
| 236 // start if index == 0 : end if index == 1 | 234 // start if index == 0 : end if index == 1 |
| 237 void insertCoincident(double one, double two, const SkDPoint& pt); | 235 void insertCoincident(double one, double two, const SkDPoint& pt); |
| 238 int intersect(const SkDLine&, const SkDLine&); | 236 int intersect(const SkDLine&, const SkDLine&); |
| 239 int intersect(const SkDQuad&, const SkDLine&); | 237 int intersect(const SkDQuad&, const SkDLine&); |
| 240 int intersect(const SkDQuad&, const SkDQuad&); | 238 int intersect(const SkDQuad&, const SkDQuad&); |
| 241 int intersect(const SkDCubic&); // return true if cubic self-intersects | 239 int intersect(const SkDCubic&); // return true if cubic self-intersects |
| 242 int intersect(const SkDCubic&, const SkDLine&); | 240 int intersect(const SkDCubic&, const SkDLine&); |
| 243 int intersect(const SkDCubic&, const SkDQuad&); | 241 int intersect(const SkDCubic&, const SkDQuad&); |
| 244 int intersect(const SkDCubic&, const SkDCubic&); | 242 int intersect(const SkDCubic&, const SkDCubic&); |
| 245 int intersectRay(const SkDLine&, const SkDLine&); | 243 int intersectRay(const SkDLine&, const SkDLine&); |
| 246 int intersectRay(const SkDQuad&, const SkDLine&); | 244 int intersectRay(const SkDQuad&, const SkDLine&); |
| 247 int intersectRay(const SkDCubic&, const SkDLine&); | 245 int intersectRay(const SkDCubic&, const SkDLine&); |
| 248 static SkDPoint Line(const SkDLine&, const SkDLine&); | 246 static SkDPoint Line(const SkDLine&, const SkDLine&); |
| 247 int lineRay(const SkPoint pts[2], const SkDLine& line); |
| 249 void offset(int base, double start, double end); | 248 void offset(int base, double start, double end); |
| 250 void quickRemoveOne(int index, int replace); | 249 void quickRemoveOne(int index, int replace); |
| 250 int quadRay(const SkPoint pts[3], const SkDLine& line); |
| 251 void removeOne(int index); |
| 251 static bool Test(const SkDLine& , const SkDLine&); | 252 static bool Test(const SkDLine& , const SkDLine&); |
| 252 int vertical(const SkDLine&, double x); | 253 int vertical(const SkDLine&, double x); |
| 253 int vertical(const SkDLine&, double top, double bottom, double x, bool flipp
ed); | 254 int vertical(const SkDLine&, double top, double bottom, double x, bool flipp
ed); |
| 254 int vertical(const SkDQuad&, double top, double bottom, double x, bool flipp
ed); | 255 int vertical(const SkDQuad&, double top, double bottom, double x, bool flipp
ed); |
| 255 int vertical(const SkDCubic&, double top, double bottom, double x, bool flip
ped); | 256 int vertical(const SkDCubic&, double top, double bottom, double x, bool flip
ped); |
| 256 int verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bottom, SkScala
r x, bool flipped); | 257 int verticalCubic(const SkPoint a[4], SkScalar top, SkScalar bottom, SkScala
r x, bool flipped); |
| 257 int verticalLine(const SkPoint a[2], SkScalar top, SkScalar bottom, SkScalar
x, bool flipped); | 258 int verticalLine(const SkPoint a[2], SkScalar top, SkScalar bottom, SkScalar
x, bool flipped); |
| 258 int verticalQuad(const SkPoint a[3], SkScalar top, SkScalar bottom, SkScalar
x, bool flipped); | 259 int verticalQuad(const SkPoint a[3], SkScalar top, SkScalar bottom, SkScalar
x, bool flipped); |
| 259 | 260 |
| 260 int depth() const { | 261 int depth() const { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 285 #ifdef SK_DEBUG | 286 #ifdef SK_DEBUG |
| 286 int fDepth; | 287 int fDepth; |
| 287 #endif | 288 #endif |
| 288 }; | 289 }; |
| 289 | 290 |
| 290 extern int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine& ); | 291 extern int (SkIntersections::*CurveRay[])(const SkPoint[], const SkDLine& ); |
| 291 extern int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar top, Sk
Scalar bottom, | 292 extern int (SkIntersections::*CurveVertical[])(const SkPoint[], SkScalar top, Sk
Scalar bottom, |
| 292 SkScalar x, bool flipped); | 293 SkScalar x, bool flipped); |
| 293 | 294 |
| 294 #endif | 295 #endif |
| OLD | NEW |