From 1510726d6044119fab42a887d46ba922b890531d Mon Sep 17 00:00:00 2001 From: "caryclark@google.com" Date: Fri, 8 Nov 2013 18:00:01 +0000 Subject: fix line intersection git-svn-id: http://skia.googlecode.com/svn/trunk@12197 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/PathOpsLineIntersectionTest.cpp | 2 ++ tests/PathOpsSkpTest.cpp | 49 +++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) (limited to 'tests') diff --git a/tests/PathOpsLineIntersectionTest.cpp b/tests/PathOpsLineIntersectionTest.cpp index f37a5091b4..9934731f7e 100644 --- a/tests/PathOpsLineIntersectionTest.cpp +++ b/tests/PathOpsLineIntersectionTest.cpp @@ -11,6 +11,8 @@ // FIXME: add tests for intersecting, non-intersecting, degenerate, coincident static const SkDLine tests[][2] = { + {{{{30,20}, {30,50}}}, {{{24,30}, {36,30}}}}, + {{{{323,193}, {-317,193}}}, {{{0,994}, {0,0}}}}, {{{{90,230}, {160,60}}}, {{{60,120}, {260,120}}}}, {{{{90,230}, {160,60}}}, {{{181.176468,120}, {135.294128,120}}}}, {{{{181.1764678955078125f, 120}, {186.3661956787109375f, 134.7042236328125f}}}, diff --git a/tests/PathOpsSkpTest.cpp b/tests/PathOpsSkpTest.cpp index 6e7c7ace92..4d6d3bfb69 100755 --- a/tests/PathOpsSkpTest.cpp +++ b/tests/PathOpsSkpTest.cpp @@ -1549,10 +1549,59 @@ static void skpgithub_io_26(skiatest::Reporter* reporter) { testPathOp(reporter, path, pathB, kIntersect_PathOp); } +static void skpskpicture14(skiatest::Reporter* reporter) { + SkPath path; + path.setFillType(SkPath::kEvenOdd_FillType); + path.moveTo(0, 994); + path.lineTo(0, 0); + path.lineTo(512, 0); + path.lineTo(512, 994); + path.lineTo(0, 994); + path.close(); + SkPath pathB; + pathB.setFillType(SkPath::kWinding_FillType); + pathB.moveTo(-317, 168); + pathB.quadTo(-317, 166.757385f, -316.121338f, 165.878662f); + pathB.quadTo(-315.242645f, 165, -314, 165); + pathB.lineTo(320, 165); + pathB.quadTo(321.242615f, 165, 322.121338f, 165.878662f); + pathB.quadTo(323, 166.757385f, 323, 168); + pathB.lineTo(323, 193); + pathB.lineTo(-317, 193); + pathB.close(); + testPathOp(reporter, path, pathB, kIntersect_PathOp); +} + +static void skpskpicture15(skiatest::Reporter* reporter) { + SkPath path; + path.setFillType(SkPath::kEvenOdd_FillType); + path.moveTo(0, 193); + path.lineTo(323, 193); + path.lineTo(323, 168); + path.quadTo(323, 166.757385f, 322.121338f, 165.878662f); + path.quadTo(321.242615f, 165, 320, 165); + path.lineTo(0, 165); + path.lineTo(0, 193); + path.close(); + SkPath pathB; + pathB.setFillType(SkPath::kInverseWinding_FillType); + pathB.moveTo(-314, 165); + pathB.lineTo(320, 165); + pathB.cubicTo(321.65686f, 165, 323, 166.34314f, 323, 168); + pathB.lineTo(323, 192); + pathB.lineTo(-317, 192); + pathB.lineTo(-317, 168); + pathB.cubicTo(-317, 166.34314f, -315.65686f, 165, -314, 165); + pathB.close(); + testPathOp(reporter, path, pathB, kIntersect_PathOp); +} + static void (*firstTest)(skiatest::Reporter* ) = 0; static struct TestDesc tests[] = { + TEST(skpskpicture14), #if TRY_SEPT_BROKEN_TESTS + TEST(skpskpicture15), TEST(skpwww_meb_gov_tr_6), TEST(skpwww_sciality_com_101), TEST(skpwww_booking_com_68), // similar to lavoixdunord -- cgit v1.2.3