| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 | 7 |
| 8 #include "PathOpsTSectDebug.h" | 8 #include "PathOpsTSectDebug.h" |
| 9 #include "SkOpCoincidence.h" | 9 #include "SkOpCoincidence.h" |
| 10 #include "SkOpContour.h" | 10 #include "SkOpContour.h" |
| 11 #include "SkIntersectionHelper.h" | 11 #include "SkIntersectionHelper.h" |
| 12 #include "SkMutex.h" | 12 #include "SkMutex.h" |
| 13 #include "SkOpSegment.h" | 13 #include "SkOpSegment.h" |
| 14 #include "SkString.h" | 14 #include "SkString.h" |
| 15 | 15 |
| 16 extern bool FLAGS_runFail; |
| 17 |
| 16 inline void DebugDumpDouble(double x) { | 18 inline void DebugDumpDouble(double x) { |
| 17 if (x == floor(x)) { | 19 if (x == floor(x)) { |
| 18 SkDebugf("%.0f", x); | 20 SkDebugf("%.0f", x); |
| 19 } else { | 21 } else { |
| 20 SkDebugf("%1.19g", x); | 22 SkDebugf("%1.19g", x); |
| 21 } | 23 } |
| 22 } | 24 } |
| 23 | 25 |
| 24 inline void DebugDumpFloat(float x) { | 26 inline void DebugDumpFloat(float x) { |
| 25 if (x == floorf(x)) { | 27 if (x == floorf(x)) { |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 233 } |
| 232 | 234 |
| 233 const SkOpSegment* SkPathOpsDebug::DebugContourSegment(SkOpContour* contour, int
id) { | 235 const SkOpSegment* SkPathOpsDebug::DebugContourSegment(SkOpContour* contour, int
id) { |
| 234 return contour->debugSegment(id); | 236 return contour->debugSegment(id); |
| 235 } | 237 } |
| 236 | 238 |
| 237 const SkOpSpanBase* SkPathOpsDebug::DebugContourSpan(SkOpContour* contour, int i
d) { | 239 const SkOpSpanBase* SkPathOpsDebug::DebugContourSpan(SkOpContour* contour, int i
d) { |
| 238 return contour->debugSpan(id); | 240 return contour->debugSpan(id); |
| 239 } | 241 } |
| 240 | 242 |
| 243 const SkOpAngle* SkPathOpsDebug::DebugCoincidenceAngle(SkOpCoincidence* coin, in
t id) { |
| 244 return coin->debugAngle(id); |
| 245 } |
| 246 |
| 247 SkOpContour* SkPathOpsDebug::DebugCoincidenceContour(SkOpCoincidence* coin, int
id) { |
| 248 return coin->debugContour(id); |
| 249 } |
| 250 |
| 251 const SkOpPtT* SkPathOpsDebug::DebugCoincidencePtT(SkOpCoincidence* coin, int id
) { |
| 252 return coin->debugPtT(id); |
| 253 } |
| 254 |
| 255 const SkOpSegment* SkPathOpsDebug::DebugCoincidenceSegment(SkOpCoincidence* coin
, int id) { |
| 256 return coin->debugSegment(id); |
| 257 } |
| 258 |
| 259 const SkOpSpanBase* SkPathOpsDebug::DebugCoincidenceSpan(SkOpCoincidence* coin,
int id) { |
| 260 return coin->debugSpan(id); |
| 261 } |
| 262 |
| 241 const SkOpAngle* SkPathOpsDebug::DebugPtTAngle(const SkOpPtT* ptT, int id) { | 263 const SkOpAngle* SkPathOpsDebug::DebugPtTAngle(const SkOpPtT* ptT, int id) { |
| 242 return ptT->debugAngle(id); | 264 return ptT->debugAngle(id); |
| 243 } | 265 } |
| 244 | 266 |
| 245 SkOpContour* SkPathOpsDebug::DebugPtTContour(SkOpPtT* ptT, int id) { | 267 SkOpContour* SkPathOpsDebug::DebugPtTContour(SkOpPtT* ptT, int id) { |
| 246 return ptT->debugContour(id); | 268 return ptT->debugContour(id); |
| 247 } | 269 } |
| 248 | 270 |
| 249 const SkOpPtT* SkPathOpsDebug::DebugPtTPtT(const SkOpPtT* ptT, int id) { | 271 const SkOpPtT* SkPathOpsDebug::DebugPtTPtT(const SkOpPtT* ptT, int id) { |
| 250 return ptT->debugPtT(id); | 272 return ptT->debugPtT(id); |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 } | 1134 } |
| 1113 SkDebugf("\n"); | 1135 SkDebugf("\n"); |
| 1114 } | 1136 } |
| 1115 | 1137 |
| 1116 void SkOpCoincidence::dump() const { | 1138 void SkOpCoincidence::dump() const { |
| 1117 SkCoincidentSpans* span = fHead; | 1139 SkCoincidentSpans* span = fHead; |
| 1118 while (span) { | 1140 while (span) { |
| 1119 span->dump(); | 1141 span->dump(); |
| 1120 span = span->fNext; | 1142 span = span->fNext; |
| 1121 } | 1143 } |
| 1144 if (!fTop) { |
| 1145 return; |
| 1146 } |
| 1147 SkDebugf("top:\n"); |
| 1148 span = fTop; |
| 1149 while (span) { |
| 1150 span->dump(); |
| 1151 span = span->fNext; |
| 1152 } |
| 1122 } | 1153 } |
| 1123 | 1154 |
| 1124 void SkOpContour::dump() const { | 1155 void SkOpContour::dump() const { |
| 1125 SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOpe
rand, fXor); | 1156 SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOpe
rand, fXor); |
| 1126 if (!fCount) { | 1157 if (!fCount) { |
| 1127 return; | 1158 return; |
| 1128 } | 1159 } |
| 1129 const SkOpSegment* segment = &fHead; | 1160 const SkOpSegment* segment = &fHead; |
| 1130 SkDEBUGCODE(fDebugIndent = 0); | 1161 SkDEBUGCODE(fDebugIndent = 0); |
| 1131 this->indentDump(); | 1162 this->indentDump(); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 segment = segment->next(); | 1353 segment = segment->next(); |
| 1323 } | 1354 } |
| 1324 } while ((contour = contour->next())); | 1355 } while ((contour = contour->next())); |
| 1325 return NULL; | 1356 return NULL; |
| 1326 } | 1357 } |
| 1327 #endif | 1358 #endif |
| 1328 | 1359 |
| 1329 #if DEBUG_T_SECT_DUMP > 1 | 1360 #if DEBUG_T_SECT_DUMP > 1 |
| 1330 int gDumpTSectNum; | 1361 int gDumpTSectNum; |
| 1331 #endif | 1362 #endif |
| OLD | NEW |