| 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 "SkPathOpsConic.h" | 10 #include "SkPathOpsConic.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 fAllowNear = true; | 181 fAllowNear = true; |
| 182 fUsed = 0; | 182 fUsed = 0; |
| 183 sk_bzero(fIsCoincident, sizeof(fIsCoincident)); | 183 sk_bzero(fIsCoincident, sizeof(fIsCoincident)); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void set(bool swap, int tIndex, double t) { | 186 void set(bool swap, int tIndex, double t) { |
| 187 fT[(int) swap][tIndex] = t; | 187 fT[(int) swap][tIndex] = t; |
| 188 } | 188 } |
| 189 | 189 |
| 190 void setMax(int max) { | 190 void setMax(int max) { |
| 191 SkASSERT(max <= SK_ARRAY_COUNT(fPt)); |
| 191 fMax = max; | 192 fMax = max; |
| 192 } | 193 } |
| 193 | 194 |
| 194 void swap() { | 195 void swap() { |
| 195 fSwap ^= true; | 196 fSwap ^= true; |
| 196 } | 197 } |
| 197 | 198 |
| 198 bool swapped() const { | 199 bool swapped() const { |
| 199 return fSwap; | 200 return fSwap; |
| 200 } | 201 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 int debugCoincidentUsed() const; | 280 int debugCoincidentUsed() const; |
| 280 void dump() const; // implemented for testing only | 281 void dump() const; // implemented for testing only |
| 281 | 282 |
| 282 private: | 283 private: |
| 283 bool cubicCheckCoincidence(const SkDCubic& c1, const SkDCubic& c2); | 284 bool cubicCheckCoincidence(const SkDCubic& c1, const SkDCubic& c2); |
| 284 bool cubicExactEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic
2); | 285 bool cubicExactEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic
2); |
| 285 void cubicNearEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2
, const SkDRect& ); | 286 void cubicNearEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2
, const SkDRect& ); |
| 286 void cleanUpParallelLines(bool parallel); | 287 void cleanUpParallelLines(bool parallel); |
| 287 void computePoints(const SkDLine& line, int used); | 288 void computePoints(const SkDLine& line, int used); |
| 288 | 289 |
| 289 SkDPoint fPt[10]; // FIXME: since scans store points as SkPoint, this shoul
d also | 290 SkDPoint fPt[12]; // FIXME: since scans store points as SkPoint, this shoul
d also |
| 290 SkDPoint fPt2[2]; // used by nearly same to store alternate intersection po
int | 291 SkDPoint fPt2[2]; // used by nearly same to store alternate intersection po
int |
| 291 double fT[2][10]; | 292 double fT[2][12]; |
| 292 uint16_t fIsCoincident[2]; // bit set for each curve's coincident T | 293 uint16_t fIsCoincident[2]; // bit set for each curve's coincident T |
| 293 bool fNearlySame[2]; // true if end points nearly match | 294 bool fNearlySame[2]; // true if end points nearly match |
| 294 unsigned char fUsed; | 295 unsigned char fUsed; |
| 295 unsigned char fMax; | 296 unsigned char fMax; |
| 296 bool fAllowNear; | 297 bool fAllowNear; |
| 297 bool fSwap; | 298 bool fSwap; |
| 298 #ifdef SK_DEBUG | 299 #ifdef SK_DEBUG |
| 299 int fDepth; | 300 int fDepth; |
| 300 #endif | 301 #endif |
| 301 }; | 302 }; |
| 302 | 303 |
| 303 #endif | 304 #endif |
| OLD | NEW |