diff options
author | caryclark <caryclark@google.com> | 2016-10-20 08:32:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-20 08:32:18 -0700 |
commit | a35ab3e6e024d0b548ded26a2e3b8ecd838ead93 (patch) | |
tree | c009069f86b1129fcf5037ffc8e8fbf1b9ba010f /tests/PathOpsConicIntersectionTest.cpp | |
parent | 65820db5e15201a3f30968420232d36c0ca89cd8 (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 'tests/PathOpsConicIntersectionTest.cpp')
-rw-r--r-- | tests/PathOpsConicIntersectionTest.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/PathOpsConicIntersectionTest.cpp b/tests/PathOpsConicIntersectionTest.cpp index e22ad6bff1..41c0acb9fd 100644 --- a/tests/PathOpsConicIntersectionTest.cpp +++ b/tests/PathOpsConicIntersectionTest.cpp @@ -16,7 +16,7 @@ manually compute the intersection of a pair of circles and see if the conic inte */ -static const SkDConic testSet[] = { +static const ConicPts testSet[] = { {{{{306.588013,-227.983994}, {212.464996,-262.242004}, {95.5512009,58.9763985}}}, 0.707107008f}, {{{{377.218994,-141.981003}, {40.578701,-201.339996}, {23.1854992,-102.697998}}}, 0.707107008f}, @@ -295,11 +295,14 @@ static void writeFrames() { } #endif -static void oneOff(skiatest::Reporter* reporter, const SkDConic& c1, const SkDConic& c2, +static void oneOff(skiatest::Reporter* reporter, const ConicPts& conic1, const ConicPts& conic2, bool coin) { #if DEBUG_VISUALIZE_CONICS writeFrames(); #endif + SkDConic c1, c2; + c1.debugSet(conic1.fPts.fPts, conic1.fWeight); + c2.debugSet(conic2.fPts.fPts, conic2.fWeight); chopBothWays(c1, 0.5, "c1"); chopBothWays(c2, 0.5, "c2"); #if DEBUG_VISUALIZE_CONICS @@ -330,8 +333,8 @@ static void oneOff(skiatest::Reporter* reporter, const SkDConic& c1, const SkDCo } static void oneOff(skiatest::Reporter* reporter, int outer, int inner) { - const SkDConic& c1 = testSet[outer]; - const SkDConic& c2 = testSet[inner]; + const ConicPts& c1 = testSet[outer]; + const ConicPts& c2 = testSet[inner]; oneOff(reporter, c1, c2, false); } |