| 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 #include "PathOpsTestCommon.h" | 7 #include "PathOpsTestCommon.h" |
| 8 #include "SkIntersections.h" | 8 #include "SkIntersections.h" |
| 9 #include "SkOpContour.h" | 9 #include "SkOpContour.h" |
| 10 #include "SkOpSegment.h" | 10 #include "SkOpSegment.h" |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 // match the expected result. The tests above return 1 when first added,
but | 471 // match the expected result. The tests above return 1 when first added,
but |
| 472 // return 0 after the bug is fixed. | 472 // return 0 after the bug is fixed. |
| 473 SkDEBUGCODE(int result =) PathOpsAngleTester::After(angle2, angle1); | 473 SkDEBUGCODE(int result =) PathOpsAngleTester::After(angle2, angle1); |
| 474 SkASSERT(result == 0 || result == 1); | 474 SkASSERT(result == 0 || result == 1); |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| 479 void SkOpSegment::debugAddAngle(double startT, double endT) { | 479 void SkOpSegment::debugAddAngle(double startT, double endT) { |
| 480 SkOpPtT* startPtT = startT == 0 ? fHead.ptT() : startT == 1 ? fTail.ptT() | 480 SkOpPtT* startPtT = startT == 0 ? fHead.ptT() : startT == 1 ? fTail.ptT() |
| 481 : this->addT(startT, kNoAliasMatch, nullptr); | 481 : this->addT(startT, nullptr); |
| 482 SkOpPtT* endPtT = endT == 0 ? fHead.ptT() : endT == 1 ? fTail.ptT() | 482 SkOpPtT* endPtT = endT == 0 ? fHead.ptT() : endT == 1 ? fTail.ptT() |
| 483 : this->addT(endT, kNoAliasMatch, nullptr); | 483 : this->addT(endT, nullptr); |
| 484 SkOpAngle* angle = SkOpTAllocator<SkOpAngle>::Allocate(this->globalState()->
allocator()); | 484 SkOpAngle* angle = SkOpTAllocator<SkOpAngle>::Allocate(this->globalState()->
allocator()); |
| 485 SkOpSpanBase* startSpan = &fHead; | 485 SkOpSpanBase* startSpan = &fHead; |
| 486 while (startSpan->ptT() != startPtT) { | 486 while (startSpan->ptT() != startPtT) { |
| 487 startSpan = startSpan->upCast()->next(); | 487 startSpan = startSpan->upCast()->next(); |
| 488 } | 488 } |
| 489 SkOpSpanBase* endSpan = &fHead; | 489 SkOpSpanBase* endSpan = &fHead; |
| 490 while (endSpan->ptT() != endPtT) { | 490 while (endSpan->ptT() != endPtT) { |
| 491 endSpan = endSpan->upCast()->next(); | 491 endSpan = endSpan->upCast()->next(); |
| 492 } | 492 } |
| 493 angle->set(startSpan, endSpan); | 493 angle->set(startSpan, endSpan); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 518 SkOpSegment* first = contour.first(); | 518 SkOpSegment* first = contour.first(); |
| 519 first->debugAddAngle(0, 1); | 519 first->debugAddAngle(0, 1); |
| 520 SkOpSegment* next = first->next(); | 520 SkOpSegment* next = first->next(); |
| 521 next->debugAddAngle(0, 1); | 521 next->debugAddAngle(0, 1); |
| 522 /* int result = */ | 522 /* int result = */ |
| 523 PathOpsAngleTester::AllOnOneSide(*first->debugLastAngle(), *next->de
bugLastAngle()); | 523 PathOpsAngleTester::AllOnOneSide(*first->debugLastAngle(), *next->de
bugLastAngle()); |
| 524 // SkDebugf("i=%d result=%d\n", i , result); | 524 // SkDebugf("i=%d result=%d\n", i , result); |
| 525 // SkDebugf(""); | 525 // SkDebugf(""); |
| 526 } | 526 } |
| 527 } | 527 } |
| OLD | NEW |