Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Unified Diff: src/pathops/SkPathOpsTSect.h

Issue 1405383004: fix path op conic bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix w cast Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkPathOpsSimplify.cpp ('k') | tests/PathOpsBuilderConicTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsTSect.h
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h
index 56a320aab2190f2fb3d54c4e695e975a12dc9064..bebdf40208cb25b7997c594d3f6ca7c1a6be3c4a 100644
--- a/src/pathops/SkPathOpsTSect.h
+++ b/src/pathops/SkPathOpsTSect.h
@@ -987,8 +987,8 @@ void SkTSect<TCurve, OppCurve>::coincidentForce(SkTSect<OppCurve, TCurve>* sect2
first->fCoinStart.setPerp(fCurve, start1s, fCurve[0], sect2->fCurve);
first->fCoinEnd.setPerp(fCurve, start1e, fCurve[TCurve::kPointLast], sect2->fCurve);
bool oppMatched = first->fCoinStart.perpT() < first->fCoinEnd.perpT();
- double oppStartT = SkTMax(0., first->fCoinStart.perpT());
- double oppEndT = SkTMin(1., first->fCoinEnd.perpT());
+ double oppStartT = first->fCoinStart.perpT() == -1 ? 0 : SkTMax(0., first->fCoinStart.perpT());
+ double oppEndT = first->fCoinEnd.perpT() == -1 ? 1 : SkTMin(1., first->fCoinEnd.perpT());
if (!oppMatched) {
SkTSwap(oppStartT, oppEndT);
}
@@ -2086,7 +2086,7 @@ void SkTSect<TCurve, OppCurve>::BinarySearch(SkTSect<TCurve, OppCurve>* sect1,
#if DEBUG_T_SECT_LOOP_COUNT
intersections->debugBumpLoopCount(SkIntersections::kCoinCheck_DebugLoop);
#endif
- if (!--coinLoopCount) {
+ if (!--coinLoopCount && sect1->fHead && sect2->fHead) {
/* All known working cases resolve in two tries. Sadly, cubicConicTests[0]
gets stuck in a loop. It adds an extension to allow a coincident end
perpendicular to track its intersection in the opposite curve. However,
@@ -2127,8 +2127,12 @@ void SkTSect<TCurve, OppCurve>::BinarySearch(SkTSect<TCurve, OppCurve>* sect1,
}
SkASSERT(sect2->fCoincident); // courtesy check : coincidence only looks at sect 1
do {
- SkASSERT(coincident->fCoinStart.isCoincident());
- SkASSERT(coincident->fCoinEnd.isCoincident());
+ if (!coincident->fCoinStart.isCoincident()) {
+ continue;
+ }
+ if (!coincident->fCoinEnd.isCoincident()) {
+ continue;
+ }
int index = intersections->insertCoincident(coincident->fStartT,
coincident->fCoinStart.perpT(), coincident->fPart[0]);
if ((intersections->insertCoincident(coincident->fEndT,
« no previous file with comments | « src/pathops/SkPathOpsSimplify.cpp ('k') | tests/PathOpsBuilderConicTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698