caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 1 | /* |
| 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 SkIntersections_DEFINE |
| 8 | #define SkIntersections_DEFINE |
| 9 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 10 | #include "SkPathOpsConic.h" |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 11 | #include "SkPathOpsCubic.h" |
| 12 | #include "SkPathOpsLine.h" |
| 13 | #include "SkPathOpsPoint.h" |
| 14 | #include "SkPathOpsQuad.h" |
| 15 | |
| 16 | class SkIntersections { |
| 17 | public: |
caryclark | dae6b97 | 2016-06-08 04:28:19 -0700 | [diff] [blame] | 18 | SkIntersections(SkDEBUGCODE(SkOpGlobalState* globalState = nullptr)) |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 19 | : fSwap(0) |
| 20 | #ifdef SK_DEBUG |
caryclark | dae6b97 | 2016-06-08 04:28:19 -0700 | [diff] [blame] | 21 | SkDEBUGPARAMS(fDebugGlobalState(globalState)) |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 22 | , fDepth(0) |
| 23 | #endif |
| 24 | { |
| 25 | sk_bzero(fPt, sizeof(fPt)); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 26 | sk_bzero(fPt2, sizeof(fPt2)); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 27 | sk_bzero(fT, sizeof(fT)); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 28 | sk_bzero(fNearlySame, sizeof(fNearlySame)); |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 29 | #if DEBUG_T_SECT_LOOP_COUNT |
| 30 | sk_bzero(fDebugLoopCount, sizeof(fDebugLoopCount)); |
| 31 | #endif |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 32 | reset(); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 33 | fMax = 0; // require that the caller set the max |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | class TArray { |
| 37 | public: |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 38 | explicit TArray(const double ts[10]) : fTArray(ts) {} |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 39 | double operator[](int n) const { |
| 40 | return fTArray[n]; |
| 41 | } |
| 42 | const double* fTArray; |
| 43 | }; |
| 44 | TArray operator[](int n) const { return TArray(fT[n]); } |
| 45 | |
caryclark@google.com | fa2aeee | 2013-07-15 13:29:13 +0000 | [diff] [blame] | 46 | void allowNear(bool nearAllowed) { |
| 47 | fAllowNear = nearAllowed; |
| 48 | } |
| 49 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 50 | void clearCoincidence(int index) { |
| 51 | SkASSERT(index >= 0); |
| 52 | int bit = 1 << index; |
| 53 | fIsCoincident[0] &= ~bit; |
| 54 | fIsCoincident[1] &= ~bit; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 55 | } |
| 56 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 57 | int conicHorizontal(const SkPoint a[3], SkScalar weight, SkScalar left, SkScalar right, |
| 58 | SkScalar y, bool flipped) { |
| 59 | SkDConic conic; |
| 60 | conic.set(a, weight); |
| 61 | fMax = 2; |
| 62 | return horizontal(conic, left, right, y, flipped); |
| 63 | } |
| 64 | |
| 65 | int conicVertical(const SkPoint a[3], SkScalar weight, SkScalar top, SkScalar bottom, |
| 66 | SkScalar x, bool flipped) { |
| 67 | SkDConic conic; |
| 68 | conic.set(a, weight); |
| 69 | fMax = 2; |
| 70 | return vertical(conic, top, bottom, x, flipped); |
| 71 | } |
| 72 | |
| 73 | int conicLine(const SkPoint a[3], SkScalar weight, const SkPoint b[2]) { |
| 74 | SkDConic conic; |
| 75 | conic.set(a, weight); |
| 76 | SkDLine line; |
| 77 | line.set(b); |
| 78 | fMax = 3; // 2; permit small coincident segment + non-coincident intersection |
| 79 | return intersect(conic, line); |
| 80 | } |
| 81 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 82 | int cubicHorizontal(const SkPoint a[4], SkScalar left, SkScalar right, SkScalar y, |
| 83 | bool flipped) { |
| 84 | SkDCubic cubic; |
| 85 | cubic.set(a); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 86 | fMax = 3; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 87 | return horizontal(cubic, left, right, y, flipped); |
| 88 | } |
| 89 | |
| 90 | int cubicVertical(const SkPoint a[4], SkScalar top, SkScalar bottom, SkScalar x, bool flipped) { |
| 91 | SkDCubic cubic; |
| 92 | cubic.set(a); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 93 | fMax = 3; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 94 | return vertical(cubic, top, bottom, x, flipped); |
| 95 | } |
| 96 | |
| 97 | int cubicLine(const SkPoint a[4], const SkPoint b[2]) { |
| 98 | SkDCubic cubic; |
| 99 | cubic.set(a); |
| 100 | SkDLine line; |
| 101 | line.set(b); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 102 | fMax = 3; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 103 | return intersect(cubic, line); |
| 104 | } |
| 105 | |
caryclark | dae6b97 | 2016-06-08 04:28:19 -0700 | [diff] [blame] | 106 | #ifdef SK_DEBUG |
caryclark | a35ab3e | 2016-10-20 08:32:18 -0700 | [diff] [blame] | 107 | SkOpGlobalState* globalState() const { return fDebugGlobalState; } |
caryclark | dae6b97 | 2016-06-08 04:28:19 -0700 | [diff] [blame] | 108 | #endif |
| 109 | |
caryclark@google.com | fa2aeee | 2013-07-15 13:29:13 +0000 | [diff] [blame] | 110 | bool hasT(double t) const { |
| 111 | SkASSERT(t == 0 || t == 1); |
| 112 | return fUsed > 0 && (t == 0 ? fT[0][0] == 0 : fT[0][fUsed - 1] == 1); |
| 113 | } |
| 114 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 115 | bool hasOppT(double t) const { |
| 116 | SkASSERT(t == 0 || t == 1); |
| 117 | return fUsed > 0 && (fT[1][0] == t || fT[1][fUsed - 1] == t); |
| 118 | } |
| 119 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 120 | int insertSwap(double one, double two, const SkDPoint& pt) { |
| 121 | if (fSwap) { |
| 122 | return insert(two, one, pt); |
| 123 | } else { |
| 124 | return insert(one, two, pt); |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | bool isCoincident(int index) { |
| 129 | return (fIsCoincident[0] & 1 << index) != 0; |
| 130 | } |
| 131 | |
| 132 | int lineHorizontal(const SkPoint a[2], SkScalar left, SkScalar right, SkScalar y, |
| 133 | bool flipped) { |
| 134 | SkDLine line; |
| 135 | line.set(a); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 136 | fMax = 2; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 137 | return horizontal(line, left, right, y, flipped); |
| 138 | } |
| 139 | |
| 140 | int lineVertical(const SkPoint a[2], SkScalar top, SkScalar bottom, SkScalar x, bool flipped) { |
| 141 | SkDLine line; |
| 142 | line.set(a); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 143 | fMax = 2; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 144 | return vertical(line, top, bottom, x, flipped); |
| 145 | } |
| 146 | |
| 147 | int lineLine(const SkPoint a[2], const SkPoint b[2]) { |
| 148 | SkDLine aLine, bLine; |
| 149 | aLine.set(a); |
| 150 | bLine.set(b); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 151 | fMax = 2; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 152 | return intersect(aLine, bLine); |
| 153 | } |
| 154 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 155 | bool nearlySame(int index) const { |
| 156 | SkASSERT(index == 0 || index == 1); |
| 157 | return fNearlySame[index]; |
| 158 | } |
| 159 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 160 | const SkDPoint& pt(int index) const { |
| 161 | return fPt[index]; |
| 162 | } |
| 163 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 164 | const SkDPoint& pt2(int index) const { |
| 165 | return fPt2[index]; |
| 166 | } |
| 167 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 168 | int quadHorizontal(const SkPoint a[3], SkScalar left, SkScalar right, SkScalar y, |
| 169 | bool flipped) { |
| 170 | SkDQuad quad; |
| 171 | quad.set(a); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 172 | fMax = 2; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 173 | return horizontal(quad, left, right, y, flipped); |
| 174 | } |
| 175 | |
| 176 | int quadVertical(const SkPoint a[3], SkScalar top, SkScalar bottom, SkScalar x, bool flipped) { |
| 177 | SkDQuad quad; |
| 178 | quad.set(a); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 179 | fMax = 2; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 180 | return vertical(quad, top, bottom, x, flipped); |
| 181 | } |
| 182 | |
| 183 | int quadLine(const SkPoint a[3], const SkPoint b[2]) { |
| 184 | SkDQuad quad; |
| 185 | quad.set(a); |
| 186 | SkDLine line; |
| 187 | line.set(b); |
| 188 | return intersect(quad, line); |
| 189 | } |
| 190 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 191 | // leaves swap, max alone |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 192 | void reset() { |
caryclark@google.com | fa2aeee | 2013-07-15 13:29:13 +0000 | [diff] [blame] | 193 | fAllowNear = true; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 194 | fUsed = 0; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 195 | sk_bzero(fIsCoincident, sizeof(fIsCoincident)); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 196 | } |
| 197 | |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 198 | void set(bool swap, int tIndex, double t) { |
| 199 | fT[(int) swap][tIndex] = t; |
| 200 | } |
| 201 | |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 202 | void setMax(int max) { |
caryclark | 94c902e | 2015-08-18 07:12:43 -0700 | [diff] [blame] | 203 | SkASSERT(max <= (int) SK_ARRAY_COUNT(fPt)); |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 204 | fMax = max; |
| 205 | } |
| 206 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 207 | void swap() { |
| 208 | fSwap ^= true; |
| 209 | } |
| 210 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 211 | bool swapped() const { |
| 212 | return fSwap; |
| 213 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 214 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 215 | int used() const { |
| 216 | return fUsed; |
| 217 | } |
| 218 | |
| 219 | void downDepth() { |
| 220 | SkASSERT(--fDepth >= 0); |
| 221 | } |
| 222 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 223 | bool unBumpT(int index) { |
| 224 | SkASSERT(fUsed == 1); |
| 225 | fT[0][index] = fT[0][index] * (1 + BUMP_EPSILON * 2) - BUMP_EPSILON; |
| 226 | if (!between(0, fT[0][index], 1)) { |
| 227 | fUsed = 0; |
| 228 | return false; |
| 229 | } |
| 230 | return true; |
| 231 | } |
| 232 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 233 | void upDepth() { |
| 234 | SkASSERT(++fDepth < 16); |
| 235 | } |
| 236 | |
caryclark | 65f5531 | 2014-11-13 06:58:52 -0800 | [diff] [blame] | 237 | void alignQuadPts(const SkPoint a[3], const SkPoint b[3]); |
caryclark | 65f5531 | 2014-11-13 06:58:52 -0800 | [diff] [blame] | 238 | int cleanUpCoincidence(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 239 | int closestTo(double rangeStart, double rangeEnd, const SkDPoint& testPt, double* dist) const; |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 240 | void cubicInsert(double one, double two, const SkDPoint& pt, const SkDCubic& c1, |
| 241 | const SkDCubic& c2); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 242 | void flip(); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 243 | int horizontal(const SkDLine&, double left, double right, double y, bool flipped); |
| 244 | int horizontal(const SkDQuad&, double left, double right, double y, bool flipped); |
| 245 | int horizontal(const SkDQuad&, double left, double right, double y, double tRange[2]); |
| 246 | int horizontal(const SkDCubic&, double y, double tRange[3]); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 247 | int horizontal(const SkDConic&, double left, double right, double y, bool flipped); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 248 | int horizontal(const SkDCubic&, double left, double right, double y, bool flipped); |
| 249 | int horizontal(const SkDCubic&, double left, double right, double y, double tRange[3]); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 250 | static double HorizontalIntercept(const SkDLine& line, double y); |
| 251 | static int HorizontalIntercept(const SkDQuad& quad, SkScalar y, double* roots); |
| 252 | static int HorizontalIntercept(const SkDConic& conic, SkScalar y, double* roots); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 253 | // FIXME : does not respect swap |
| 254 | int insert(double one, double two, const SkDPoint& pt); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 255 | void insertNear(double one, double two, const SkDPoint& pt1, const SkDPoint& pt2); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 256 | // start if index == 0 : end if index == 1 |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 257 | int insertCoincident(double one, double two, const SkDPoint& pt); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 258 | int intersect(const SkDLine&, const SkDLine&); |
| 259 | int intersect(const SkDQuad&, const SkDLine&); |
| 260 | int intersect(const SkDQuad&, const SkDQuad&); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 261 | int intersect(const SkDConic&, const SkDLine&); |
| 262 | int intersect(const SkDConic&, const SkDQuad&); |
| 263 | int intersect(const SkDConic&, const SkDConic&); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 264 | int intersect(const SkDCubic&, const SkDLine&); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 265 | int intersect(const SkDCubic&, const SkDQuad&); |
| 266 | int intersect(const SkDCubic&, const SkDConic&); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 267 | int intersect(const SkDCubic&, const SkDCubic&); |
caryclark@google.com | cffbcc3 | 2013-06-04 17:59:42 +0000 | [diff] [blame] | 268 | int intersectRay(const SkDLine&, const SkDLine&); |
| 269 | int intersectRay(const SkDQuad&, const SkDLine&); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 270 | int intersectRay(const SkDConic&, const SkDLine&); |
caryclark@google.com | cffbcc3 | 2013-06-04 17:59:42 +0000 | [diff] [blame] | 271 | int intersectRay(const SkDCubic&, const SkDLine&); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 272 | void merge(const SkIntersections& , int , const SkIntersections& , int ); |
| 273 | int mostOutside(double rangeStart, double rangeEnd, const SkDPoint& origin) const; |
caryclark@google.com | a2bbc6e | 2013-11-01 17:36:03 +0000 | [diff] [blame] | 274 | void removeOne(int index); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 275 | void setCoincident(int index); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 276 | int vertical(const SkDLine&, double top, double bottom, double x, bool flipped); |
| 277 | int vertical(const SkDQuad&, double top, double bottom, double x, bool flipped); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 278 | int vertical(const SkDConic&, double top, double bottom, double x, bool flipped); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 279 | int vertical(const SkDCubic&, double top, double bottom, double x, bool flipped); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 280 | static double VerticalIntercept(const SkDLine& line, double x); |
| 281 | static int VerticalIntercept(const SkDQuad& quad, SkScalar x, double* roots); |
| 282 | static int VerticalIntercept(const SkDConic& conic, SkScalar x, double* roots); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 283 | |
| 284 | int depth() const { |
| 285 | #ifdef SK_DEBUG |
| 286 | return fDepth; |
| 287 | #else |
| 288 | return 0; |
| 289 | #endif |
| 290 | } |
| 291 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 292 | enum DebugLoop { |
| 293 | kIterations_DebugLoop, |
| 294 | kCoinCheck_DebugLoop, |
| 295 | kComputePerp_DebugLoop, |
| 296 | }; |
| 297 | |
| 298 | void debugBumpLoopCount(DebugLoop ); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 299 | int debugCoincidentUsed() const; |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 300 | int debugLoopCount(DebugLoop ) const; |
| 301 | void debugResetLoopCount(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 302 | void dump() const; // implemented for testing only |
| 303 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 304 | private: |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 305 | bool cubicCheckCoincidence(const SkDCubic& c1, const SkDCubic& c2); |
| 306 | bool cubicExactEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2); |
| 307 | void cubicNearEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2, const SkDRect& ); |
| 308 | void cleanUpParallelLines(bool parallel); |
| 309 | void computePoints(const SkDLine& line, int used); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 310 | |
caryclark | a35ab3e | 2016-10-20 08:32:18 -0700 | [diff] [blame] | 311 | SkDPoint fPt[13]; // FIXME: since scans store points as SkPoint, this should also |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 312 | SkDPoint fPt2[2]; // used by nearly same to store alternate intersection point |
caryclark | a35ab3e | 2016-10-20 08:32:18 -0700 | [diff] [blame] | 313 | double fT[2][13]; |
caryclark@google.com | 570863f | 2013-09-16 15:55:01 +0000 | [diff] [blame] | 314 | uint16_t fIsCoincident[2]; // bit set for each curve's coincident T |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 315 | bool fNearlySame[2]; // true if end points nearly match |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 316 | unsigned char fUsed; |
caryclark@google.com | 7eaa53d | 2013-10-02 14:49:34 +0000 | [diff] [blame] | 317 | unsigned char fMax; |
caryclark@google.com | fa2aeee | 2013-07-15 13:29:13 +0000 | [diff] [blame] | 318 | bool fAllowNear; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 319 | bool fSwap; |
| 320 | #ifdef SK_DEBUG |
caryclark | dae6b97 | 2016-06-08 04:28:19 -0700 | [diff] [blame] | 321 | SkOpGlobalState* fDebugGlobalState; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 322 | int fDepth; |
| 323 | #endif |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 324 | #if DEBUG_T_SECT_LOOP_COUNT |
| 325 | int fDebugLoopCount[3]; |
| 326 | #endif |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 327 | }; |
| 328 | |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 329 | #endif |