Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(730)

Side by Side Diff: src/pathops/SkPathOpsDebug.h

Issue 2128633003: pathops coincidence and security rewrite (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: require resulting t to be between 0 and 1 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 19 matching lines...) Expand all
30 #ifdef SK_BUILD_FOR_WIN 30 #ifdef SK_BUILD_FOR_WIN
31 #define SK_SNPRINTF _snprintf 31 #define SK_SNPRINTF _snprintf
32 #else 32 #else
33 #define SK_SNPRINTF snprintf 33 #define SK_SNPRINTF snprintf
34 #endif 34 #endif
35 35
36 #define WIND_AS_STRING(x) char x##Str[12]; \ 36 #define WIND_AS_STRING(x) char x##Str[12]; \
37 if (!SkPathOpsDebug::ValidWind(x)) strcpy(x##Str, "?"); \ 37 if (!SkPathOpsDebug::ValidWind(x)) strcpy(x##Str, "?"); \
38 else SK_SNPRINTF(x##Str, sizeof(x##Str), "%d", x) 38 else SK_SNPRINTF(x##Str, sizeof(x##Str), "%d", x)
39 39
40 #define DEBUG_UNDER_DEVELOPMENT 01
41
40 #if FORCE_RELEASE 42 #if FORCE_RELEASE
41 43
42 #define DEBUG_ACTIVE_OP 0 44 #define DEBUG_ACTIVE_OP 0
43 #define DEBUG_ACTIVE_SPANS 0 45 #define DEBUG_ACTIVE_SPANS 0
44 #define DEBUG_ADD_INTERSECTING_TS 0 46 #define DEBUG_ADD_INTERSECTING_TS 0
45 #define DEBUG_ADD_T 0 47 #define DEBUG_ADD_T 0
46 #define DEBUG_ALIGNMENT 0 48 #define DEBUG_ALIGNMENT 0
47 #define DEBUG_ANGLE 0 49 #define DEBUG_ANGLE 0
48 #define DEBUG_ASSEMBLE 0 50 #define DEBUG_ASSEMBLE 0
49 #define DEBUG_COINCIDENCE 0 51 #define DEBUG_COINCIDENCE 0
52 #define DEBUG_COINCIDENCE_VERBOSE 0
50 #define DEBUG_CUBIC_BINARY_SEARCH 0 53 #define DEBUG_CUBIC_BINARY_SEARCH 0
51 #define DEBUG_CUBIC_SPLIT 0 54 #define DEBUG_CUBIC_SPLIT 0
52 #define DEBUG_DUMP_SEGMENTS 0 55 #define DEBUG_DUMP_SEGMENTS 0
53 #define DEBUG_FLOW 0 56 #define DEBUG_FLOW 0
54 #define DEBUG_LIMIT_WIND_SUM 0 57 #define DEBUG_LIMIT_WIND_SUM 0
55 #define DEBUG_MARK_DONE 0 58 #define DEBUG_MARK_DONE 0
56 #define DEBUG_PATH_CONSTRUCTION 0 59 #define DEBUG_PATH_CONSTRUCTION 0
57 #define DEBUG_PERP 0 60 #define DEBUG_PERP 0
58 #define DEBUG_SHOW_TEST_NAME 0 61 #define DEBUG_SHOW_TEST_NAME 0
59 #define DEBUG_SORT 0 62 #define DEBUG_SORT 0
60 #define DEBUG_T_SECT 0 63 #define DEBUG_T_SECT 0
61 #define DEBUG_T_SECT_DUMP 0 64 #define DEBUG_T_SECT_DUMP 0
62 #define DEBUG_T_SECT_LOOP_COUNT 0 65 #define DEBUG_T_SECT_LOOP_COUNT 0
63 #define DEBUG_VALIDATE 0 66 #define DEBUG_VALIDATE 0
64 #define DEBUG_WINDING 0 67 #define DEBUG_WINDING 0
65 #define DEBUG_WINDING_AT_T 0 68 #define DEBUG_WINDING_AT_T 0
66 69
67 70
68 #else 71 #else
69 72
70 #define DEBUG_ACTIVE_OP 1 73 #define DEBUG_ACTIVE_OP 1
71 #define DEBUG_ACTIVE_SPANS 1 74 #define DEBUG_ACTIVE_SPANS 1
72 #define DEBUG_ADD_INTERSECTING_TS 1 75 #define DEBUG_ADD_INTERSECTING_TS 1
73 #define DEBUG_ADD_T 1 76 #define DEBUG_ADD_T 1
74 #define DEBUG_ALIGNMENT 0 77 #define DEBUG_ALIGNMENT 0
75 #define DEBUG_ANGLE 1 78 #define DEBUG_ANGLE 1
76 #define DEBUG_ASSEMBLE 1 79 #define DEBUG_ASSEMBLE 1
77 #define DEBUG_COINCIDENCE 0 80 #define DEBUG_COINCIDENCE 01
81 #define DEBUG_COINCIDENCE_VERBOSE 01
78 #define DEBUG_CUBIC_BINARY_SEARCH 0 82 #define DEBUG_CUBIC_BINARY_SEARCH 0
79 #define DEBUG_CUBIC_SPLIT 1 83 #define DEBUG_CUBIC_SPLIT 1
80 #define DEBUG_DUMP_SEGMENTS 1 84 #define DEBUG_DUMP_SEGMENTS 1
81 #define DEBUG_FLOW 1 85 #define DEBUG_FLOW 1
82 #define DEBUG_LIMIT_WIND_SUM 5 86 #define DEBUG_LIMIT_WIND_SUM 15
83 #define DEBUG_MARK_DONE 1 87 #define DEBUG_MARK_DONE 1
84 #define DEBUG_PATH_CONSTRUCTION 1 88 #define DEBUG_PATH_CONSTRUCTION 1
85 #define DEBUG_PERP 1 89 #define DEBUG_PERP 1
86 #define DEBUG_SHOW_TEST_NAME 1 90 #define DEBUG_SHOW_TEST_NAME 1
87 #define DEBUG_SORT 1 91 #define DEBUG_SORT 1
88 #define DEBUG_T_SECT 0 92 #define DEBUG_T_SECT 0
89 #define DEBUG_T_SECT_DUMP 0 93 #define DEBUG_T_SECT_DUMP 0
90 #define DEBUG_T_SECT_LOOP_COUNT 0 94 #define DEBUG_T_SECT_LOOP_COUNT 0
91 #define DEBUG_VALIDATE 1 95 #define DEBUG_VALIDATE 1
92 #define DEBUG_WINDING 1 96 #define DEBUG_WINDING 1
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 183
180 #if DEBUG_SHOW_TEST_NAME 184 #if DEBUG_SHOW_TEST_NAME
181 static void* CreateNameStr(); 185 static void* CreateNameStr();
182 static void DeleteNameStr(void* v); 186 static void DeleteNameStr(void* v);
183 #define DEBUG_FILENAME_STRING_LENGTH 64 187 #define DEBUG_FILENAME_STRING_LENGTH 64
184 #define DEBUG_FILENAME_STRING (reinterpret_cast<char* >(SkTLS::Get(SkPathOpsDebu g::CreateNameStr, \ 188 #define DEBUG_FILENAME_STRING (reinterpret_cast<char* >(SkTLS::Get(SkPathOpsDebu g::CreateNameStr, \
185 SkPathOpsDebug::DeleteNameStr))) 189 SkPathOpsDebug::DeleteNameStr)))
186 static void BumpTestName(char* ); 190 static void BumpTestName(char* );
187 #endif 191 #endif
188 static const char* OpStr(SkPathOp ); 192 static const char* OpStr(SkPathOp );
193 static void ShowActiveSpans(SkOpContourHead* contourList);
189 static void ShowOnePath(const SkPath& path, const char* name, bool includeDe claration); 194 static void ShowOnePath(const SkPath& path, const char* name, bool includeDe claration);
190 static void ShowPath(const SkPath& one, const SkPath& two, SkPathOp op, cons t char* name); 195 static void ShowPath(const SkPath& one, const SkPath& two, SkPathOp op, cons t char* name);
191 196
192 static bool ChaseContains(const SkTDArray<class SkOpSpanBase*>& , const clas s SkOpSpanBase* ); 197 static bool ChaseContains(const SkTDArray<class SkOpSpanBase*>& , const clas s SkOpSpanBase* );
193 198
194 static void CheckHealth(class SkOpContourHead* contourList, const char* id); 199 static void CheckHealth(class SkOpContourHead* contourList, const char* id);
195 200
196 static const struct SkOpAngle* DebugAngleAngle(const struct SkOpAngle*, int id); 201 static const class SkOpAngle* DebugAngleAngle(const class SkOpAngle*, int id );
197 static class SkOpContour* DebugAngleContour(struct SkOpAngle*, int id); 202 static class SkOpContour* DebugAngleContour(class SkOpAngle*, int id);
198 static const class SkOpPtT* DebugAnglePtT(const struct SkOpAngle*, int id); 203 static const class SkOpPtT* DebugAnglePtT(const class SkOpAngle*, int id);
199 static const class SkOpSegment* DebugAngleSegment(const struct SkOpAngle*, i nt id); 204 static const class SkOpSegment* DebugAngleSegment(const class SkOpAngle*, in t id);
200 static const class SkOpSpanBase* DebugAngleSpan(const struct SkOpAngle*, int id); 205 static const class SkOpSpanBase* DebugAngleSpan(const class SkOpAngle*, int id);
201 206
202 static const struct SkOpAngle* DebugContourAngle(class SkOpContour*, int id) ; 207 static const class SkOpAngle* DebugContourAngle(class SkOpContour*, int id);
203 static class SkOpContour* DebugContourContour(class SkOpContour*, int id); 208 static class SkOpContour* DebugContourContour(class SkOpContour*, int id);
204 static const class SkOpPtT* DebugContourPtT(class SkOpContour*, int id); 209 static const class SkOpPtT* DebugContourPtT(class SkOpContour*, int id);
205 static const class SkOpSegment* DebugContourSegment(class SkOpContour*, int id); 210 static const class SkOpSegment* DebugContourSegment(class SkOpContour*, int id);
206 static const class SkOpSpanBase* DebugContourSpan(class SkOpContour*, int id ); 211 static const class SkOpSpanBase* DebugContourSpan(class SkOpContour*, int id );
207 212
208 static const struct SkOpAngle* DebugCoincidenceAngle(class SkOpCoincidence*, int id); 213 static const class SkOpAngle* DebugCoincidenceAngle(class SkOpCoincidence*, int id);
209 static class SkOpContour* DebugCoincidenceContour(class SkOpCoincidence*, in t id); 214 static class SkOpContour* DebugCoincidenceContour(class SkOpCoincidence*, in t id);
210 static const class SkOpPtT* DebugCoincidencePtT(class SkOpCoincidence*, int id); 215 static const class SkOpPtT* DebugCoincidencePtT(class SkOpCoincidence*, int id);
211 static const class SkOpSegment* DebugCoincidenceSegment(class SkOpCoincidenc e*, int id); 216 static const class SkOpSegment* DebugCoincidenceSegment(class SkOpCoincidenc e*, int id);
212 static const class SkOpSpanBase* DebugCoincidenceSpan(class SkOpCoincidence* , int id); 217 static const class SkOpSpanBase* DebugCoincidenceSpan(class SkOpCoincidence* , int id);
213 218
214 static const struct SkOpAngle* DebugPtTAngle(const class SkOpPtT*, int id); 219 static const class SkOpAngle* DebugPtTAngle(const class SkOpPtT*, int id);
215 static class SkOpContour* DebugPtTContour(class SkOpPtT*, int id); 220 static class SkOpContour* DebugPtTContour(class SkOpPtT*, int id);
216 static const class SkOpPtT* DebugPtTPtT(const class SkOpPtT*, int id); 221 static const class SkOpPtT* DebugPtTPtT(const class SkOpPtT*, int id);
217 static const class SkOpSegment* DebugPtTSegment(const class SkOpPtT*, int id ); 222 static const class SkOpSegment* DebugPtTSegment(const class SkOpPtT*, int id );
218 static const class SkOpSpanBase* DebugPtTSpan(const class SkOpPtT*, int id); 223 static const class SkOpSpanBase* DebugPtTSpan(const class SkOpPtT*, int id);
219 224
220 static const struct SkOpAngle* DebugSegmentAngle(const class SkOpSegment*, i nt id); 225 static const class SkOpAngle* DebugSegmentAngle(const class SkOpSegment*, in t id);
221 static class SkOpContour* DebugSegmentContour(class SkOpSegment*, int id); 226 static class SkOpContour* DebugSegmentContour(class SkOpSegment*, int id);
222 static const class SkOpPtT* DebugSegmentPtT(const class SkOpSegment*, int id ); 227 static const class SkOpPtT* DebugSegmentPtT(const class SkOpSegment*, int id );
223 static const class SkOpSegment* DebugSegmentSegment(const class SkOpSegment* , int id); 228 static const class SkOpSegment* DebugSegmentSegment(const class SkOpSegment* , int id);
224 static const class SkOpSpanBase* DebugSegmentSpan(const class SkOpSegment*, int id); 229 static const class SkOpSpanBase* DebugSegmentSpan(const class SkOpSegment*, int id);
225 230
226 static const struct SkOpAngle* DebugSpanAngle(const class SkOpSpanBase*, int id); 231 static const class SkOpAngle* DebugSpanAngle(const class SkOpSpanBase*, int id);
227 static class SkOpContour* DebugSpanContour(class SkOpSpanBase*, int id); 232 static class SkOpContour* DebugSpanContour(class SkOpSpanBase*, int id);
228 static const class SkOpPtT* DebugSpanPtT(const class SkOpSpanBase*, int id); 233 static const class SkOpPtT* DebugSpanPtT(const class SkOpSpanBase*, int id);
229 static const class SkOpSegment* DebugSpanSegment(const class SkOpSpanBase*, int id); 234 static const class SkOpSegment* DebugSpanSegment(const class SkOpSpanBase*, int id);
230 static const class SkOpSpanBase* DebugSpanSpan(const class SkOpSpanBase*, in t id); 235 static const class SkOpSpanBase* DebugSpanSpan(const class SkOpSpanBase*, in t id);
231 }; 236 };
232 237
233 struct SkDQuad; 238 struct SkDQuad;
234 239
235 // generates tools/path_sorter.htm and path_visualizer.htm compatible data 240 // generates tools/path_sorter.htm and path_visualizer.htm compatible data
236 void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo); 241 void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo);
237 void DumpT(const SkDQuad& quad, double t); 242 void DumpT(const SkDQuad& quad, double t);
238 243
239 #endif 244 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698