OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkPathOpsDebug_DEFINED | 7 #ifndef SkPathOpsDebug_DEFINED |
8 #define SkPathOpsDebug_DEFINED | 8 #define SkPathOpsDebug_DEFINED |
9 | 9 |
10 #include "SkPathOps.h" | 10 #include "SkPathOps.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #if FORCE_RELEASE | 38 #if FORCE_RELEASE |
39 | 39 |
40 #define DEBUG_ACTIVE_OP 0 | 40 #define DEBUG_ACTIVE_OP 0 |
41 #define DEBUG_ACTIVE_SPANS 0 | 41 #define DEBUG_ACTIVE_SPANS 0 |
42 #define DEBUG_ADD_INTERSECTING_TS 0 | 42 #define DEBUG_ADD_INTERSECTING_TS 0 |
43 #define DEBUG_ADD_T 0 | 43 #define DEBUG_ADD_T 0 |
44 #define DEBUG_ANGLE 0 | 44 #define DEBUG_ANGLE 0 |
45 #define DEBUG_ASSEMBLE 0 | 45 #define DEBUG_ASSEMBLE 0 |
46 #define DEBUG_CUBIC_BINARY_SEARCH 0 | 46 #define DEBUG_CUBIC_BINARY_SEARCH 0 |
47 #define DEBUG_CUBIC_SPLIT 0 | 47 #define DEBUG_CUBIC_SPLIT 0 |
48 #define DEBUG_DUMP_SEGMENTS 0 // 1 | 48 #define DEBUG_DUMP_SEGMENTS 0 |
49 #define DEBUG_FLOW 0 | 49 #define DEBUG_FLOW 0 |
50 #define DEBUG_LIMIT_WIND_SUM 0 | 50 #define DEBUG_LIMIT_WIND_SUM 0 |
51 #define DEBUG_MARK_DONE 0 | 51 #define DEBUG_MARK_DONE 0 |
52 #define DEBUG_PATH_CONSTRUCTION 0 | 52 #define DEBUG_PATH_CONSTRUCTION 0 |
53 #define DEBUG_PERP 0 | 53 #define DEBUG_PERP 0 |
54 #define DEBUG_SHOW_TEST_NAME 0 // 1 | 54 #define DEBUG_SHOW_TEST_NAME 0 |
55 #define DEBUG_SORT 0 | 55 #define DEBUG_SORT 0 |
56 #define DEBUG_SWAP_TOP 0 // 1 | |
57 #define DEBUG_T_SECT 0 | 56 #define DEBUG_T_SECT 0 |
58 #define DEBUG_T_SECT_DUMP 0 | 57 #define DEBUG_T_SECT_DUMP 0 |
59 #define DEBUG_VALIDATE 0 | 58 #define DEBUG_VALIDATE 0 |
60 #define DEBUG_WINDING 0 | 59 #define DEBUG_WINDING 0 |
61 #define DEBUG_WINDING_AT_T 0 | 60 #define DEBUG_WINDING_AT_T 0 |
62 | 61 |
63 #else | 62 #else |
64 | 63 |
65 #define DEBUG_ACTIVE_OP 1 | 64 #define DEBUG_ACTIVE_OP 1 |
66 #define DEBUG_ACTIVE_SPANS 1 | 65 #define DEBUG_ACTIVE_SPANS 1 |
67 #define DEBUG_ADD_INTERSECTING_TS 1 | 66 #define DEBUG_ADD_INTERSECTING_TS 1 |
68 #define DEBUG_ADD_T 1 | 67 #define DEBUG_ADD_T 1 |
69 #define DEBUG_ANGLE 1 | 68 #define DEBUG_ANGLE 1 |
70 #define DEBUG_ASSEMBLE 1 | 69 #define DEBUG_ASSEMBLE 1 |
71 #define DEBUG_CUBIC_BINARY_SEARCH 0 | 70 #define DEBUG_CUBIC_BINARY_SEARCH 0 |
72 #define DEBUG_CUBIC_SPLIT 1 | 71 #define DEBUG_CUBIC_SPLIT 1 |
73 #define DEBUG_DUMP_SEGMENTS 1 | 72 #define DEBUG_DUMP_SEGMENTS 1 |
74 #define DEBUG_FLOW 1 | 73 #define DEBUG_FLOW 1 |
75 #define DEBUG_LIMIT_WIND_SUM 5 | 74 #define DEBUG_LIMIT_WIND_SUM 5 |
76 #define DEBUG_MARK_DONE 1 | 75 #define DEBUG_MARK_DONE 1 |
77 #define DEBUG_PATH_CONSTRUCTION 1 | 76 #define DEBUG_PATH_CONSTRUCTION 1 |
78 #define DEBUG_PERP 1 | 77 #define DEBUG_PERP 1 |
79 #define DEBUG_SHOW_TEST_NAME 1 | 78 #define DEBUG_SHOW_TEST_NAME 1 |
80 #define DEBUG_SORT 1 | 79 #define DEBUG_SORT 1 |
81 #define DEBUG_SWAP_TOP 1 | |
82 #define DEBUG_T_SECT 0 | 80 #define DEBUG_T_SECT 0 |
83 #define DEBUG_T_SECT_DUMP 0 | 81 #define DEBUG_T_SECT_DUMP 0 |
84 #define DEBUG_VALIDATE 1 | 82 #define DEBUG_VALIDATE 1 |
85 #define DEBUG_WINDING 1 | 83 #define DEBUG_WINDING 1 |
86 #define DEBUG_WINDING_AT_T 1 | 84 #define DEBUG_WINDING_AT_T 1 |
87 | 85 |
88 #endif | 86 #endif |
89 | 87 |
90 #ifdef SK_RELEASE | 88 #ifdef SK_RELEASE |
91 #define SkDEBUGRELEASE(a, b) b | 89 #define SkDEBUGRELEASE(a, b) b |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 #define PT_DEBUG_DATA(i, n) i.pt(n).asSkPoint().fX, i.pt(n).asSkPoint().fY | 124 #define PT_DEBUG_DATA(i, n) i.pt(n).asSkPoint().fX, i.pt(n).asSkPoint().fY |
127 | 125 |
128 #ifndef DEBUG_TEST | 126 #ifndef DEBUG_TEST |
129 #define DEBUG_TEST 0 | 127 #define DEBUG_TEST 0 |
130 #endif | 128 #endif |
131 | 129 |
132 #if DEBUG_SHOW_TEST_NAME | 130 #if DEBUG_SHOW_TEST_NAME |
133 #include "SkTLS.h" | 131 #include "SkTLS.h" |
134 #endif | 132 #endif |
135 | 133 |
136 #include "SkTDArray.h" | |
137 | |
138 class SkPathOpsDebug { | 134 class SkPathOpsDebug { |
139 public: | 135 public: |
140 static const char* kLVerbStr[]; | 136 static const char* kLVerbStr[]; |
141 | 137 |
142 #if defined(SK_DEBUG) || !FORCE_RELEASE | 138 #if defined(SK_DEBUG) || !FORCE_RELEASE |
143 static int gContourID; | 139 static int gContourID; |
144 static int gSegmentID; | 140 static int gSegmentID; |
145 #endif | 141 #endif |
146 | 142 |
147 #if DEBUG_SORT || DEBUG_SWAP_TOP | 143 #if DEBUG_SORT |
148 static int gSortCountDefault; | 144 static int gSortCountDefault; |
149 static int gSortCount; | 145 static int gSortCount; |
150 #endif | 146 #endif |
151 | 147 |
152 #if DEBUG_ACTIVE_OP | 148 #if DEBUG_ACTIVE_OP |
153 static const char* kPathOpStr[]; | 149 static const char* kPathOpStr[]; |
154 #endif | 150 #endif |
155 | 151 |
156 static void MathematicaIze(char* str, size_t bufferSize); | 152 static void MathematicaIze(char* str, size_t bufferSize); |
157 static bool ValidWind(int winding); | 153 static bool ValidWind(int winding); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 static class SkOpContour* DebugSegmentContour(class SkOpSegment*, int id); | 189 static class SkOpContour* DebugSegmentContour(class SkOpSegment*, int id); |
194 static const class SkOpPtT* DebugSegmentPtT(const class SkOpSegment*, int id
); | 190 static const class SkOpPtT* DebugSegmentPtT(const class SkOpSegment*, int id
); |
195 static const class SkOpSegment* DebugSegmentSegment(const class SkOpSegment*
, int id); | 191 static const class SkOpSegment* DebugSegmentSegment(const class SkOpSegment*
, int id); |
196 static const class SkOpSpanBase* DebugSegmentSpan(const class SkOpSegment*,
int id); | 192 static const class SkOpSpanBase* DebugSegmentSpan(const class SkOpSegment*,
int id); |
197 | 193 |
198 static const struct SkOpAngle* DebugSpanAngle(const class SkOpSpanBase*, int
id); | 194 static const struct SkOpAngle* DebugSpanAngle(const class SkOpSpanBase*, int
id); |
199 static class SkOpContour* DebugSpanContour(class SkOpSpanBase*, int id); | 195 static class SkOpContour* DebugSpanContour(class SkOpSpanBase*, int id); |
200 static const class SkOpPtT* DebugSpanPtT(const class SkOpSpanBase*, int id); | 196 static const class SkOpPtT* DebugSpanPtT(const class SkOpSpanBase*, int id); |
201 static const class SkOpSegment* DebugSpanSegment(const class SkOpSpanBase*,
int id); | 197 static const class SkOpSegment* DebugSpanSegment(const class SkOpSpanBase*,
int id); |
202 static const class SkOpSpanBase* DebugSpanSpan(const class SkOpSpanBase*, in
t id); | 198 static const class SkOpSpanBase* DebugSpanSpan(const class SkOpSpanBase*, in
t id); |
203 | |
204 static void DumpContours(SkTDArray<class SkOpContour* >* contours); | |
205 static void DumpContoursAll(SkTDArray<class SkOpContour* >* contours); | |
206 static void DumpContoursAngles(const SkTDArray<class SkOpContour* >* contour
s); | |
207 static void DumpContoursPt(const SkTDArray<class SkOpContour* >* contours, i
nt id); | |
208 static void DumpContoursPts(const SkTDArray<class SkOpContour* >* contours); | |
209 static void DumpContoursSegment(const SkTDArray<class SkOpContour* >* contou
rs, int id); | |
210 static void DumpContoursSpan(const SkTDArray<class SkOpContour* >* contours,
int id); | |
211 static void DumpContoursSpans(const SkTDArray<class SkOpContour* >* contours
); | |
212 }; | 199 }; |
213 | 200 |
214 struct SkDQuad; | 201 struct SkDQuad; |
215 | 202 |
216 // generates tools/path_sorter.htm and path_visualizer.htm compatible data | 203 // generates tools/path_sorter.htm and path_visualizer.htm compatible data |
217 void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo); | 204 void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo); |
218 void DumpT(const SkDQuad& quad, double t); | 205 void DumpT(const SkDQuad& quad, double t); |
219 | 206 |
220 const struct SkOpAngle* DebugAngle(const SkTDArray<class SkOpContour* >* contour
s, int id); | |
221 class SkOpContour* DebugContour(const SkTDArray<class SkOpContour* >* contours,
int id); | |
222 const class SkOpPtT* DebugPtT(const SkTDArray<class SkOpContour* >* contours, in
t id); | |
223 const class SkOpSegment* DebugSegment(const SkTDArray<class SkOpContour* >* cont
ours, int id); | |
224 const class SkOpSpanBase* DebugSpan(const SkTDArray<class SkOpContour* >* contou
rs, int id); | |
225 | |
226 void Dump(const SkTDArray<class SkOpContour* >* contours); | |
227 void DumpAll(SkTDArray<class SkOpContour* >* contours); | |
228 void DumpAngles(const SkTDArray<class SkOpContour* >* contours); | |
229 void DumpCoin(const SkTDArray<class SkOpContour* >* contours); | |
230 void DumpPt(const SkTDArray<class SkOpContour* >* contours, int segmentID); | |
231 void DumpPts(const SkTDArray<class SkOpContour* >* contours); | |
232 void DumpSegment(const SkTDArray<class SkOpContour* >* contours, int segmentID); | |
233 void DumpSpan(const SkTDArray<class SkOpContour* >* contours, int spanID); | |
234 void DumpSpans(const SkTDArray<class SkOpContour* >* contours); | |
235 #endif | 207 #endif |
OLD | NEW |