aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkAddIntersections.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-08-25 11:27:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-25 11:27:17 -0700
commit29b2563afb1677515739f1d24fb27733626eca92 (patch)
tree8c447f8969688bf3e1187d1b0f1461a3e777c3cd /src/pathops/SkAddIntersections.cpp
parentf412f0988424cb5fad48a6097c8b29b5b9c56275 (diff)
path ops stream-lining
The addT() function is a workhorse of pathops. Make it simpler, removing branches and parameters. Separate addOpp() into const and modify parts. Add more debugging that asserts if the function fails and the data is not extreme (e.g., fuzzer generated). TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2273293004 Review-Url: https://codereview.chromium.org/2273293004
Diffstat (limited to 'src/pathops/SkAddIntersections.cpp')
-rw-r--r--src/pathops/SkAddIntersections.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pathops/SkAddIntersections.cpp b/src/pathops/SkAddIntersections.cpp
index a6cebca4b8..bdc7ae2565 100644
--- a/src/pathops/SkAddIntersections.cpp
+++ b/src/pathops/SkAddIntersections.cpp
@@ -505,11 +505,12 @@ bool AddIntersectTs(SkOpContour* test, SkOpContour* next, SkOpCoincidence* coinc
SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1);
SkASSERT(ts[1][pt] >= 0 && ts[1][pt] <= 1);
wt.segment()->debugValidate();
- SkOpPtT* testTAt = wt.segment()->addT(ts[swap][pt], nullptr);
+ SkOpPtT* testTAt = wt.segment()->addT(ts[swap][pt]);
wn.segment()->debugValidate();
- SkOpPtT* nextTAt = wn.segment()->addT(ts[!swap][pt], nullptr);
- if (testTAt->addOpp(nextTAt)) {
- testTAt->span()->checkForCollapsedCoincidence();
+ SkOpPtT* nextTAt = wn.segment()->addT(ts[!swap][pt]);
+ SkOpPtT* oppPrev = testTAt->oppPrev(nextTAt);
+ if (oppPrev) {
+ testTAt->addOpp(nextTAt, oppPrev);
}
if (testTAt->fPt != nextTAt->fPt) {
testTAt->span()->unaligned();