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

Unified Diff: src/pathops/SkOpAngle.cpp

Issue 1394503003: fix some pathops bugs found in 1M skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init to avoid warning 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/SkOpAngle.h ('k') | src/pathops/SkOpCoincidence.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpAngle.cpp
diff --git a/src/pathops/SkOpAngle.cpp b/src/pathops/SkOpAngle.cpp
index bb10e53b8be475a3ea77457ed21f18fa145546b5..655df45b15fa16edf91881f39741be605937cc62 100644
--- a/src/pathops/SkOpAngle.cpp
+++ b/src/pathops/SkOpAngle.cpp
@@ -222,53 +222,6 @@ bool SkOpAngle::checkCrossesZero() const {
return crossesZero;
}
-// loop looking for a pair of angle parts that are too close to be sorted
-/* This is called after other more simple intersection and angle sorting tests have been exhausted.
- This should be rarely called -- the test below is thorough and time consuming.
- This checks the distance between start points; the distance between
-*/
-void SkOpAngle::checkNearCoincidence() {
- SkOpAngle* test = this;
- do {
- SkOpSegment* testSegment = test->segment();
- double testStartT = test->start()->t();
- SkDPoint testStartPt = testSegment->dPtAtT(testStartT);
- double testEndT = test->end()->t();
- SkDPoint testEndPt = testSegment->dPtAtT(testEndT);
- double testLenSq = testStartPt.distanceSquared(testEndPt);
- if (0) {
- SkDebugf("%s testLenSq=%1.9g id=%d\n", __FUNCTION__, testLenSq, testSegment->debugID());
- }
- double testMidT = (testStartT + testEndT) / 2;
- SkOpAngle* next = test;
- while ((next = next->fNext) != this) {
- SkOpSegment* nextSegment = next->segment();
- double testMidDistSq = testSegment->distSq(testMidT, next);
- double testEndDistSq = testSegment->distSq(testEndT, next);
- double nextStartT = next->start()->t();
- SkDPoint nextStartPt = nextSegment->dPtAtT(nextStartT);
- double distSq = testStartPt.distanceSquared(nextStartPt);
- double nextEndT = next->end()->t();
- double nextMidT = (nextStartT + nextEndT) / 2;
- double nextMidDistSq = nextSegment->distSq(nextMidT, test);
- double nextEndDistSq = nextSegment->distSq(nextEndT, test);
- if (0) {
- SkDebugf("%s distSq=%1.9g testId=%d nextId=%d\n", __FUNCTION__, distSq,
- testSegment->debugID(), nextSegment->debugID());
- SkDebugf("%s testMidDistSq=%1.9g\n", __FUNCTION__, testMidDistSq);
- SkDebugf("%s testEndDistSq=%1.9g\n", __FUNCTION__, testEndDistSq);
- SkDebugf("%s nextMidDistSq=%1.9g\n", __FUNCTION__, nextMidDistSq);
- SkDebugf("%s nextEndDistSq=%1.9g\n", __FUNCTION__, nextEndDistSq);
- SkDPoint nextEndPt = nextSegment->dPtAtT(nextEndT);
- double nextLenSq = nextStartPt.distanceSquared(nextEndPt);
- SkDebugf("%s nextLenSq=%1.9g\n", __FUNCTION__, nextLenSq);
- SkDebugf("\n");
- }
- }
- test = test->fNext;
- } while (test->fNext != this);
-}
-
bool SkOpAngle::checkParallel(SkOpAngle* rh) {
SkDVector scratch[2];
const SkDVector* sweep, * tweep;
« no previous file with comments | « src/pathops/SkOpAngle.h ('k') | src/pathops/SkOpCoincidence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698