diff options
author | caryclark <caryclark@google.com> | 2016-09-26 11:03:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-26 11:03:54 -0700 |
commit | 414c4295f951d43068666b6294df15b2fd2ba85c (patch) | |
tree | 4a8abbb094d1cedc8eb1b2a773f6b2f3609f0576 /tests/PathOpsConicIntersectionTest.cpp | |
parent | 849f5027e9d3e27c34453966fc3471eb57e76e54 (diff) |
allow conic chop to fail
Fuzzy values may cause the conic chop to fail.
Check to see if the values are all finite, and
require the caller to do the same.
R=reed@google.com
BUG=650178
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2368993002
Review-Url: https://codereview.chromium.org/2368993002
Diffstat (limited to 'tests/PathOpsConicIntersectionTest.cpp')
-rw-r--r-- | tests/PathOpsConicIntersectionTest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/PathOpsConicIntersectionTest.cpp b/tests/PathOpsConicIntersectionTest.cpp index 624a68adaf..e22ad6bff1 100644 --- a/tests/PathOpsConicIntersectionTest.cpp +++ b/tests/PathOpsConicIntersectionTest.cpp @@ -165,7 +165,9 @@ static void chopBothWays(const SkDConic& dConic, double t, const char* name) { conic.fW = dConic.fWeight; SkConic chopped[2]; SkDConic dChopped[2]; - conic.chopAt(SkDoubleToScalar(t), chopped); + if (!conic.chopAt(SkDoubleToScalar(t), chopped)) { + return; + } dChopped[0] = dConic.subDivide(0, t); dChopped[1] = dConic.subDivide(t, 1); #if DEBUG_VISUALIZE_CONICS |