aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkOpSegment.h
diff options
context:
space:
mode:
authorGravatar hcm <hcm@google.com>2014-10-28 10:55:54 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-28 10:55:54 -0700
commit27c46a08a9210e9306b8ea1b00349ec198153c38 (patch)
tree31548283108b4e997adc12651ae77acbb6c3fc8c /src/pathops/SkOpSegment.h
parentee0c2e4fd429424beaa35f29e7f656997ba3f115 (diff)
Revert of harden pathops for pathological test (patchset #19 id:410001 of https://codereview.chromium.org/633393002/)
Reason for revert: Compile errors on bots Original issue's description: > These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions. > > The fixes include > - detect when finding the active top loops between two possible answers > - preflight chasing winding to ensure answer is consistent > - binary search more often when quadratic intersection fails > - add more failure paths when an intersect is missed > > While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed. > > TBR= > BUG=421132 > > Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2 TBR=caryclark@google.com NOTREECHECKS=true NOTRY=true BUG=421132 Review URL: https://codereview.chromium.org/686843002
Diffstat (limited to 'src/pathops/SkOpSegment.h')
-rw-r--r--src/pathops/SkOpSegment.h42
1 files changed, 14 insertions, 28 deletions
diff --git a/src/pathops/SkOpSegment.h b/src/pathops/SkOpSegment.h
index b4da929d99..4c35ac7e7e 100644
--- a/src/pathops/SkOpSegment.h
+++ b/src/pathops/SkOpSegment.h
@@ -302,7 +302,7 @@ public:
double calcMissingTStart(const SkOpSegment* ref, double loEnd, double min, double max,
double hiEnd, const SkOpSegment* other, int thisEnd);
void checkDuplicates();
- bool checkEnds();
+ void checkEnds();
void checkMultiples();
void checkSmall();
bool checkSmall(int index) const;
@@ -323,10 +323,8 @@ public:
int findT(double t, const SkPoint& , const SkOpSegment* ) const;
SkOpSegment* findTop(int* tIndex, int* endIndex, bool* unsortable, bool firstPass);
void fixOtherTIndex();
- bool inconsistentAngle(int maxWinding, int sumWinding, int oppMaxWinding, int oppSumWinding,
- const SkOpAngle* angle) const;
void initWinding(int start, int end, SkOpAngle::IncludeType angleIncludeType);
- bool initWinding(int start, int end, double tHit, int winding, SkScalar hitDx, int oppWind,
+ void initWinding(int start, int end, double tHit, int winding, SkScalar hitDx, int oppWind,
SkScalar hitOppDx);
bool isMissing(double startT, const SkPoint& pt) const;
bool isTiny(const SkOpAngle* angle) const;
@@ -334,13 +332,11 @@ public:
bool cancel);
SkOpSpan* markAndChaseDoneBinary(int index, int endIndex);
SkOpSpan* markAndChaseDoneUnary(int index, int endIndex);
- bool markAndChaseWinding(const SkOpAngle* angle, int winding, int oppWinding,
- SkOpSpan** lastPtr);
+ SkOpSpan* markAndChaseWinding(const SkOpAngle* angle, int winding, int oppWinding);
SkOpSpan* markAngle(int maxWinding, int sumWinding, int oppMaxWinding, int oppSumWinding,
const SkOpAngle* angle);
void markDone(int index, int winding);
void markDoneBinary(int index);
- void markDoneFinal(int index);
void markDoneUnary(int index);
bool nextCandidate(int* start, int* end) const;
int nextSpan(int from, int step) const;
@@ -407,16 +403,15 @@ private:
SkOpAngle* addSingletonAngleDown(SkOpSegment** otherPtr, SkOpAngle** );
SkOpAngle* addSingletonAngleUp(SkOpSegment** otherPtr, SkOpAngle** );
SkOpAngle* addSingletonAngles(int step);
- void alignRange(int lower, int upper, const SkOpSegment* other, int oLower, int oUpper);
void alignSpan(const SkPoint& newPt, double newT, const SkOpSegment* other, double otherT,
const SkOpSegment* other2, SkOpSpan* oSpan, SkTDArray<AlignedSpan>* );
bool betweenPoints(double midT, const SkPoint& pt1, const SkPoint& pt2) const;
void bumpCoincidentBlind(bool binary, int index, int last);
bool bumpCoincidentThis(const SkOpSpan& oTest, bool binary, int* index,
- SkTArray<SkPoint, true>* outsideTs);
+ SkTArray<SkPoint, true>* outsideTs);
void bumpCoincidentOBlind(int index, int last);
- bool bumpCoincidentOther(const SkOpSpan& oTest, int* index,
- SkTArray<SkPoint, true>* outsideTs, const SkPoint& endPt);
+ void bumpCoincidentOther(const SkOpSpan& oTest, int* index,
+ SkTArray<SkPoint, true>* outsideTs);
bool bumpSpan(SkOpSpan* span, int windDelta, int oppDelta);
bool calcLoopSpanCount(const SkOpSpan& thisSpan, int* smallCounts);
bool checkForSmall(const SkOpSpan* span, const SkPoint& pt, double newT,
@@ -443,9 +438,6 @@ private:
const SkOpSpan& firstSpan(const SkOpSpan& thisSpan) const;
void init(const SkPoint pts[], SkPath::Verb verb, bool operand, bool evenOdd);
bool inCoincidentSpan(double t, const SkOpSegment* other) const;
- bool inconsistentWinding(const SkOpAngle* , int maxWinding, int oppMaxWinding) const;
- bool inconsistentWinding(int min, int maxWinding, int oppMaxWinding) const;
- bool inconsistentWinding(const char* funName, int tIndex, int winding, int oppWinding) const;
bool inLoop(const SkOpAngle* baseAngle, int spanCount, int* indexPtr) const;
#if OLD_CHASE
bool isSimple(int end) const;
@@ -457,35 +449,30 @@ private:
void matchWindingValue(int tIndex, double t, bool borrowWind);
SkOpSpan* markAndChaseDone(int index, int endIndex, int winding);
SkOpSpan* markAndChaseDoneBinary(const SkOpAngle* angle, int winding, int oppWinding);
- bool markAndChaseWinding(const SkOpAngle* angle, int winding, SkOpSpan** lastPtr);
- bool markAndChaseWinding(int index, int endIndex, int winding, SkOpSpan** lastPtr);
- bool markAndChaseWinding(int index, int endIndex, int winding, int oppWinding,
- SkOpSpan** lastPtr);
+ SkOpSpan* markAndChaseWinding(const SkOpAngle* angle, int winding);
+ SkOpSpan* markAndChaseWinding(int index, int endIndex, int winding);
+ SkOpSpan* markAndChaseWinding(int index, int endIndex, int winding, int oppWinding);
SkOpSpan* markAngle(int maxWinding, int sumWinding, const SkOpAngle* angle);
void markDoneBinary(int index, int winding, int oppWinding);
SkOpSpan* markAndChaseDoneUnary(const SkOpAngle* angle, int winding);
void markOneDone(const char* funName, int tIndex, int winding);
void markOneDoneBinary(const char* funName, int tIndex);
void markOneDoneBinary(const char* funName, int tIndex, int winding, int oppWinding);
- void markOneDoneFinal(const char* funName, int tIndex);
void markOneDoneUnary(const char* funName, int tIndex);
- bool markOneWinding(const char* funName, int tIndex, int winding, SkOpSpan** lastPtr);
- bool markOneWinding(const char* funName, int tIndex, int winding, int oppWinding,
- SkOpSpan** lastPtr);
- bool markWinding(int index, int winding);
- bool markWinding(int index, int winding, int oppWinding);
+ SkOpSpan* markOneWinding(const char* funName, int tIndex, int winding);
+ SkOpSpan* markOneWinding(const char* funName, int tIndex, int winding, int oppWinding);
+ void markWinding(int index, int winding);
+ void markWinding(int index, int winding, int oppWinding);
bool monotonicInY(int tStart, int tEnd) const;
bool multipleEnds() const { return fTs[count() - 2].fT == 1; }
bool multipleStarts() const { return fTs[1].fT == 0; }
- SkOpSegment* nextChase(int* index, int* step, int* min, SkOpSpan** last) const;
+ SkOpSegment* nextChase(int* index, int* step, int* min, SkOpSpan** last);
int nextExactSpan(int from, int step) const;
- void resetSpanFlags();
bool serpentine(int tStart, int tEnd) const;
void setCoincidentRange(const SkPoint& startPt, const SkPoint& endPt, SkOpSegment* other);
void setFromAngle(int endIndex, SkOpAngle* );
- void setSpanFlags(const SkPoint& pt, double newT, SkOpSpan* span);
void setToAngle(int endIndex, SkOpAngle* );
void setUpWindings(int index, int endIndex, int* sumMiWinding,
int* maxWinding, int* sumWinding);
@@ -540,7 +527,6 @@ private:
void debugConstructQuad(SkPoint shortQuad[3]);
void debugReset();
void dumpDPts() const;
- void dumpHexPts() const;
void dumpSpan(int index) const;
const SkPoint* fPts;