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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 SkDPoint::Dump(pts()[0]); | 195 SkDPoint::Dump(pts()[0]); |
196 SkDPoint::Dump(pts()[1]); | 196 SkDPoint::Dump(pts()[1]); |
197 if (verb() >= SkPath::kQuad_Verb) { | 197 if (verb() >= SkPath::kQuad_Verb) { |
198 SkDPoint::Dump(pts()[2]); | 198 SkDPoint::Dump(pts()[2]); |
199 } | 199 } |
200 if (verb() >= SkPath::kCubic_Verb) { | 200 if (verb() >= SkPath::kCubic_Verb) { |
201 SkDPoint::Dump(pts()[3]); | 201 SkDPoint::Dump(pts()[3]); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
| 205 const SkTDArray<SkOpSpan>& SkOpSegment::debugSpans() const { |
| 206 return fTs; |
| 207 } |
| 208 |
205 void SkOpSegment::dumpAngles() const { | 209 void SkOpSegment::dumpAngles() const { |
206 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID()); | 210 SkDebugf("((SkOpSegment*) 0x%p) [%d]\n", this, debugID()); |
207 int fromIndex = -1, toIndex = -1; | 211 int fromIndex = -1, toIndex = -1; |
208 for (int index = 0; index < count(); ++index) { | 212 for (int index = 0; index < count(); ++index) { |
209 int fIndex = fTs[index].fFromAngleIndex; | 213 int fIndex = fTs[index].fFromAngleIndex; |
210 int tIndex = fTs[index].fToAngleIndex; | 214 int tIndex = fTs[index].fToAngleIndex; |
211 if (fromIndex == fIndex && tIndex == toIndex) { | 215 if (fromIndex == fIndex && tIndex == toIndex) { |
212 continue; | 216 continue; |
213 } | 217 } |
214 if (fIndex >= 0) { | 218 if (fIndex >= 0) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 } | 368 } |
365 int oppCount = fOther->count(); | 369 int oppCount = fOther->count(); |
366 for (int index = 0; index < oppCount; ++index) { | 370 for (int index = 0; index < oppCount; ++index) { |
367 const SkOpSpan& otherSpan = fOther->span(index); | 371 const SkOpSpan& otherSpan = fOther->span(index); |
368 double otherTestT = otherSpan.fT; | 372 double otherTestT = otherSpan.fT; |
369 if (otherTestT < fOtherT) { | 373 if (otherTestT < fOtherT) { |
370 continue; | 374 continue; |
371 } | 375 } |
372 SkASSERT(otherTestT == fOtherT); | 376 SkASSERT(otherTestT == fOtherT); |
373 const SkOpSegment* candidate = otherSpan.fOther; | 377 const SkOpSegment* candidate = otherSpan.fOther; |
374 const SkOpSpan* first = candidate->spans().begin(); | 378 const SkOpSpan* first = candidate->debugSpans().begin(); |
375 const SkOpSpan* last = candidate->spans().end() - 1; | 379 const SkOpSpan* last = candidate->debugSpans().end() - 1; |
376 if (first <= this && this <= last) { | 380 if (first <= this && this <= last) { |
377 if (spanIndex) { | 381 if (spanIndex) { |
378 *spanIndex = this - first; | 382 *spanIndex = this - first; |
379 } | 383 } |
380 return candidate; | 384 return candidate; |
381 } | 385 } |
382 } | 386 } |
383 SkASSERT(0); | 387 SkASSERT(0); |
384 return NULL; | 388 return NULL; |
385 } | 389 } |
(...skipping 22 matching lines...) Expand all Loading... |
408 } | 412 } |
409 SkDebugf(" windValue=%d", fWindValue); | 413 SkDebugf(" windValue=%d", fWindValue); |
410 if (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0) { | 414 if (SkPathOpsDebug::ValidWind(fOppSum) || fOppValue != 0) { |
411 SkDebugf(" oppValue=%d", fOppValue); | 415 SkDebugf(" oppValue=%d", fOppValue); |
412 } | 416 } |
413 SkDebugf(" from=%d", fFromAngleIndex); | 417 SkDebugf(" from=%d", fFromAngleIndex); |
414 SkDebugf(" to=%d", fToAngleIndex); | 418 SkDebugf(" to=%d", fToAngleIndex); |
415 if (fDone) { | 419 if (fDone) { |
416 SkDebugf(" done"); | 420 SkDebugf(" done"); |
417 } | 421 } |
418 if (fUnsortableStart) { | |
419 SkDebugf(" unsortable-start"); | |
420 } | |
421 if (fUnsortableEnd) { | |
422 SkDebugf(" unsortable-end"); | |
423 } | |
424 if (fTiny) { | 422 if (fTiny) { |
425 SkDebugf(" tiny"); | 423 SkDebugf(" tiny"); |
426 } | 424 } |
427 if (fSmall) { | 425 if (fSmall) { |
428 SkDebugf(" small"); | 426 SkDebugf(" small"); |
429 } | 427 } |
430 if (fLoop) { | 428 if (fLoop) { |
431 SkDebugf(" loop"); | 429 SkDebugf(" loop"); |
432 } | 430 } |
433 SkDebugf("\n"); | 431 SkDebugf("\n"); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 dumpTestCase(quad1, quad2, testNo); | 557 dumpTestCase(quad1, quad2, testNo); |
560 dumpTestTrailer(); | 558 dumpTestTrailer(); |
561 dumpTestList(testNo, 0); | 559 dumpTestList(testNo, 0); |
562 SkDebugf("\n"); | 560 SkDebugf("\n"); |
563 } | 561 } |
564 | 562 |
565 void DumpT(const SkDQuad& quad, double t) { | 563 void DumpT(const SkDQuad& quad, double t) { |
566 SkDLine line = {{quad.ptAtT(t), quad[0]}}; | 564 SkDLine line = {{quad.ptAtT(t), quad[0]}}; |
567 line.dump(); | 565 line.dump(); |
568 } | 566 } |
OLD | NEW |