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 SkDEBUGPARAMS(const char* testName)); |
32 | 33 |
33 enum Phase { | 34 enum Phase { |
34 kIntersecting, | 35 kIntersecting, |
35 kWalking, | 36 kWalking, |
36 kFixWinding, | 37 kFixWinding, |
37 }; | 38 }; |
38 | 39 |
39 enum { | 40 enum { |
40 kMaxWindingTries = 10 | 41 kMaxWindingTries = 10 |
41 }; | 42 }; |
(...skipping 18 matching lines...) Expand all Loading... |
60 return fContourHead; | 61 return fContourHead; |
61 } | 62 } |
62 | 63 |
63 #ifdef SK_DEBUG | 64 #ifdef SK_DEBUG |
64 const struct SkOpAngle* debugAngle(int id) const; | 65 const struct SkOpAngle* debugAngle(int id) const; |
65 SkOpContour* debugContour(int id); | 66 SkOpContour* debugContour(int id); |
66 const class SkOpPtT* debugPtT(int id) const; | 67 const class SkOpPtT* debugPtT(int id) const; |
67 bool debugRunFail() const; | 68 bool debugRunFail() const; |
68 const class SkOpSegment* debugSegment(int id) const; | 69 const class SkOpSegment* debugSegment(int id) const; |
69 const class SkOpSpanBase* debugSpan(int id) const; | 70 const class SkOpSpanBase* debugSpan(int id) const; |
| 71 const char* debugTestName() const { return fDebugTestName; } |
70 #endif | 72 #endif |
71 | 73 |
72 int nested() const { | 74 int nested() const { |
73 return fNested; | 75 return fNested; |
74 } | 76 } |
75 | 77 |
76 #ifdef SK_DEBUG | 78 #ifdef SK_DEBUG |
77 int nextAngleID() { | 79 int nextAngleID() { |
78 return ++fAngleID; | 80 return ++fAngleID; |
79 } | 81 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 123 } |
122 | 124 |
123 private: | 125 private: |
124 SkOpCoincidence* fCoincidence; | 126 SkOpCoincidence* fCoincidence; |
125 SkOpContourHead* fContourHead; | 127 SkOpContourHead* fContourHead; |
126 int fNested; | 128 int fNested; |
127 bool fWindingFailed; | 129 bool fWindingFailed; |
128 bool fAngleCoincidence; | 130 bool fAngleCoincidence; |
129 Phase fPhase; | 131 Phase fPhase; |
130 #ifdef SK_DEBUG | 132 #ifdef SK_DEBUG |
| 133 const char* fDebugTestName; |
131 int fAngleID; | 134 int fAngleID; |
132 int fContourID; | 135 int fContourID; |
133 int fPtTID; | 136 int fPtTID; |
134 int fSegmentID; | 137 int fSegmentID; |
135 int fSpanID; | 138 int fSpanID; |
136 #endif | 139 #endif |
137 }; | 140 }; |
138 | 141 |
139 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values. | 142 // Use Almost Equal when comparing coordinates. Use epsilon to compare T values. |
140 bool AlmostEqualUlps(float a, float b); | 143 bool AlmostEqualUlps(float a, float b); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 */ | 504 */ |
502 inline int SkDSideBit(double x) { | 505 inline int SkDSideBit(double x) { |
503 return 1 << SKDSide(x); | 506 return 1 << SKDSide(x); |
504 } | 507 } |
505 | 508 |
506 inline double SkPinT(double t) { | 509 inline double SkPinT(double t) { |
507 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; | 510 return precisely_less_than_zero(t) ? 0 : precisely_greater_than_one(t) ? 1 :
t; |
508 } | 511 } |
509 | 512 |
510 #endif | 513 #endif |
OLD | NEW |