Index: src/pathops/SkPathOpsCubic.h |
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h |
index 16bca79533198e8834f9ebf7e70d2790b3e8bb67..f868fbe2c7d8895f44f0cbf78f92c97b3268bffe 100644 |
--- a/src/pathops/SkPathOpsCubic.h |
+++ b/src/pathops/SkPathOpsCubic.h |
@@ -58,6 +58,8 @@ struct SkDCubic { |
sk_bzero(fPts, sizeof(fPts)); |
} |
+ void debugSet(const SkDPoint* pts); |
+ |
void dump() const; // callable from the debugger when the implementation code is linked in |
void dumpID(int id) const; |
void dumpInner() const; |
@@ -72,6 +74,11 @@ struct SkDCubic { |
} |
int findMaxCurvature(double tValues[]) const; |
+ |
+#ifdef SK_DEBUG |
+ SkOpGlobalState* globalState() const { return fDebugGlobalState; } |
+#endif |
+ |
bool hullIntersects(const SkDCubic& c2, bool* isLinear) const; |
bool hullIntersects(const SkDConic& c, bool* isLinear) const; |
bool hullIntersects(const SkDQuad& c2, bool* isLinear) const; |
@@ -98,11 +105,14 @@ struct SkDCubic { |
*/ |
int verticalIntersect(double xIntercept, double roots[3]) const; |
- const SkDCubic& set(const SkPoint pts[kPointCount]) { |
+// add debug only global pointer so asserts can be skipped by fuzzers |
+ const SkDCubic& set(const SkPoint pts[kPointCount] |
+ SkDEBUGPARAMS(SkOpGlobalState* state = nullptr)) { |
fPts[0] = pts[0]; |
fPts[1] = pts[1]; |
fPts[2] = pts[2]; |
fPts[3] = pts[3]; |
+ SkDEBUGCODE(fDebugGlobalState = state); |
return *this; |
} |
@@ -125,8 +135,8 @@ struct SkDCubic { |
SkDQuad toQuad() const; |
static const int gPrecisionUnit; |
- |
SkDPoint fPts[kPointCount]; |
+ SkDEBUGCODE(SkOpGlobalState* fDebugGlobalState); |
}; |
/* Given the set [0, 1, 2, 3], and two of the four members, compute an XOR mask |