| OLD | NEW |
| 1 #include "SkOpContour.h" | 1 #include "SkOpContour.h" |
| 2 #include "SkIntersectionHelper.h" | 2 #include "SkIntersectionHelper.h" |
| 3 #include "SkOpSegment.h" | 3 #include "SkOpSegment.h" |
| 4 | 4 |
| 5 inline void DebugDumpDouble(double x) { | 5 inline void DebugDumpDouble(double x) { |
| 6 if (x == floor(x)) { | 6 if (x == floor(x)) { |
| 7 SkDebugf("%.0f", x); | 7 SkDebugf("%.0f", x); |
| 8 } else { | 8 } else { |
| 9 SkDebugf("%1.19g", x); | 9 SkDebugf("%1.19g", x); |
| 10 } | 10 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 void SkPathOpsDebug::WindingPrintf(int wind) { | 27 void SkPathOpsDebug::WindingPrintf(int wind) { |
| 28 if (wind == SK_MinS32) { | 28 if (wind == SK_MinS32) { |
| 29 SkDebugf("?"); | 29 SkDebugf("?"); |
| 30 } else { | 30 } else { |
| 31 SkDebugf("%d", wind); | 31 SkDebugf("%d", wind); |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 void SkOpAngle::dump() const { | 36 void SkOpAngle::dump() const { |
| 37 #if DEBUG_SORT | 37 dumpOne(true); |
| 38 debugOne(false); | |
| 39 #endif | |
| 40 SkDebugf("\n"); | 38 SkDebugf("\n"); |
| 41 } | 39 } |
| 42 | 40 |
| 43 void SkOpAngle::dumpFromTo(const SkOpSegment* segment, int from, int to) const { | 41 void SkOpAngle::dumpOne(bool functionHeader) const { |
| 44 #if DEBUG_SORT && DEBUG_ANGLE | 42 // fSegment->debugValidate(); |
| 43 const SkOpSpan& mSpan = fSegment->span(SkMin32(fStart, fEnd)); |
| 44 if (functionHeader) { |
| 45 SkDebugf("%s ", __FUNCTION__); |
| 46 } |
| 47 SkDebugf("[%d", fSegment->debugID()); |
| 48 SkDebugf("/%d", debugID()); |
| 49 SkDebugf("] next="); |
| 50 if (fNext) { |
| 51 SkDebugf("%d", fNext->fSegment->debugID()); |
| 52 SkDebugf("/%d", fNext->debugID()); |
| 53 } else { |
| 54 SkDebugf("?"); |
| 55 } |
| 56 SkDebugf(" sect=%d/%d ", fSectorStart, fSectorEnd); |
| 57 SkDebugf(" s=%1.9g [%d] e=%1.9g [%d]", fSegment->span(fStart).fT, fStart, |
| 58 fSegment->span(fEnd).fT, fEnd); |
| 59 SkDebugf(" sgn=%d windVal=%d", sign(), mSpan.fWindValue); |
| 60 |
| 61 SkDebugf(" windSum="); |
| 62 SkPathOpsDebug::WindingPrintf(mSpan.fWindSum); |
| 63 if (mSpan.fOppValue != 0 || mSpan.fOppSum != SK_MinS32) { |
| 64 SkDebugf(" oppVal=%d", mSpan.fOppValue); |
| 65 SkDebugf(" oppSum="); |
| 66 SkPathOpsDebug::WindingPrintf(mSpan.fOppSum); |
| 67 } |
| 68 if (mSpan.fDone) { |
| 69 SkDebugf(" done"); |
| 70 } |
| 71 if (unorderable()) { |
| 72 SkDebugf(" unorderable"); |
| 73 } |
| 74 if (small()) { |
| 75 SkDebugf(" small"); |
| 76 } |
| 77 if (mSpan.fTiny) { |
| 78 SkDebugf(" tiny"); |
| 79 } |
| 80 if (fSegment->operand()) { |
| 81 SkDebugf(" operand"); |
| 82 } |
| 83 if (fStop) { |
| 84 SkDebugf(" stop"); |
| 85 } |
| 86 } |
| 87 |
| 88 void SkOpAngle::dumpTo(const SkOpSegment* segment, const SkOpAngle* to) const { |
| 45 const SkOpAngle* first = this; | 89 const SkOpAngle* first = this; |
| 46 const SkOpAngle* next = this; | 90 const SkOpAngle* next = this; |
| 47 const char* indent = ""; | 91 const char* indent = ""; |
| 48 do { | 92 do { |
| 49 SkDebugf("%s", indent); | 93 SkDebugf("%s", indent); |
| 50 next->debugOne(false); | 94 next->dumpOne(false); |
| 51 if (segment == next->fSegment) { | 95 if (segment == next->fSegment) { |
| 52 if (fNext && from == fNext->debugID()) { | 96 if (this == fNext) { |
| 53 SkDebugf(" << from"); | 97 SkDebugf(" << from"); |
| 54 } | 98 } |
| 55 if (fNext && to == fNext->debugID()) { | 99 if (to == fNext) { |
| 56 SkDebugf(" << to"); | 100 SkDebugf(" << to"); |
| 57 } | 101 } |
| 58 } | 102 } |
| 59 SkDebugf("\n"); | 103 SkDebugf("\n"); |
| 60 indent = " "; | 104 indent = " "; |
| 61 next = next->fNext; | 105 next = next->fNext; |
| 62 } while (next && next != first); | 106 } while (next && next != first); |
| 63 #endif | |
| 64 } | 107 } |
| 65 | 108 |
| 66 void SkOpAngle::dumpLoop() const { | 109 void SkOpAngle::dumpLoop() const { |
| 67 const SkOpAngle* first = this; | 110 const SkOpAngle* first = this; |
| 68 const SkOpAngle* next = this; | 111 const SkOpAngle* next = this; |
| 69 do { | 112 do { |
| 70 next->dump(); | 113 next->dump(); |
| 71 next = next->fNext; | 114 next = next->fNext; |
| 72 } while (next && next != first); | 115 } while (next && next != first); |
| 73 } | 116 } |
| 74 | 117 |
| 75 void SkOpAngle::dumpPartials() const { | 118 void SkOpAngle::dumpPartials() const { |
| 76 const SkOpAngle* first = this; | 119 const SkOpAngle* first = this; |
| 77 const SkOpAngle* next = this; | 120 const SkOpAngle* next = this; |
| 78 do { | 121 do { |
| 79 next->fCurvePart.dumpNumber(); | 122 next->fCurvePart.dumpNumber(); |
| 80 next = next->fNext; | 123 next = next->fNext; |
| 81 } while (next && next != first); | 124 } while (next && next != first); |
| 82 } | 125 } |
| 83 | 126 |
| 127 void SkOpAngleSet::dump() const { |
| 128 // FIXME: unimplemented |
| 129 /* This requires access to the internal SkChunkAlloc data |
| 130 Defer implementing this until it is needed for debugging |
| 131 */ |
| 132 SkASSERT(0); |
| 133 } |
| 134 |
| 84 void SkOpContour::dump() const { | 135 void SkOpContour::dump() const { |
| 85 int segmentCount = fSegments.count(); | 136 int segmentCount = fSegments.count(); |
| 86 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); | 137 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); |
| 87 for (int test = 0; test < segmentCount; ++test) { | 138 for (int test = 0; test < segmentCount; ++test) { |
| 88 SkDebugf(" [%d] ((SkOpSegment*) 0x%p) [%d]\n", test, &fSegments[test], | 139 SkDebugf(" [%d] ((SkOpSegment*) 0x%p) [%d]\n", test, &fSegments[test], |
| 89 fSegments[test].debugID()); | 140 fSegments[test].debugID()); |
| 90 } | 141 } |
| 91 } | 142 } |
| 92 | 143 |
| 93 void SkOpContour::dumpAngles() const { | 144 void SkOpContour::dumpAngles() const { |
| 94 int segmentCount = fSegments.count(); | 145 int segmentCount = fSegments.count(); |
| 95 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); | 146 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); |
| 96 for (int test = 0; test < segmentCount; ++test) { | 147 for (int test = 0; test < segmentCount; ++test) { |
| 97 SkDebugf(" [%d] ", test); | 148 SkDebugf(" [%d] ", test); |
| 98 fSegments[test].dumpAngles(); | 149 fSegments[test].dumpAngles(); |
| 99 } | 150 } |
| 100 } | 151 } |
| 101 | 152 |
| 153 void SkOpContour::dumpCoincidence(const SkCoincidence& coin) const { |
| 154 int thisIndex = coin.fSegments[0]; |
| 155 const SkOpSegment& s1 = fSegments[thisIndex]; |
| 156 int otherIndex = coin.fSegments[1]; |
| 157 const SkOpSegment& s2 = coin.fOther->fSegments[otherIndex]; |
| 158 SkDebugf("((SkOpSegment*) 0x%p) [%d] ((SkOpSegment*) 0x%p) [%d]\n", &s1, s1
.debugID(), |
| 159 &s2, s2.debugID()); |
| 160 for (int index = 0; index < 2; ++index) { |
| 161 SkDebugf(" {%1.9gf, %1.9gf}", coin.fPts[0][index].fX, coin.fPts[0][in
dex].fY); |
| 162 if (coin.fNearly[index]) { |
| 163 SkDebugf(" {%1.9gf, %1.9gf}", coin.fPts[1][index].fX, coin.fPts[1
][index].fY); |
| 164 } |
| 165 SkDebugf(" seg1t=%1.9g seg2t=%1.9g\n", coin.fTs[0][index], coin.fTs[1][
index]); |
| 166 } |
| 167 } |
| 168 |
| 169 void SkOpContour::dumpCoincidences() const { |
| 170 int count = fCoincidences.count(); |
| 171 if (count > 0) { |
| 172 SkDebugf("fCoincidences count=%d\n", count); |
| 173 for (int test = 0; test < count; ++test) { |
| 174 dumpCoincidence(fCoincidences[test]); |
| 175 } |
| 176 } |
| 177 count = fPartialCoincidences.count(); |
| 178 if (count == 0) { |
| 179 return; |
| 180 } |
| 181 SkDebugf("fPartialCoincidences count=%d\n", count); |
| 182 for (int test = 0; test < count; ++test) { |
| 183 dumpCoincidence(fPartialCoincidences[test]); |
| 184 } |
| 185 } |
| 186 |
| 187 void SkOpContour::dumpPt(int index) const { |
| 188 int segmentCount = fSegments.count(); |
| 189 for (int test = 0; test < segmentCount; ++test) { |
| 190 const SkOpSegment& segment = fSegments[test]; |
| 191 if (segment.debugID() == index) { |
| 192 fSegments[test].dumpPts(); |
| 193 } |
| 194 } |
| 195 } |
| 196 |
| 102 void SkOpContour::dumpPts() const { | 197 void SkOpContour::dumpPts() const { |
| 103 int segmentCount = fSegments.count(); | 198 int segmentCount = fSegments.count(); |
| 104 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); | 199 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); |
| 105 for (int test = 0; test < segmentCount; ++test) { | 200 for (int test = 0; test < segmentCount; ++test) { |
| 106 SkDebugf(" [%d] ", test); | 201 SkDebugf(" [%d] ", test); |
| 107 fSegments[test].dumpPts(); | 202 fSegments[test].dumpPts(); |
| 108 } | 203 } |
| 109 } | 204 } |
| 110 | 205 |
| 206 void SkOpContour::dumpSpan(int index) const { |
| 207 int segmentCount = fSegments.count(); |
| 208 for (int test = 0; test < segmentCount; ++test) { |
| 209 const SkOpSegment& segment = fSegments[test]; |
| 210 if (segment.debugID() == index) { |
| 211 fSegments[test].dumpSpans(); |
| 212 } |
| 213 } |
| 214 } |
| 215 |
| 111 void SkOpContour::dumpSpans() const { | 216 void SkOpContour::dumpSpans() const { |
| 112 int segmentCount = fSegments.count(); | 217 int segmentCount = fSegments.count(); |
| 113 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); | 218 SkDebugf("((SkOpContour*) 0x%p) [%d]\n", this, debugID()); |
| 114 for (int test = 0; test < segmentCount; ++test) { | 219 for (int test = 0; test < segmentCount; ++test) { |
| 115 SkDebugf(" [%d] ", test); | 220 SkDebugf(" [%d] ", test); |
| 116 fSegments[test].dumpSpans(); | 221 fSegments[test].dumpSpans(); |
| 117 } | 222 } |
| 118 } | 223 } |
| 119 | 224 |
| 120 void SkDCubic::dump() const { | 225 void SkDCubic::dump() const { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 SkDPoint::Dump(pts()[3]); | 306 SkDPoint::Dump(pts()[3]); |
| 202 } | 307 } |
| 203 } | 308 } |
| 204 | 309 |
| 205 const SkTDArray<SkOpSpan>& SkOpSegment::debugSpans() const { | 310 const SkTDArray<SkOpSpan>& SkOpSegment::debugSpans() const { |
| 206 return fTs; | 311 return fTs; |
| 207 } | 312 } |
| 208 | 313 |
| 209 void SkOpSegment::dumpAngles() const { | 314 void SkOpSegment::dumpAngles() const { |
| 210 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID()); | 315 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID()); |
| 211 int fromIndex = -1, toIndex = -1; | 316 const SkOpAngle* fromAngle = NULL; |
| 317 const SkOpAngle* toAngle = NULL; |
| 212 for (int index = 0; index < count(); ++index) { | 318 for (int index = 0; index < count(); ++index) { |
| 213 int fIndex = fTs[index].fFromAngleIndex; | 319 const SkOpAngle* fAngle = fTs[index].fFromAngle; |
| 214 int tIndex = fTs[index].fToAngleIndex; | 320 const SkOpAngle* tAngle = fTs[index].fToAngle; |
| 215 if (fromIndex == fIndex && tIndex == toIndex) { | 321 if (fromAngle == fAngle && toAngle == tAngle) { |
| 216 continue; | 322 continue; |
| 217 } | 323 } |
| 218 if (fIndex >= 0) { | 324 if (fAngle) { |
| 219 SkDebugf(" [%d] from=%d ", index, fIndex); | 325 SkDebugf(" [%d] from=%d ", index, fAngle->debugID()); |
| 220 const SkOpAngle& angle = this->angle(fIndex); | 326 fAngle->dumpTo(this, tAngle); |
| 221 angle.dumpFromTo(this, fIndex, tIndex); | |
| 222 } | 327 } |
| 223 if (tIndex >= 0) { | 328 if (tAngle) { |
| 224 SkDebugf(" [%d] to=%d ", index, tIndex); | 329 SkDebugf(" [%d] to=%d ", index, tAngle->debugID()); |
| 225 const SkOpAngle& angle = this->angle(tIndex); | 330 tAngle->dumpTo(this, fAngle); |
| 226 angle.dumpFromTo(this, fIndex, tIndex); | |
| 227 } | 331 } |
| 228 fromIndex = fIndex; | 332 fromAngle = fAngle; |
| 229 toIndex = tIndex; | 333 toAngle = tAngle; |
| 230 } | 334 } |
| 231 } | 335 } |
| 232 | 336 |
| 233 void SkOpSegment::dumpContour(int firstID, int lastID) const { | 337 void SkOpSegment::dumpContour(int firstID, int lastID) const { |
| 234 if (debugID() < 0) { | 338 if (debugID() < 0) { |
| 235 return; | 339 return; |
| 236 } | 340 } |
| 237 const SkOpSegment* test = this - (debugID() - 1); | 341 const SkOpSegment* test = this - (debugID() - 1); |
| 238 test += (firstID - 1); | 342 test += (firstID - 1); |
| 239 const SkOpSegment* last = test + (lastID - firstID); | 343 const SkOpSegment* last = test + (lastID - firstID); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 void SkOpSegment::dumpSpans() const { | 376 void SkOpSegment::dumpSpans() const { |
| 273 int count = this->count(); | 377 int count = this->count(); |
| 274 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID()); | 378 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID()); |
| 275 for (int index = 0; index < count; ++index) { | 379 for (int index = 0; index < count; ++index) { |
| 276 const SkOpSpan& span = this->span(index); | 380 const SkOpSpan& span = this->span(index); |
| 277 SkDebugf(" [%d] ", index); | 381 SkDebugf(" [%d] ", index); |
| 278 span.dumpOne(); | 382 span.dumpOne(); |
| 279 } | 383 } |
| 280 } | 384 } |
| 281 | 385 |
| 282 void SkPathOpsDebug::DumpAngles(const SkTArray<SkOpAngle, true>& angles) { | 386 void SkPathOpsDebug::DumpCoincidence(const SkTArray<SkOpContour, true>& contours
) { |
| 283 int count = angles.count(); | 387 int count = contours.count(); |
| 284 for (int index = 0; index < count; ++index) { | 388 for (int index = 0; index < count; ++index) { |
| 285 angles[index].dump(); | 389 contours[index].dumpCoincidences(); |
| 286 } | 390 } |
| 287 } | 391 } |
| 288 | 392 |
| 289 void SkPathOpsDebug::DumpAngles(const SkTArray<SkOpAngle* , true>& angles) { | 393 void SkPathOpsDebug::DumpCoincidence(const SkTArray<SkOpContour* , true>& contou
rs) { |
| 290 int count = angles.count(); | 394 int count = contours.count(); |
| 291 for (int index = 0; index < count; ++index) { | 395 for (int index = 0; index < count; ++index) { |
| 292 angles[index]->dump(); | 396 contours[index]->dumpCoincidences(); |
| 293 } | 397 } |
| 294 } | 398 } |
| 295 | 399 |
| 296 void SkPathOpsDebug::DumpContours(const SkTArray<SkOpContour, true>& contours) { | 400 void SkPathOpsDebug::DumpContours(const SkTArray<SkOpContour, true>& contours) { |
| 297 int count = contours.count(); | 401 int count = contours.count(); |
| 298 for (int index = 0; index < count; ++index) { | 402 for (int index = 0; index < count; ++index) { |
| 299 contours[index].dump(); | 403 contours[index].dump(); |
| 300 } | 404 } |
| 301 } | 405 } |
| 302 | 406 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 328 } | 432 } |
| 329 } | 433 } |
| 330 | 434 |
| 331 void SkPathOpsDebug::DumpContourPts(const SkTArray<SkOpContour* , true>& contour
s) { | 435 void SkPathOpsDebug::DumpContourPts(const SkTArray<SkOpContour* , true>& contour
s) { |
| 332 int count = contours.count(); | 436 int count = contours.count(); |
| 333 for (int index = 0; index < count; ++index) { | 437 for (int index = 0; index < count; ++index) { |
| 334 contours[index]->dumpPts(); | 438 contours[index]->dumpPts(); |
| 335 } | 439 } |
| 336 } | 440 } |
| 337 | 441 |
| 442 void SkPathOpsDebug::DumpContourPt(const SkTArray<SkOpContour, true>& contours,
int segmentID) { |
| 443 int count = contours.count(); |
| 444 for (int index = 0; index < count; ++index) { |
| 445 contours[index].dumpPt(segmentID); |
| 446 } |
| 447 } |
| 448 |
| 449 void SkPathOpsDebug::DumpContourPt(const SkTArray<SkOpContour* , true>& contours
, int segmentID) { |
| 450 int count = contours.count(); |
| 451 for (int index = 0; index < count; ++index) { |
| 452 contours[index]->dumpPt(segmentID); |
| 453 } |
| 454 } |
| 455 |
| 338 void SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour, true>& contour
s) { | 456 void SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour, true>& contour
s) { |
| 339 int count = contours.count(); | 457 int count = contours.count(); |
| 340 for (int index = 0; index < count; ++index) { | 458 for (int index = 0; index < count; ++index) { |
| 341 contours[index].dumpSpans(); | 459 contours[index].dumpSpans(); |
| 342 } | 460 } |
| 343 } | 461 } |
| 344 | 462 |
| 345 void SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour* , true>& conto
urs) { | 463 void SkPathOpsDebug::DumpContourSpans(const SkTArray<SkOpContour* , true>& conto
urs) { |
| 346 int count = contours.count(); | 464 int count = contours.count(); |
| 347 for (int index = 0; index < count; ++index) { | 465 for (int index = 0; index < count; ++index) { |
| 348 contours[index]->dumpSpans(); | 466 contours[index]->dumpSpans(); |
| 349 } | 467 } |
| 350 } | 468 } |
| 351 | 469 |
| 470 void SkPathOpsDebug::DumpContourSpan(const SkTArray<SkOpContour, true>& contours
, int segmentID) { |
| 471 int count = contours.count(); |
| 472 for (int index = 0; index < count; ++index) { |
| 473 contours[index].dumpSpan(segmentID); |
| 474 } |
| 475 } |
| 476 |
| 477 void SkPathOpsDebug::DumpContourSpan(const SkTArray<SkOpContour* , true>& contou
rs, int segmentID) { |
| 478 int count = contours.count(); |
| 479 for (int index = 0; index < count; ++index) { |
| 480 contours[index]->dumpSpan(segmentID); |
| 481 } |
| 482 } |
| 483 |
| 352 void SkPathOpsDebug::DumpSpans(const SkTDArray<SkOpSpan *>& spans) { | 484 void SkPathOpsDebug::DumpSpans(const SkTDArray<SkOpSpan *>& spans) { |
| 353 int count = spans.count(); | 485 int count = spans.count(); |
| 354 for (int index = 0; index < count; ++index) { | 486 for (int index = 0; index < count; ++index) { |
| 355 const SkOpSpan* span = spans[index]; | 487 const SkOpSpan* span = spans[index]; |
| 356 const SkOpSpan& oSpan = span->fOther->span(span->fOtherIndex); | 488 const SkOpSpan& oSpan = span->fOther->span(span->fOtherIndex); |
| 357 const SkOpSegment* segment = oSpan.fOther; | 489 const SkOpSegment* segment = oSpan.fOther; |
| 358 SkDebugf("((SkOpSegment*) 0x%p) [%d] ", segment, segment->debugID()); | 490 SkDebugf("((SkOpSegment*) 0x%p) [%d] ", segment, segment->debugID()); |
| 359 SkDebugf("spanIndex:%d ", oSpan.fOtherIndex); | 491 SkDebugf("spanIndex:%d ", oSpan.fOtherIndex); |
| 360 span->dumpOne(); | 492 span->dumpOne(); |
| 361 } | 493 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 DebugDumpDouble(fT); | 525 DebugDumpDouble(fT); |
| 394 SkDebugf(" pt="); | 526 SkDebugf(" pt="); |
| 395 SkDPoint::Dump(fPt); | 527 SkDPoint::Dump(fPt); |
| 396 if (fOther) { | 528 if (fOther) { |
| 397 SkDebugf(" other.fID=%d", fOther->debugID()); | 529 SkDebugf(" other.fID=%d", fOther->debugID()); |
| 398 SkDebugf(" [%d] otherT=", fOtherIndex); | 530 SkDebugf(" [%d] otherT=", fOtherIndex); |
| 399 DebugDumpDouble(fOtherT); | 531 DebugDumpDouble(fOtherT); |
| 400 } else { | 532 } else { |
| 401 SkDebugf(" other.fID=? [?] otherT=?"); | 533 SkDebugf(" other.fID=? [?] otherT=?"); |
| 402 } | 534 } |
| 403 #if DEBUG_WINDING | 535 if (fWindSum != SK_MinS32) { |
| 404 SkDebugf(" windSum="); | 536 SkDebugf(" windSum=%d", fWindSum); |
| 405 SkPathOpsDebug::WindingPrintf(fWindSum); | 537 } |
| 406 #endif | 538 if (fOppSum != SK_MinS32 && (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue
!= 0)) { |
| 407 if (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0) { | 539 SkDebugf(" oppSum=%d", fOppSum); |
| 408 #if DEBUG_WINDING | |
| 409 SkDebugf(" oppSum="); | |
| 410 SkPathOpsDebug::WindingPrintf(fOppSum); | |
| 411 #endif | |
| 412 } | 540 } |
| 413 SkDebugf(" windValue=%d", fWindValue); | 541 SkDebugf(" windValue=%d", fWindValue); |
| 414 if (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0) { | 542 if (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0) { |
| 415 SkDebugf(" oppValue=%d", fOppValue); | 543 SkDebugf(" oppValue=%d", fOppValue); |
| 416 } | 544 } |
| 417 SkDebugf(" from=%d", fFromAngleIndex); | 545 if (fFromAngle && fFromAngle->debugID()) { |
| 418 SkDebugf(" to=%d", fToAngleIndex); | 546 SkDebugf(" from=%d", fFromAngle->debugID()); |
| 547 } |
| 548 if (fToAngle && fToAngle->debugID()) { |
| 549 SkDebugf(" to=%d", fToAngle->debugID()); |
| 550 } |
| 551 if (fChased) { |
| 552 SkDebugf(" chased"); |
| 553 } |
| 554 if (fCoincident) { |
| 555 SkDebugf(" coincident"); |
| 556 } |
| 419 if (fDone) { | 557 if (fDone) { |
| 420 SkDebugf(" done"); | 558 SkDebugf(" done"); |
| 421 } | 559 } |
| 560 if (fLoop) { |
| 561 SkDebugf(" loop"); |
| 562 } |
| 563 if (fMultiple) { |
| 564 SkDebugf(" multiple"); |
| 565 } |
| 566 if (fNear) { |
| 567 SkDebugf(" near"); |
| 568 } |
| 569 if (fSmall) { |
| 570 SkDebugf(" small"); |
| 571 } |
| 422 if (fTiny) { | 572 if (fTiny) { |
| 423 SkDebugf(" tiny"); | 573 SkDebugf(" tiny"); |
| 424 } | 574 } |
| 425 if (fSmall) { | |
| 426 SkDebugf(" small"); | |
| 427 } | |
| 428 if (fLoop) { | |
| 429 SkDebugf(" loop"); | |
| 430 } | |
| 431 SkDebugf("\n"); | 575 SkDebugf("\n"); |
| 432 } | 576 } |
| 433 | 577 |
| 434 void SkOpSpan::dump() const { | 578 void SkOpSpan::dump() const { |
| 435 ptrdiff_t spanIndex; | 579 ptrdiff_t spanIndex; |
| 436 const SkOpSegment* segment = debugToSegment(&spanIndex); | 580 const SkOpSegment* segment = debugToSegment(&spanIndex); |
| 437 if (segment) { | 581 if (segment) { |
| 438 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", segment, segment->debugID()); | 582 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", segment, segment->debugID()); |
| 439 SkDebugf(" [%d] ", spanIndex); | 583 SkDebugf(" [%d] ", spanIndex); |
| 440 } else { | 584 } else { |
| 441 SkDebugf("((SkOpSegment*) ?) [?]\n"); | 585 SkDebugf("((SkOpSegment*) ?) [?]\n"); |
| 442 SkDebugf(" [?] "); | 586 SkDebugf(" [?] "); |
| 443 } | 587 } |
| 444 dumpOne(); | 588 dumpOne(); |
| 445 } | 589 } |
| 446 | 590 |
| 447 void Dump(const SkTArray<class SkOpAngle, true>& angles) { | |
| 448 SkPathOpsDebug::DumpAngles(angles); | |
| 449 } | |
| 450 | |
| 451 void Dump(const SkTArray<class SkOpAngle* , true>& angles) { | |
| 452 SkPathOpsDebug::DumpAngles(angles); | |
| 453 } | |
| 454 | |
| 455 void Dump(const SkTArray<class SkOpAngle, true>* angles) { | |
| 456 SkPathOpsDebug::DumpAngles(*angles); | |
| 457 } | |
| 458 | |
| 459 void Dump(const SkTArray<class SkOpAngle* , true>* angles) { | |
| 460 SkPathOpsDebug::DumpAngles(*angles); | |
| 461 } | |
| 462 | |
| 463 void Dump(const SkTArray<class SkOpContour, true>& contours) { | 591 void Dump(const SkTArray<class SkOpContour, true>& contours) { |
| 464 SkPathOpsDebug::DumpContours(contours); | 592 SkPathOpsDebug::DumpContours(contours); |
| 465 } | 593 } |
| 466 | 594 |
| 467 void Dump(const SkTArray<class SkOpContour* , true>& contours) { | 595 void Dump(const SkTArray<class SkOpContour* , true>& contours) { |
| 468 SkPathOpsDebug::DumpContours(contours); | 596 SkPathOpsDebug::DumpContours(contours); |
| 469 } | 597 } |
| 470 | 598 |
| 471 void Dump(const SkTArray<class SkOpContour, true>* contours) { | 599 void Dump(const SkTArray<class SkOpContour, true>* contours) { |
| 472 SkPathOpsDebug::DumpContours(*contours); | 600 SkPathOpsDebug::DumpContours(*contours); |
| 473 } | 601 } |
| 474 | 602 |
| 475 void Dump(const SkTArray<class SkOpContour* , true>* contours) { | 603 void Dump(const SkTArray<class SkOpContour* , true>* contours) { |
| 476 SkPathOpsDebug::DumpContours(*contours); | 604 SkPathOpsDebug::DumpContours(*contours); |
| 477 } | 605 } |
| 478 | 606 |
| 479 void Dump(const SkTDArray<SkOpSpan *>& chaseArray) { | 607 void Dump(const SkTDArray<SkOpSpan *>& chase) { |
| 480 SkPathOpsDebug::DumpSpans(chaseArray); | 608 SkPathOpsDebug::DumpSpans(chase); |
| 481 } | 609 } |
| 482 | 610 |
| 483 void Dump(const SkTDArray<SkOpSpan *>* chaseArray) { | 611 void Dump(const SkTDArray<SkOpSpan *>* chase) { |
| 484 SkPathOpsDebug::DumpSpans(*chaseArray); | 612 SkPathOpsDebug::DumpSpans(*chase); |
| 485 } | 613 } |
| 486 | 614 |
| 487 void DumpAngles(const SkTArray<class SkOpContour, true>& contours) { | 615 void DumpAngles(const SkTArray<class SkOpContour, true>& contours) { |
| 488 SkPathOpsDebug::DumpContourAngles(contours); | 616 SkPathOpsDebug::DumpContourAngles(contours); |
| 489 } | 617 } |
| 490 | 618 |
| 491 void DumpAngles(const SkTArray<class SkOpContour* , true>& contours) { | 619 void DumpAngles(const SkTArray<class SkOpContour* , true>& contours) { |
| 492 SkPathOpsDebug::DumpContourAngles(contours); | 620 SkPathOpsDebug::DumpContourAngles(contours); |
| 493 } | 621 } |
| 494 | 622 |
| 495 void DumpAngles(const SkTArray<class SkOpContour, true>* contours) { | 623 void DumpAngles(const SkTArray<class SkOpContour, true>* contours) { |
| 496 SkPathOpsDebug::DumpContourAngles(*contours); | 624 SkPathOpsDebug::DumpContourAngles(*contours); |
| 497 } | 625 } |
| 498 | 626 |
| 499 void DumpAngles(const SkTArray<class SkOpContour* , true>* contours) { | 627 void DumpAngles(const SkTArray<class SkOpContour* , true>* contours) { |
| 500 SkPathOpsDebug::DumpContourAngles(*contours); | 628 SkPathOpsDebug::DumpContourAngles(*contours); |
| 501 } | 629 } |
| 502 | 630 |
| 631 void DumpCoin(const SkTArray<class SkOpContour, true>& contours) { |
| 632 SkPathOpsDebug::DumpCoincidence(contours); |
| 633 } |
| 634 |
| 635 void DumpCoin(const SkTArray<class SkOpContour* , true>& contours) { |
| 636 SkPathOpsDebug::DumpCoincidence(contours); |
| 637 } |
| 638 |
| 639 void DumpCoin(const SkTArray<class SkOpContour, true>* contours) { |
| 640 SkPathOpsDebug::DumpCoincidence(*contours); |
| 641 } |
| 642 |
| 643 void DumpCoin(const SkTArray<class SkOpContour* , true>* contours) { |
| 644 SkPathOpsDebug::DumpCoincidence(*contours); |
| 645 } |
| 646 |
| 503 void DumpSpans(const SkTArray<class SkOpContour, true>& contours) { | 647 void DumpSpans(const SkTArray<class SkOpContour, true>& contours) { |
| 504 SkPathOpsDebug::DumpContourSpans(contours); | 648 SkPathOpsDebug::DumpContourSpans(contours); |
| 505 } | 649 } |
| 506 | 650 |
| 507 void DumpSpans(const SkTArray<class SkOpContour* , true>& contours) { | 651 void DumpSpans(const SkTArray<class SkOpContour* , true>& contours) { |
| 508 SkPathOpsDebug::DumpContourSpans(contours); | 652 SkPathOpsDebug::DumpContourSpans(contours); |
| 509 } | 653 } |
| 510 | 654 |
| 511 void DumpSpans(const SkTArray<class SkOpContour, true>* contours) { | 655 void DumpSpans(const SkTArray<class SkOpContour, true>* contours) { |
| 512 SkPathOpsDebug::DumpContourSpans(*contours); | 656 SkPathOpsDebug::DumpContourSpans(*contours); |
| 513 } | 657 } |
| 514 | 658 |
| 515 void DumpSpans(const SkTArray<class SkOpContour* , true>* contours) { | 659 void DumpSpans(const SkTArray<class SkOpContour* , true>* contours) { |
| 516 SkPathOpsDebug::DumpContourSpans(*contours); | 660 SkPathOpsDebug::DumpContourSpans(*contours); |
| 517 } | 661 } |
| 518 | 662 |
| 663 void DumpSpan(const SkTArray<class SkOpContour, true>& contours, int segmentID)
{ |
| 664 SkPathOpsDebug::DumpContourSpan(contours, segmentID); |
| 665 } |
| 666 |
| 667 void DumpSpan(const SkTArray<class SkOpContour* , true>& contours, int segmentID
) { |
| 668 SkPathOpsDebug::DumpContourSpan(contours, segmentID); |
| 669 } |
| 670 |
| 671 void DumpSpan(const SkTArray<class SkOpContour, true>* contours, int segmentID)
{ |
| 672 SkPathOpsDebug::DumpContourSpan(*contours, segmentID); |
| 673 } |
| 674 |
| 675 void DumpSpan(const SkTArray<class SkOpContour* , true>* contours, int segmentID
) { |
| 676 SkPathOpsDebug::DumpContourSpan(*contours, segmentID); |
| 677 } |
| 678 |
| 519 void DumpPts(const SkTArray<class SkOpContour, true>& contours) { | 679 void DumpPts(const SkTArray<class SkOpContour, true>& contours) { |
| 520 SkPathOpsDebug::DumpContourPts(contours); | 680 SkPathOpsDebug::DumpContourPts(contours); |
| 521 } | 681 } |
| 522 | 682 |
| 523 void DumpPts(const SkTArray<class SkOpContour* , true>& contours) { | 683 void DumpPts(const SkTArray<class SkOpContour* , true>& contours) { |
| 524 SkPathOpsDebug::DumpContourPts(contours); | 684 SkPathOpsDebug::DumpContourPts(contours); |
| 525 } | 685 } |
| 526 | 686 |
| 527 void DumpPts(const SkTArray<class SkOpContour, true>* contours) { | 687 void DumpPts(const SkTArray<class SkOpContour, true>* contours) { |
| 528 SkPathOpsDebug::DumpContourPts(*contours); | 688 SkPathOpsDebug::DumpContourPts(*contours); |
| 529 } | 689 } |
| 530 | 690 |
| 531 void DumpPts(const SkTArray<class SkOpContour* , true>* contours) { | 691 void DumpPts(const SkTArray<class SkOpContour* , true>* contours) { |
| 532 SkPathOpsDebug::DumpContourPts(*contours); | 692 SkPathOpsDebug::DumpContourPts(*contours); |
| 533 } | 693 } |
| 534 | 694 |
| 695 void DumpPt(const SkTArray<class SkOpContour, true>& contours, int segmentID) { |
| 696 SkPathOpsDebug::DumpContourPt(contours, segmentID); |
| 697 } |
| 698 |
| 699 void DumpPt(const SkTArray<class SkOpContour* , true>& contours, int segmentID)
{ |
| 700 SkPathOpsDebug::DumpContourPt(contours, segmentID); |
| 701 } |
| 702 |
| 703 void DumpPt(const SkTArray<class SkOpContour, true>* contours, int segmentID) { |
| 704 SkPathOpsDebug::DumpContourPt(*contours, segmentID); |
| 705 } |
| 706 |
| 707 void DumpPt(const SkTArray<class SkOpContour* , true>* contours, int segmentID)
{ |
| 708 SkPathOpsDebug::DumpContourPt(*contours, segmentID); |
| 709 } |
| 710 |
| 535 static void dumpTestCase(const SkDQuad& quad1, const SkDQuad& quad2, int testNo)
{ | 711 static void dumpTestCase(const SkDQuad& quad1, const SkDQuad& quad2, int testNo)
{ |
| 536 SkDebugf("<div id=\"quad%d\">\n", testNo); | 712 SkDebugf("<div id=\"quad%d\">\n", testNo); |
| 537 quad1.dumpComma(","); | 713 quad1.dumpComma(","); |
| 538 quad2.dump(); | 714 quad2.dump(); |
| 539 SkDebugf("</div>\n\n"); | 715 SkDebugf("</div>\n\n"); |
| 540 } | 716 } |
| 541 | 717 |
| 542 static void dumpTestTrailer() { | 718 static void dumpTestTrailer() { |
| 543 SkDebugf("</div>\n\n<script type=\"text/javascript\">\n\n"); | 719 SkDebugf("</div>\n\n<script type=\"text/javascript\">\n\n"); |
| 544 SkDebugf(" var testDivs = [\n"); | 720 SkDebugf(" var testDivs = [\n"); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 557 dumpTestCase(quad1, quad2, testNo); | 733 dumpTestCase(quad1, quad2, testNo); |
| 558 dumpTestTrailer(); | 734 dumpTestTrailer(); |
| 559 dumpTestList(testNo, 0); | 735 dumpTestList(testNo, 0); |
| 560 SkDebugf("\n"); | 736 SkDebugf("\n"); |
| 561 } | 737 } |
| 562 | 738 |
| 563 void DumpT(const SkDQuad& quad, double t) { | 739 void DumpT(const SkDQuad& quad, double t) { |
| 564 SkDLine line = {{quad.ptAtT(t), quad[0]}}; | 740 SkDLine line = {{quad.ptAtT(t), quad[0]}}; |
| 565 line.dump(); | 741 line.dump(); |
| 566 } | 742 } |
| OLD | NEW |