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

Unified Diff: src/pathops/SkOpContour.h

Issue 131103009: update pathops to circle sort (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable old test that still fails on linux 32 release Created 6 years, 8 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.cpp ('k') | src/pathops/SkOpContour.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpContour.h
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index 8cedab4cb1ebb0b5e35be9bcf4223c8b1183dea1..5b92a4b071b999d9adfad3d8f89a8ad025b75f38 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -25,7 +25,7 @@ class SkOpContour {
public:
SkOpContour() {
reset();
-#ifdef SK_DEBUG
+#if defined(SK_DEBUG) || !FORCE_RELEASE
fID = ++SkPathOpsDebug::gContourID;
#endif
}
@@ -77,18 +77,29 @@ public:
return fSegments[segIndex].addT(&other->fSegments[otherIndex], pt, newT);
}
- int addSelfT(int segIndex, SkOpContour* other, int otherIndex, const SkPoint& pt, double newT) {
+ int addSelfT(int segIndex, const SkPoint& pt, double newT) {
setContainsIntercepts();
- return fSegments[segIndex].addSelfT(&other->fSegments[otherIndex], pt, newT);
+ return fSegments[segIndex].addSelfT(pt, newT);
}
const SkPathOpsBounds& bounds() const {
return fBounds;
}
+ bool calcAngles();
void calcCoincidentWinding();
void calcPartialCoincidentWinding();
+ void checkDuplicates() {
+ int segmentCount = fSegments.count();
+ for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
+ SkOpSegment& segment = fSegments[sIndex];
+ if (segment.count() > 2) {
+ segment.checkDuplicates();
+ }
+ }
+ }
+
void checkEnds() {
if (!fContainsCurves) {
return;
@@ -106,6 +117,26 @@ public:
}
}
+ void checkMultiples() {
+ int segmentCount = fSegments.count();
+ for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
+ SkOpSegment& segment = fSegments[sIndex];
+ if (segment.count() > 2) {
+ segment.checkMultiples();
+ }
+ }
+ }
+
+ void checkSmall() {
+ int segmentCount = fSegments.count();
+ for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
+ SkOpSegment& segment = fSegments[sIndex];
+ if (segment.hasSmall()) {
+ segment.checkSmall();
+ }
+ }
+ }
+
// if same point has different T values, choose a common T
void checkTiny() {
int segmentCount = fSegments.count();
@@ -113,7 +144,10 @@ public:
return;
}
for (int sIndex = 0; sIndex < segmentCount; ++sIndex) {
- fSegments[sIndex].checkTiny();
+ SkOpSegment& segment = fSegments[sIndex];
+ if (segment.hasTiny()) {
+ segment.checkTiny();
+ }
}
}
@@ -192,6 +226,7 @@ public:
fXor = isXor;
}
+ void sortAngles();
void sortSegments();
const SkPoint& start() const {
@@ -242,6 +277,12 @@ public:
static void debugShowWindingValues(const SkTArray<SkOpContour*, true>& contourList);
#endif
+ // available to test routines only
+ void dump() const;
+ void dumpAngles() const;
+ void dumpPts() const;
+ void dumpSpans() const;
+
private:
void calcCommonCoincidentWinding(const SkCoincidence& );
void joinCoincidence(const SkTArray<SkCoincidence, true>& , bool partial);
@@ -261,8 +302,11 @@ private:
bool fOperand; // true for the second argument to a binary operator
bool fXor;
bool fOppXor;
-#ifdef SK_DEBUG
+#if defined(SK_DEBUG) || !FORCE_RELEASE
+ int debugID() const { return fID; }
int fID;
+#else
+ int debugID() const { return -1; }
#endif
};
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/pathops/SkOpContour.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698