| 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 10 matching lines...) Expand all Loading... |
| 21 kNo_PathOpsMask = 0, | 21 kNo_PathOpsMask = 0, |
| 22 kEvenOdd_PathOpsMask = 1 | 22 kEvenOdd_PathOpsMask = 1 |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 class SkOpCoincidence; | 25 class SkOpCoincidence; |
| 26 class SkOpContour; | 26 class SkOpContour; |
| 27 class SkOpContourHead; | 27 class SkOpContourHead; |
| 28 | 28 |
| 29 class SkOpGlobalState { | 29 class SkOpGlobalState { |
| 30 public: | 30 public: |
| 31 SkOpGlobalState(SkOpCoincidence* coincidence, SkOpContourHead* head) | 31 SkOpGlobalState(SkOpCoincidence* coincidence, SkOpContourHead* head); |
| 32 : fCoincidence(coincidence) | |
| 33 , fContourHead(head) | |
| 34 , fNested(0) | |
| 35 , fWindingFailed(false) | |
| 36 , fAngleCoincidence(false) | |
| 37 , fPhase(kIntersecting) | |
| 38 SkDEBUGPARAMS(fAngleID(0)) | |
| 39 SkDEBUGPARAMS(fContourID(0)) | |
| 40 SkDEBUGPARAMS(fPtTID(0)) | |
| 41 SkDEBUGPARAMS(fSegmentID(0)) | |
| 42 SkDEBUGPARAMS(fSpanID(0)) { | |
| 43 } | |
| 44 | 32 |
| 45 enum Phase { | 33 enum Phase { |
| 46 kIntersecting, | 34 kIntersecting, |
| 47 kWalking, | 35 kWalking, |
| 48 kFixWinding, | 36 kFixWinding, |
| 49 }; | 37 }; |
| 50 | 38 |
| 51 enum { | 39 enum { |
| 52 kMaxWindingTries = 10 | 40 kMaxWindingTries = 10 |
| 53 }; | 41 }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 69 } | 57 } |
| 70 | 58 |
| 71 SkOpContourHead* contourHead() { | 59 SkOpContourHead* contourHead() { |
| 72 return fContourHead; | 60 return fContourHead; |
| 73 } | 61 } |
| 74 | 62 |
| 75 #ifdef SK_DEBUG | 63 #ifdef SK_DEBUG |
| 76 const struct SkOpAngle* debugAngle(int id) const; | 64 const struct SkOpAngle* debugAngle(int id) const; |
| 77 SkOpContour* debugContour(int id); | 65 SkOpContour* debugContour(int id); |
| 78 const class SkOpPtT* debugPtT(int id) const; | 66 const class SkOpPtT* debugPtT(int id) const; |
| 67 bool debugRunFail() const; |
| 79 const class SkOpSegment* debugSegment(int id) const; | 68 const class SkOpSegment* debugSegment(int id) const; |
| 80 const class SkOpSpanBase* debugSpan(int id) const; | 69 const class SkOpSpanBase* debugSpan(int id) const; |
| 81 #endif | 70 #endif |
| 82 | 71 |
| 83 int nested() const { | 72 int nested() const { |
| 84 return fNested; | 73 return fNested; |
| 85 } | 74 } |
| 86 | 75 |
| 87 #ifdef SK_DEBUG | 76 #ifdef SK_DEBUG |
| 88 int nextAngleID() { | 77 int nextAngleID() { |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 */ | 501 */ |
| 513 inline int SkDSideBit(double x) { | 502 inline int SkDSideBit(double x) { |
| 514 return 1 << SKDSide(x); | 503 return 1 << SKDSide(x); |
| 515 } | 504 } |
| 516 | 505 |
| 517 inline double SkPinT(double t) { | 506 inline double SkPinT(double t) { |
| 518 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; | 507 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; |
| 519 } | 508 } |
| 520 | 509 |
| 521 #endif | 510 #endif |
| OLD | NEW |