| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #if FORCE_RELEASE | 42 #if FORCE_RELEASE |
| 43 | 43 |
| 44 #define DEBUG_ACTIVE_OP 0 | 44 #define DEBUG_ACTIVE_OP 0 |
| 45 #define DEBUG_ACTIVE_SPANS 0 | 45 #define DEBUG_ACTIVE_SPANS 0 |
| 46 #define DEBUG_ADD_INTERSECTING_TS 0 | 46 #define DEBUG_ADD_INTERSECTING_TS 0 |
| 47 #define DEBUG_ADD_T 0 | 47 #define DEBUG_ADD_T 0 |
| 48 #define DEBUG_ALIGNMENT 0 | 48 #define DEBUG_ALIGNMENT 0 |
| 49 #define DEBUG_ANGLE 0 | 49 #define DEBUG_ANGLE 0 |
| 50 #define DEBUG_ASSEMBLE 0 | 50 #define DEBUG_ASSEMBLE 0 |
| 51 #define DEBUG_COINCIDENCE 0 | 51 #define DEBUG_COINCIDENCE 0 |
| 52 #define DEBUG_COINCIDENCE_ORDER 0 |
| 52 #define DEBUG_COINCIDENCE_VERBOSE 0 | 53 #define DEBUG_COINCIDENCE_VERBOSE 0 |
| 53 #define DEBUG_CUBIC_BINARY_SEARCH 0 | 54 #define DEBUG_CUBIC_BINARY_SEARCH 0 |
| 54 #define DEBUG_CUBIC_SPLIT 0 | 55 #define DEBUG_CUBIC_SPLIT 0 |
| 55 #define DEBUG_DUMP_SEGMENTS 0 | 56 #define DEBUG_DUMP_SEGMENTS 0 |
| 56 #define DEBUG_FLOW 0 | 57 #define DEBUG_FLOW 0 |
| 57 #define DEBUG_LIMIT_WIND_SUM 0 | 58 #define DEBUG_LIMIT_WIND_SUM 0 |
| 58 #define DEBUG_MARK_DONE 0 | 59 #define DEBUG_MARK_DONE 0 |
| 59 #define DEBUG_PATH_CONSTRUCTION 0 | 60 #define DEBUG_PATH_CONSTRUCTION 0 |
| 60 #define DEBUG_PERP 0 | 61 #define DEBUG_PERP 0 |
| 61 #define DEBUG_SHOW_TEST_NAME 0 | 62 #define DEBUG_SHOW_TEST_NAME 0 |
| 62 #define DEBUG_SORT 0 | 63 #define DEBUG_SORT 0 |
| 63 #define DEBUG_T_SECT 0 | 64 #define DEBUG_T_SECT 0 |
| 64 #define DEBUG_T_SECT_DUMP 0 | 65 #define DEBUG_T_SECT_DUMP 0 |
| 65 #define DEBUG_T_SECT_LOOP_COUNT 0 | 66 #define DEBUG_T_SECT_LOOP_COUNT 0 |
| 66 #define DEBUG_VALIDATE 0 | 67 #define DEBUG_VALIDATE 0 |
| 67 #define DEBUG_WINDING 0 | 68 #define DEBUG_WINDING 0 |
| 68 #define DEBUG_WINDING_AT_T 0 | 69 #define DEBUG_WINDING_AT_T 0 |
| 69 | 70 |
| 70 | |
| 71 #else | 71 #else |
| 72 | 72 |
| 73 #define DEBUG_ACTIVE_OP 1 | 73 #define DEBUG_ACTIVE_OP 1 |
| 74 #define DEBUG_ACTIVE_SPANS 1 | 74 #define DEBUG_ACTIVE_SPANS 1 |
| 75 #define DEBUG_ADD_INTERSECTING_TS 1 | 75 #define DEBUG_ADD_INTERSECTING_TS 1 |
| 76 #define DEBUG_ADD_T 1 | 76 #define DEBUG_ADD_T 1 |
| 77 #define DEBUG_ALIGNMENT 0 | 77 #define DEBUG_ALIGNMENT 0 |
| 78 #define DEBUG_ANGLE 1 | 78 #define DEBUG_ANGLE 1 |
| 79 #define DEBUG_ASSEMBLE 1 | 79 #define DEBUG_ASSEMBLE 1 |
| 80 #define DEBUG_COINCIDENCE 01 | 80 #define DEBUG_COINCIDENCE 01 |
| 81 #define DEBUG_COINCIDENCE_ORDER 0 |
| 81 #define DEBUG_COINCIDENCE_VERBOSE 01 | 82 #define DEBUG_COINCIDENCE_VERBOSE 01 |
| 82 #define DEBUG_CUBIC_BINARY_SEARCH 0 | 83 #define DEBUG_CUBIC_BINARY_SEARCH 0 |
| 83 #define DEBUG_CUBIC_SPLIT 1 | 84 #define DEBUG_CUBIC_SPLIT 1 |
| 84 #define DEBUG_DUMP_SEGMENTS 1 | 85 #define DEBUG_DUMP_SEGMENTS 1 |
| 85 #define DEBUG_FLOW 1 | 86 #define DEBUG_FLOW 1 |
| 86 #define DEBUG_LIMIT_WIND_SUM 15 | 87 #define DEBUG_LIMIT_WIND_SUM 15 |
| 87 #define DEBUG_MARK_DONE 1 | 88 #define DEBUG_MARK_DONE 1 |
| 88 #define DEBUG_PATH_CONSTRUCTION 1 | 89 #define DEBUG_PATH_CONSTRUCTION 1 |
| 89 #define DEBUG_PERP 1 | 90 #define DEBUG_PERP 1 |
| 90 #define DEBUG_SHOW_TEST_NAME 1 | 91 #define DEBUG_SHOW_TEST_NAME 1 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 #define PT_DEBUG_DATA(i, n) i.pt(n).asSkPoint().fX, i.pt(n).asSkPoint().fY | 149 #define PT_DEBUG_DATA(i, n) i.pt(n).asSkPoint().fX, i.pt(n).asSkPoint().fY |
| 149 | 150 |
| 150 #ifndef DEBUG_TEST | 151 #ifndef DEBUG_TEST |
| 151 #define DEBUG_TEST 0 | 152 #define DEBUG_TEST 0 |
| 152 #endif | 153 #endif |
| 153 | 154 |
| 154 #if DEBUG_SHOW_TEST_NAME | 155 #if DEBUG_SHOW_TEST_NAME |
| 155 #include "SkTLS.h" | 156 #include "SkTLS.h" |
| 156 #endif | 157 #endif |
| 157 | 158 |
| 159 #define FAIL_IF(cond) do { bool fail = (cond); SkOPASSERT(!fail); if (fail) retu
rn false; } \ |
| 160 while (false) |
| 161 |
| 162 #define RETURN_FALSE_IF(abort, cond) \ |
| 163 do { bool fail = (cond); SkOPASSERT(!(abort) || !fail); if (fail) return
false; } \ |
| 164 while (false) |
| 165 |
| 158 class SkPathOpsDebug { | 166 class SkPathOpsDebug { |
| 159 public: | 167 public: |
| 160 static const char* kLVerbStr[]; | 168 static const char* kLVerbStr[]; |
| 161 struct GlitchLog; | 169 struct GlitchLog; |
| 162 | 170 |
| 163 #if defined(SK_DEBUG) || !FORCE_RELEASE | 171 #if defined(SK_DEBUG) || !FORCE_RELEASE |
| 164 static int gContourID; | 172 static int gContourID; |
| 165 static int gSegmentID; | 173 static int gSegmentID; |
| 166 #endif | 174 #endif |
| 167 | 175 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 static const class SkOpSpanBase* DebugSpanSpan(const class SkOpSpanBase*, in
t id); | 241 static const class SkOpSpanBase* DebugSpanSpan(const class SkOpSpanBase*, in
t id); |
| 234 }; | 242 }; |
| 235 | 243 |
| 236 struct SkDQuad; | 244 struct SkDQuad; |
| 237 | 245 |
| 238 // generates tools/path_sorter.htm and path_visualizer.htm compatible data | 246 // generates tools/path_sorter.htm and path_visualizer.htm compatible data |
| 239 void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo); | 247 void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo); |
| 240 void DumpT(const SkDQuad& quad, double t); | 248 void DumpT(const SkDQuad& quad, double t); |
| 241 | 249 |
| 242 #endif | 250 #endif |
| OLD | NEW |