From 1049f1246e7be4ccb68001361efceb8933e6f81c Mon Sep 17 00:00:00 2001 From: caryclark Date: Mon, 20 Apr 2015 08:31:59 -0700 Subject: Now, path ops natively intersect conics, quads, and cubics in any combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall. Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops. TBR=reed BUG=skia:3588 Review URL: https://codereview.chromium.org/1037953004 --- tests/PathOpsQuadIntersectionTest.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tests/PathOpsQuadIntersectionTest.cpp') diff --git a/tests/PathOpsQuadIntersectionTest.cpp b/tests/PathOpsQuadIntersectionTest.cpp index 0455802e3b..577d2002c0 100644 --- a/tests/PathOpsQuadIntersectionTest.cpp +++ b/tests/PathOpsQuadIntersectionTest.cpp @@ -53,6 +53,12 @@ static void standardTestCases(skiatest::Reporter* reporter) { } static const SkDQuad testSet[] = { +{{{1, 1}, {0, 2}, {3, 3}}}, +{{{3, 0}, {0, 1}, {1, 2}}}, + +{{{0.33333333333333326, 0.81481481481481488}, {0.63395173631977997, 0.68744136726313931}, {1.205684411948591, 0.81344322326274499}}}, +{{{0.33333333333333326, 0.81481481481481488}, {0.63396444791444551, 0.68743368362444768}, {1.205732763658403, 0.81345617746834109}}}, + {{{4981.9990234375, 1590}, {4981.9990234375, 1617.7523193359375}, {4962.375, 1637.3760986328125}}}, {{{4962.3759765625, 1637.3760986328125}, {4982, 1617.7523193359375}, {4982, 1590}}}, @@ -321,12 +327,12 @@ static void oneOffTest1(skiatest::Reporter* reporter, size_t outer, size_t inner SkASSERT(ValidQuad(quad1)); const SkDQuad& quad2 = testSet[inner]; SkASSERT(ValidQuad(quad2)); - SkIntersections intersections2; - intersections2.intersect(quad1, quad2); - for (int pt = 0; pt < intersections2.used(); ++pt) { - double tt1 = intersections2[0][pt]; + SkIntersections intersections; + intersections.intersect(quad1, quad2); + for (int pt = 0; pt < intersections.used(); ++pt) { + double tt1 = intersections[0][pt]; SkDPoint xy1 = quad1.ptAtT(tt1); - double tt2 = intersections2[1][pt]; + double tt2 = intersections[1][pt]; SkDPoint xy2 = quad2.ptAtT(tt2); if (!xy1.approximatelyEqual(xy2)) { SkDebugf("%s [%d,%d] x!= t1=%g (%g,%g) t2=%g (%g,%g)\n", @@ -551,7 +557,7 @@ static void QuadraticIntersection_IntersectionFinder() { } DEF_TEST(PathOpsQuadIntersectionOneOff, reporter) { - oneOffTest1(reporter, 10, 11); + oneOffTest1(reporter, 0, 1); } DEF_TEST(PathOpsQuadIntersectionCoincidenceOneOff, reporter) { -- cgit v1.2.3