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

Unified Diff: src/pathops/SkIntersections.h

Issue 633393002: harden pathops for pathological test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: exclude new test that asserts in debug Created 6 years, 1 month 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/SkDQuadIntersection.cpp ('k') | src/pathops/SkIntersections.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkIntersections.h
diff --git a/src/pathops/SkIntersections.h b/src/pathops/SkIntersections.h
index 040671093c38bad841e5c70397bfb15328b40a39..a1bde512db075a813facec448336968e0ca646c3 100644
--- a/src/pathops/SkIntersections.h
+++ b/src/pathops/SkIntersections.h
@@ -16,6 +16,7 @@ class SkIntersections {
public:
SkIntersections()
: fSwap(0)
+ , fFlatMeasure(false)
#ifdef SK_DEBUG
, fDepth(0)
#endif
@@ -39,6 +40,10 @@ public:
};
TArray operator[](int n) const { return TArray(fT[n]); }
+ void allowFlatMeasure(bool flatAllowed) {
+ fFlatMeasure = flatAllowed;
+ }
+
void allowNear(bool nearAllowed) {
fAllowNear = nearAllowed;
}
@@ -88,10 +93,14 @@ public:
cubic.set(a);
SkDQuad quad;
quad.set(b);
- fMax = 6;
+ fMax = 7;
return intersect(cubic, quad);
}
+ bool flatMeasure() const {
+ return fFlatMeasure;
+ }
+
bool hasT(double t) const {
SkASSERT(t == 0 || t == 1);
return fUsed > 0 && (t == 0 ? fT[0][0] == 0 : fT[0][fUsed - 1] == 1);
@@ -201,7 +210,7 @@ public:
bool swapped() const {
return fSwap;
}
-
+
int used() const {
return fUsed;
}
@@ -214,8 +223,9 @@ public:
SkASSERT(++fDepth < 16);
}
+ void alignQuadPts(const SkPoint a[3], const SkPoint b[3]);
void append(const SkIntersections& );
- void cleanUpCoincidence();
+ int cleanUpCoincidence();
int coincidentUsed() const;
void cubicInsert(double one, double two, const SkDPoint& pt, const SkDCubic& c1,
const SkDCubic& c2);
@@ -282,6 +292,7 @@ private:
unsigned char fMax;
bool fAllowNear;
bool fSwap;
+ bool fFlatMeasure; // backwards-compatibility when cubics uses quad intersection
#ifdef SK_DEBUG
int fDepth;
#endif
« no previous file with comments | « src/pathops/SkDQuadIntersection.cpp ('k') | src/pathops/SkIntersections.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698