aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsOpTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-08-18 07:12:43 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-18 07:12:44 -0700
commit94c902e63d77641cadd76155c2b248d04f63b560 (patch)
treebe27444690e07e19d1faadeaa2ea4017fafe3f49 /tests/PathOpsOpTest.cpp
parentf82c13fced695e0f1c0bb1760374ab1d77cd4026 (diff)
fix pathops fuzz failures
If a curve has the identical start and control points, the initial or final tangent can't be trivally determined. The perpendicular to the tangent is used to measure coincidence. Add logic for cubics, quadratics, and conics, to use the secondary control points or the end points if the initial control point alone can't determine the tangent. Add debugging (currently untriggered by exhaustive testing) to detect zero-length tangents which are not at the curve endpoints. Increase the number of temporary intersecions gathered from 10 to 12 but reduce the max passed in by cubic intersection from 27 to 12. Also, add checks if the max passed exceeds the storage allocated. When cleaning up parallel lines, choose the intersection which is on the end of both segments over the intersection which is on the end of a single segment. TBR=reed@google.com BUG=425140,516266 Review URL: https://codereview.chromium.org/1288863004
Diffstat (limited to 'tests/PathOpsOpTest.cpp')
-rw-r--r--tests/PathOpsOpTest.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 637bd042d2..fbe0116eb5 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -5153,13 +5153,25 @@ static void cubics45u(skiatest::Reporter* reporter, const char* filename) {
testPathOp(reporter, path, pathB, kUnion_SkPathOp, filename);
}
+static void fuzz38(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path, pathB;
+ path.moveTo(100.34f, 303.312f);
+ path.lineTo(-1e+08, 303.312f);
+ path.lineTo(102, 310.156f);
+ path.lineTo(100.34f, 310.156f);
+ path.lineTo(100.34f, 303.312f);
+ path.close();
+ testPathOpCheck(reporter, path, pathB, kUnion_SkPathOp, filename, FLAGS_runFail);
+}
+
static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
-static void (*firstTest)(skiatest::Reporter* , const char* filename) = loops63i;
+static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
#define TEST(name) { name, #name }
static struct TestDesc tests[] = {
+ TEST(fuzz38),
TEST(cubics44d),
TEST(cubics45u),
TEST(loops61i),