remove unused fields from SkOpSegment
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1322413002
diff --git a/src/pathops/SkOpContour.h b/src/pathops/SkOpContour.h
index b420008..974c4ad 100644
--- a/src/pathops/SkOpContour.h
+++ b/src/pathops/SkOpContour.h
@@ -318,7 +318,6 @@
fNext = nullptr;
fCount = 0;
fDone = false;
- fTopsFound = false;
SkDEBUGCODE(fBounds.set(SK_ScalarMax, SK_ScalarMax, SK_ScalarMin, SK_ScalarMin));
SkDEBUGCODE(fFirstSorted = -1);
SkDEBUGCODE(fDebugIndent = 0);
@@ -416,7 +415,6 @@
int fCount;
int fFirstSorted;
bool fDone; // set by find top segment
- bool fTopsFound;
bool fOperand; // true for the second argument to a binary operator
bool fReverse; // true if contour should be reverse written to path (used only by fix winding)
bool fXor; // set if original path had even-odd fill
diff --git a/src/pathops/SkOpEdgeBuilder.cpp b/src/pathops/SkOpEdgeBuilder.cpp
index 7216830..24ca9b1 100644
--- a/src/pathops/SkOpEdgeBuilder.cpp
+++ b/src/pathops/SkOpEdgeBuilder.cpp
@@ -202,8 +202,7 @@
// split self-intersecting cubics in two before proceeding
// if the cubic is convex, it doesn't self intersect.
SkScalar loopT;
- SkDCubic::CubicType cubicType;
- if (SkDCubic::ComplexBreak(pointsPtr, &loopT, &cubicType)) {
+ if (SkDCubic::ComplexBreak(pointsPtr, &loopT)) {
SkPoint cubicPair[7];
SkChopCubicAt(pointsPtr, cubicPair, loopT);
if (!SkScalarsAreFinite(&cubicPair[0].fX, SK_ARRAY_COUNT(cubicPair) * 2)) {
@@ -221,8 +220,8 @@
for (int index = 0; index < SkPathOpsVerbToPoints(v2); ++index) {
force_small_to_zero(&curve2[index]);
}
- fCurrentContour->addCurve(v1, curve1, fAllocator)->setCubicType(cubicType);
- fCurrentContour->addCurve(v2, curve2, fAllocator)->setCubicType(cubicType);
+ fCurrentContour->addCurve(v1, curve1, fAllocator);
+ fCurrentContour->addCurve(v2, curve2, fAllocator);
} else {
fCurrentContour->addCubic(pointsPtr, fAllocator);
}
diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp
index e332954..5ee775c 100644
--- a/src/pathops/SkOpSegment.cpp
+++ b/src/pathops/SkOpSegment.cpp
@@ -912,10 +912,8 @@
fPts = pts;
fWeight = weight;
fVerb = verb;
- fCubicType = SkDCubic::kUnsplit_SkDCubicType;
fCount = 0;
fDoneCount = 0;
- fTopsFound = false;
fVisited = false;
SkOpSpan* zeroSpan = &fHead;
zeroSpan->init(this, nullptr, 0, fPts[0]);
diff --git a/src/pathops/SkOpSegment.h b/src/pathops/SkOpSegment.h
index d1cd29a..6a8ab85 100644
--- a/src/pathops/SkOpSegment.h
+++ b/src/pathops/SkOpSegment.h
@@ -304,10 +304,6 @@
fContour = contour;
}
- void setCubicType(SkDCubic::CubicType cubicType) {
- fCubicType = cubicType;
- }
-
void setNext(SkOpSegment* next) {
fNext = next;
}
@@ -404,8 +400,6 @@
int fCount; // number of spans (one for a non-intersecting segment)
int fDoneCount; // number of processed spans (zero initially)
SkPath::Verb fVerb;
- SkDCubic::CubicType fCubicType;
- bool fTopsFound;
bool fVisited; // used by missing coincidence check
SkDEBUGCODE(int fID);
};
diff --git a/src/pathops/SkPathOpsCubic.cpp b/src/pathops/SkPathOpsCubic.cpp
index f82bc35..2542ca5 100644
--- a/src/pathops/SkPathOpsCubic.cpp
+++ b/src/pathops/SkPathOpsCubic.cpp
@@ -229,7 +229,7 @@
return approximately_zero_when_compared_to(distance, largest);
}
-bool SkDCubic::ComplexBreak(const SkPoint pointsPtr[4], SkScalar* t, CubicType* resultType) {
+bool SkDCubic::ComplexBreak(const SkPoint pointsPtr[4], SkScalar* t) {
SkScalar d[3];
SkCubicType cubicType = SkClassifyCubic(pointsPtr, d);
if (cubicType == kLoop_SkCubicType) {
@@ -246,7 +246,6 @@
SkScalar smaller = SkTMax(0.f, SkTMin(ls, ms));
SkScalar larger = SkTMin(1.f, SkTMax(ls, ms));
*t = (smaller + larger) / 2;
- *resultType = kSplitAtLoop_SkDCubicType;
return *t > 0 && *t < 1;
}
} else if (kSerpentine_SkCubicType == cubicType || kCusp_SkCubicType == cubicType) {
@@ -278,13 +277,11 @@
for (int index = 0; index < roots; ++index) {
if (between(inflectionTs[0], maxCurvature[index], inflectionTs[1])) {
*t = maxCurvature[index];
- *resultType = kSplitAtMaxCurvature_SkDCubicType;
return true;
}
}
} else if (infTCount == 1) {
*t = inflectionTs[0];
- *resultType = kSplitAtInflection_SkDCubicType;
return *t > 0 && *t < 1;
}
}
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h
index 7a57e94..9fd0f17 100644
--- a/src/pathops/SkPathOpsCubic.h
+++ b/src/pathops/SkPathOpsCubic.h
@@ -27,13 +27,6 @@
kYAxis
};
- enum CubicType {
- kUnsplit_SkDCubicType,
- kSplitAtLoop_SkDCubicType,
- kSplitAtInflection_SkDCubicType,
- kSplitAtMaxCurvature_SkDCubicType,
- };
-
bool collapsed() const {
return fPts[0].approximatelyEqual(fPts[1]) && fPts[0].approximatelyEqual(fPts[2])
&& fPts[0].approximatelyEqual(fPts[3]);
@@ -58,7 +51,7 @@
double calcPrecision() const;
SkDCubicPair chopAt(double t) const;
static void Coefficients(const double* cubic, double* A, double* B, double* C, double* D);
- static bool ComplexBreak(const SkPoint pts[4], SkScalar* t, CubicType* cubicType);
+ static bool ComplexBreak(const SkPoint pts[4], SkScalar* t);
int convexHull(char order[kPointCount]) const;
void debugInit() {
diff --git a/tests/PathOpsCubicIntersectionTest.cpp b/tests/PathOpsCubicIntersectionTest.cpp
index d45ec06..6186ec8 100644
--- a/tests/PathOpsCubicIntersectionTest.cpp
+++ b/tests/PathOpsCubicIntersectionTest.cpp
@@ -627,8 +627,7 @@
SkScalar loopT;
SkScalar d[3];
SkCubicType cubicType = SkClassifyCubic(c, d);
- SkDCubic::CubicType dType;
- if (SkDCubic::ComplexBreak(c, &loopT, &dType) && cubicType == SkCubicType::kLoop_SkCubicType) {
+ if (SkDCubic::ComplexBreak(c, &loopT) && cubicType == SkCubicType::kLoop_SkCubicType) {
SkIntersections i;
SkPoint twoCubics[7];
SkChopCubicAt(c, twoCubics, loopT);
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 2fb8669..a28bae8 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -3845,8 +3845,7 @@
static void complex_to_quads(const SkPoint pts[], SkPath* path) {
SkScalar loopT;
- SkDCubic::CubicType dType;
- if (SkDCubic::ComplexBreak(pts, &loopT, &dType)) {
+ if (SkDCubic::ComplexBreak(pts, &loopT)) {
SkPoint cubicPair[7];
SkChopCubicAt(pts, cubicPair, loopT);
SkDCubic c1, c2;