aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsConic.h
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-10-20 08:32:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-20 08:32:18 -0700
commita35ab3e6e024d0b548ded26a2e3b8ecd838ead93 (patch)
treec009069f86b1129fcf5037ffc8e8fbf1b9ba010f /src/pathops/SkPathOpsConic.h
parent65820db5e15201a3f30968420232d36c0ca89cd8 (diff)
fix fuzzers
Many old pathops-related fuzz failures have built up while the codebase was under a state a flux. Now that the code is stable, address these failures. Most of the CL plumbs the debug global state to downstream routines so that, if the data is not trusted (ala fuzzed) the function can safely exit without asserting. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2426173002 Review-Url: https://chromiumcodereview.appspot.com/2426173002
Diffstat (limited to 'src/pathops/SkPathOpsConic.h')
-rw-r--r--src/pathops/SkPathOpsConic.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/pathops/SkPathOpsConic.h b/src/pathops/SkPathOpsConic.h
index 4cbe147b49..42362797a2 100644
--- a/src/pathops/SkPathOpsConic.h
+++ b/src/pathops/SkPathOpsConic.h
@@ -31,15 +31,23 @@ struct SkDConic {
fPts.debugInit();
}
+ void debugSet(const SkDPoint* pts, SkScalar weight);
+
SkDConic flip() const {
- SkDConic result = {{{fPts[2], fPts[1], fPts[0]}}, fWeight};
+ SkDConic result = {{{fPts[2], fPts[1], fPts[0]}
+ SkDEBUGPARAMS(fPts.fDebugGlobalState) }, fWeight};
return result;
}
+#ifdef SK_DEBUG
+ SkOpGlobalState* globalState() const { return fPts.globalState(); }
+#endif
+
static bool IsConic() { return true; }
- const SkDConic& set(const SkPoint pts[kPointCount], SkScalar weight) {
- fPts.set(pts);
+ const SkDConic& set(const SkPoint pts[kPointCount], SkScalar weight
+ SkDEBUGPARAMS(SkOpGlobalState* state = nullptr)) {
+ fPts.set(pts SkDEBUGPARAMS(state));
fWeight = weight;
return *this;
}
@@ -117,6 +125,7 @@ struct SkDConic {
void dump() const;
void dumpID(int id) const;
void dumpInner() const;
+
};