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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #define DEBUG_ADD_INTERSECTING_TS 0 | 44 #define DEBUG_ADD_INTERSECTING_TS 0 |
45 #define DEBUG_ADD_T_PAIR 0 | 45 #define DEBUG_ADD_T_PAIR 0 |
46 #define DEBUG_ANGLE 0 | 46 #define DEBUG_ANGLE 0 |
47 #define DEBUG_AS_C_CODE 1 | 47 #define DEBUG_AS_C_CODE 1 |
48 #define DEBUG_ASSEMBLE 0 | 48 #define DEBUG_ASSEMBLE 0 |
49 #define DEBUG_CHECK_ENDS 0 | 49 #define DEBUG_CHECK_ENDS 0 |
50 #define DEBUG_CHECK_TINY 0 | 50 #define DEBUG_CHECK_TINY 0 |
51 #define DEBUG_CONCIDENT 0 | 51 #define DEBUG_CONCIDENT 0 |
52 #define DEBUG_CROSS 0 | 52 #define DEBUG_CROSS 0 |
53 #define DEBUG_CUBIC_BINARY_SEARCH 0 | 53 #define DEBUG_CUBIC_BINARY_SEARCH 0 |
| 54 #define DEBUG_DUPLICATES 0 |
54 #define DEBUG_FLAT_QUADS 0 | 55 #define DEBUG_FLAT_QUADS 0 |
55 #define DEBUG_FLOW 0 | 56 #define DEBUG_FLOW 0 |
56 #define DEBUG_LIMIT_WIND_SUM 0 | 57 #define DEBUG_LIMIT_WIND_SUM 0 |
57 #define DEBUG_MARK_DONE 0 | 58 #define DEBUG_MARK_DONE 0 |
58 #define DEBUG_PATH_CONSTRUCTION 0 | 59 #define DEBUG_PATH_CONSTRUCTION 0 |
59 #define DEBUG_SHOW_TEST_NAME 0 | 60 #define DEBUG_SHOW_TEST_NAME 0 |
60 #define DEBUG_SHOW_TEST_PROGRESS 0 | 61 #define DEBUG_SHOW_TEST_PROGRESS 0 |
61 #define DEBUG_SHOW_WINDING 0 | 62 #define DEBUG_SHOW_WINDING 0 |
62 #define DEBUG_SORT 0 | 63 #define DEBUG_SORT 0 |
63 #define DEBUG_SORT_COMPACT 0 | 64 #define DEBUG_SORT_COMPACT 0 |
(...skipping 15 matching lines...) Expand all Loading... |
79 #define DEBUG_ADD_INTERSECTING_TS 1 | 80 #define DEBUG_ADD_INTERSECTING_TS 1 |
80 #define DEBUG_ADD_T_PAIR 1 | 81 #define DEBUG_ADD_T_PAIR 1 |
81 #define DEBUG_ANGLE 1 | 82 #define DEBUG_ANGLE 1 |
82 #define DEBUG_AS_C_CODE 1 | 83 #define DEBUG_AS_C_CODE 1 |
83 #define DEBUG_ASSEMBLE 1 | 84 #define DEBUG_ASSEMBLE 1 |
84 #define DEBUG_CHECK_ENDS 1 | 85 #define DEBUG_CHECK_ENDS 1 |
85 #define DEBUG_CHECK_TINY 1 | 86 #define DEBUG_CHECK_TINY 1 |
86 #define DEBUG_CONCIDENT 1 | 87 #define DEBUG_CONCIDENT 1 |
87 #define DEBUG_CROSS 01 | 88 #define DEBUG_CROSS 01 |
88 #define DEBUG_CUBIC_BINARY_SEARCH 1 | 89 #define DEBUG_CUBIC_BINARY_SEARCH 1 |
| 90 #define DEBUG_DUPLICATES 1 |
89 #define DEBUG_FLAT_QUADS 0 | 91 #define DEBUG_FLAT_QUADS 0 |
90 #define DEBUG_FLOW 1 | 92 #define DEBUG_FLOW 1 |
91 #define DEBUG_LIMIT_WIND_SUM 4 | 93 #define DEBUG_LIMIT_WIND_SUM 4 |
92 #define DEBUG_MARK_DONE 1 | 94 #define DEBUG_MARK_DONE 1 |
93 #define DEBUG_PATH_CONSTRUCTION 1 | 95 #define DEBUG_PATH_CONSTRUCTION 1 |
94 #define DEBUG_SHOW_TEST_NAME 1 | 96 #define DEBUG_SHOW_TEST_NAME 1 |
95 #define DEBUG_SHOW_TEST_PROGRESS 1 | 97 #define DEBUG_SHOW_TEST_PROGRESS 1 |
96 #define DEBUG_SHOW_WINDING 0 | 98 #define DEBUG_SHOW_WINDING 0 |
97 #define DEBUG_SORT 1 | 99 #define DEBUG_SORT 1 |
98 #define DEBUG_SORT_COMPACT 0 | 100 #define DEBUG_SORT_COMPACT 0 |
(...skipping 17 matching lines...) Expand all Loading... |
116 #define CUBIC_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g)" | 118 #define CUBIC_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g)" |
117 #define QUAD_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g)" | 119 #define QUAD_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g)" |
118 #define LINE_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g)" | 120 #define LINE_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g)" |
119 #define PT_DEBUG_STR "(%1.9g,%1.9g)" | 121 #define PT_DEBUG_STR "(%1.9g,%1.9g)" |
120 #endif | 122 #endif |
121 #define T_DEBUG_STR(t, n) #t "[" #n "]=%1.9g" | 123 #define T_DEBUG_STR(t, n) #t "[" #n "]=%1.9g" |
122 #define TX_DEBUG_STR(t) #t "[%d]=%1.9g" | 124 #define TX_DEBUG_STR(t) #t "[%d]=%1.9g" |
123 #define CUBIC_DEBUG_DATA(c) c[0].fX, c[0].fY, c[1].fX, c[1].fY, c[2].fX, c[2].fY
, c[3].fX, c[3].fY | 125 #define CUBIC_DEBUG_DATA(c) c[0].fX, c[0].fY, c[1].fX, c[1].fY, c[2].fX, c[2].fY
, c[3].fX, c[3].fY |
124 #define QUAD_DEBUG_DATA(q) q[0].fX, q[0].fY, q[1].fX, q[1].fY, q[2].fX, q[2].fY | 126 #define QUAD_DEBUG_DATA(q) q[0].fX, q[0].fY, q[1].fX, q[1].fY, q[2].fX, q[2].fY |
125 #define LINE_DEBUG_DATA(l) l[0].fX, l[0].fY, l[1].fX, l[1].fY | 127 #define LINE_DEBUG_DATA(l) l[0].fX, l[0].fY, l[1].fX, l[1].fY |
126 #define PT_DEBUG_DATA(i, n) i.pt(n).fX, i.pt(n).fY | 128 #define PT_DEBUG_DATA(i, n) i.pt(n).asSkPoint().fX, i.pt(n).asSkPoint().fY |
127 | 129 |
128 #ifndef DEBUG_TEST | 130 #ifndef DEBUG_TEST |
129 #define DEBUG_TEST 0 | 131 #define DEBUG_TEST 0 |
130 #endif | 132 #endif |
131 | 133 |
132 #if DEBUG_SHOW_TEST_NAME | 134 #if DEBUG_SHOW_TEST_NAME |
133 #include "SkTLS.h" | 135 #include "SkTLS.h" |
134 #endif | 136 #endif |
135 | 137 |
136 #include "SkTArray.h" | 138 #include "SkTArray.h" |
(...skipping 24 matching lines...) Expand all Loading... |
161 | 163 |
162 #if DEBUG_SHOW_TEST_NAME | 164 #if DEBUG_SHOW_TEST_NAME |
163 static void* CreateNameStr(); | 165 static void* CreateNameStr(); |
164 static void DeleteNameStr(void* v); | 166 static void DeleteNameStr(void* v); |
165 #define DEBUG_FILENAME_STRING_LENGTH 64 | 167 #define DEBUG_FILENAME_STRING_LENGTH 64 |
166 #define DEBUG_FILENAME_STRING (reinterpret_cast<char* >(SkTLS::Get(SkPathOpsDebu
g::CreateNameStr, \ | 168 #define DEBUG_FILENAME_STRING (reinterpret_cast<char* >(SkTLS::Get(SkPathOpsDebu
g::CreateNameStr, \ |
167 SkPathOpsDebug::DeleteNameStr))) | 169 SkPathOpsDebug::DeleteNameStr))) |
168 static void BumpTestName(char* ); | 170 static void BumpTestName(char* ); |
169 #endif | 171 #endif |
170 static void ShowPath(const SkPath& one, const SkPath& two, SkPathOp op, cons
t char* name); | 172 static void ShowPath(const SkPath& one, const SkPath& two, SkPathOp op, cons
t char* name); |
171 static void DumpAngles(const SkTArray<class SkOpAngle, true>& angles); | 173 static void DumpCoincidence(const SkTArray<class SkOpContour, true>& contour
s); |
172 static void DumpAngles(const SkTArray<class SkOpAngle* , true>& angles); | 174 static void DumpCoincidence(const SkTArray<class SkOpContour* , true>& conto
urs); |
173 static void DumpContours(const SkTArray<class SkOpContour, true>& contours); | 175 static void DumpContours(const SkTArray<class SkOpContour, true>& contours); |
174 static void DumpContours(const SkTArray<class SkOpContour* , true>& contours
); | 176 static void DumpContours(const SkTArray<class SkOpContour* , true>& contours
); |
175 static void DumpContourAngles(const SkTArray<class SkOpContour, true>& conto
urs); | 177 static void DumpContourAngles(const SkTArray<class SkOpContour, true>& conto
urs); |
176 static void DumpContourAngles(const SkTArray<class SkOpContour* , true>& con
tours); | 178 static void DumpContourAngles(const SkTArray<class SkOpContour* , true>& con
tours); |
| 179 static void DumpContourPt(const SkTArray<class SkOpContour, true>& contours,
int id); |
| 180 static void DumpContourPt(const SkTArray<class SkOpContour* , true>& contour
s, int id); |
177 static void DumpContourPts(const SkTArray<class SkOpContour, true>& contours
); | 181 static void DumpContourPts(const SkTArray<class SkOpContour, true>& contours
); |
178 static void DumpContourPts(const SkTArray<class SkOpContour* , true>& contou
rs); | 182 static void DumpContourPts(const SkTArray<class SkOpContour* , true>& contou
rs); |
| 183 static void DumpContourSpan(const SkTArray<class SkOpContour, true>& contour
s, int id); |
| 184 static void DumpContourSpan(const SkTArray<class SkOpContour* , true>& conto
urs, int id); |
179 static void DumpContourSpans(const SkTArray<class SkOpContour, true>& contou
rs); | 185 static void DumpContourSpans(const SkTArray<class SkOpContour, true>& contou
rs); |
180 static void DumpContourSpans(const SkTArray<class SkOpContour* , true>& cont
ours); | 186 static void DumpContourSpans(const SkTArray<class SkOpContour* , true>& cont
ours); |
181 static void DumpSpans(const SkTDArray<struct SkOpSpan *>& ); | 187 static void DumpSpans(const SkTDArray<struct SkOpSpan *>& ); |
182 static void DumpSpans(const SkTDArray<struct SkOpSpan *>* ); | 188 static void DumpSpans(const SkTDArray<struct SkOpSpan *>* ); |
183 }; | 189 }; |
184 | 190 |
185 // shorthand for calling from debugger | 191 // shorthand for calling from debugger |
186 void Dump(const SkTArray<class SkOpAngle, true>& angles); | |
187 void Dump(const SkTArray<class SkOpAngle* , true>& angles); | |
188 void Dump(const SkTArray<class SkOpAngle, true>* angles); | |
189 void Dump(const SkTArray<class SkOpAngle* , true>* angles); | |
190 | |
191 void Dump(const SkTArray<class SkOpContour, true>& contours); | 192 void Dump(const SkTArray<class SkOpContour, true>& contours); |
192 void Dump(const SkTArray<class SkOpContour* , true>& contours); | 193 void Dump(const SkTArray<class SkOpContour* , true>& contours); |
193 void Dump(const SkTArray<class SkOpContour, true>* contours); | 194 void Dump(const SkTArray<class SkOpContour, true>* contours); |
194 void Dump(const SkTArray<class SkOpContour* , true>* contours); | 195 void Dump(const SkTArray<class SkOpContour* , true>* contours); |
195 | 196 |
196 void Dump(const SkTDArray<SkOpSpan *>& chaseArray); | 197 void Dump(const SkTDArray<SkOpSpan* >& chase); |
197 void Dump(const SkTDArray<SkOpSpan *>* chaseArray); | 198 void Dump(const SkTDArray<SkOpSpan* >* chase); |
198 | 199 |
199 void DumpAngles(const SkTArray<class SkOpContour, true>& contours); | 200 void DumpAngles(const SkTArray<class SkOpContour, true>& contours); |
200 void DumpAngles(const SkTArray<class SkOpContour* , true>& contours); | 201 void DumpAngles(const SkTArray<class SkOpContour* , true>& contours); |
201 void DumpAngles(const SkTArray<class SkOpContour, true>* contours); | 202 void DumpAngles(const SkTArray<class SkOpContour, true>* contours); |
202 void DumpAngles(const SkTArray<class SkOpContour* , true>* contours); | 203 void DumpAngles(const SkTArray<class SkOpContour* , true>* contours); |
203 | 204 |
| 205 void DumpCoin(const SkTArray<class SkOpContour, true>& contours); |
| 206 void DumpCoin(const SkTArray<class SkOpContour* , true>& contours); |
| 207 void DumpCoin(const SkTArray<class SkOpContour, true>* contours); |
| 208 void DumpCoin(const SkTArray<class SkOpContour* , true>* contours); |
| 209 |
204 void DumpPts(const SkTArray<class SkOpContour, true>& contours); | 210 void DumpPts(const SkTArray<class SkOpContour, true>& contours); |
205 void DumpPts(const SkTArray<class SkOpContour* , true>& contours); | 211 void DumpPts(const SkTArray<class SkOpContour* , true>& contours); |
206 void DumpPts(const SkTArray<class SkOpContour, true>* contours); | 212 void DumpPts(const SkTArray<class SkOpContour, true>* contours); |
207 void DumpPts(const SkTArray<class SkOpContour* , true>* contours); | 213 void DumpPts(const SkTArray<class SkOpContour* , true>* contours); |
208 | 214 |
| 215 void DumpPt(const SkTArray<class SkOpContour, true>& contours, int segmentID); |
| 216 void DumpPt(const SkTArray<class SkOpContour* , true>& contours, int segmentID); |
| 217 void DumpPt(const SkTArray<class SkOpContour, true>* contours, int segmentID); |
| 218 void DumpPt(const SkTArray<class SkOpContour* , true>* contours, int segmentID); |
| 219 |
209 void DumpSpans(const SkTArray<class SkOpContour, true>& contours); | 220 void DumpSpans(const SkTArray<class SkOpContour, true>& contours); |
210 void DumpSpans(const SkTArray<class SkOpContour* , true>& contours); | 221 void DumpSpans(const SkTArray<class SkOpContour* , true>& contours); |
211 void DumpSpans(const SkTArray<class SkOpContour, true>* contours); | 222 void DumpSpans(const SkTArray<class SkOpContour, true>* contours); |
212 void DumpSpans(const SkTArray<class SkOpContour* , true>* contours); | 223 void DumpSpans(const SkTArray<class SkOpContour* , true>* contours); |
213 | 224 |
| 225 void DumpSpan(const SkTArray<class SkOpContour, true>& contours, int segmentID); |
| 226 void DumpSpan(const SkTArray<class SkOpContour* , true>& contours, int segmentID
); |
| 227 void DumpSpan(const SkTArray<class SkOpContour, true>* contours, int segmentID); |
| 228 void DumpSpan(const SkTArray<class SkOpContour* , true>* contours, int segmentID
); |
| 229 |
214 // generates tools/path_sorter.htm and path_visualizer.htm compatible data | 230 // generates tools/path_sorter.htm and path_visualizer.htm compatible data |
215 void DumpQ(const struct SkDQuad& quad1, const struct SkDQuad& quad2, int testNo)
; | 231 void DumpQ(const struct SkDQuad& quad1, const struct SkDQuad& quad2, int testNo)
; |
216 | 232 |
217 void DumpT(const struct SkDQuad& quad, double t); | 233 void DumpT(const struct SkDQuad& quad, double t); |
218 | 234 |
219 #endif | 235 #endif |
OLD | NEW |