From 4343654bc4a93812cba168a665deef0de2ebcfdd Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Thu, 13 Apr 2017 14:26:00 -0600 Subject: Improve accuracy of cubic classification - Updates the logic to reflect the Loop-Blinn paper instead of the GPU gems website. - Removes the threshold for detecting local cusps. The serpentine codepath works for these cusps anyway, so what we really want to know is whether the discriminant is negative. - Makes sure to not scale the inflection function by 1/0. - Shifts the inflection function coefficients in d[] so they match the paper. - Stores the cubic discriminant in d[0]. Bug: skia: Change-Id: I909a522a0fd27c9c8dfbc27d968bc43eeb7a416f Reviewed-on: https://skia-review.googlesource.com/13304 Reviewed-by: Greg Daniel Commit-Queue: Chris Dalton --- tests/PathOpsCubicIntersectionTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/PathOpsCubicIntersectionTest.cpp') diff --git a/tests/PathOpsCubicIntersectionTest.cpp b/tests/PathOpsCubicIntersectionTest.cpp index 638ecb008c..66becf304a 100644 --- a/tests/PathOpsCubicIntersectionTest.cpp +++ b/tests/PathOpsCubicIntersectionTest.cpp @@ -646,11 +646,11 @@ static void selfOneOff(skiatest::Reporter* reporter, int index) { c[i] = cubic.fPts[i].asSkPoint(); } SkScalar loopT[3]; - SkScalar d[3]; + SkScalar d[4]; SkCubicType cubicType = SkClassifyCubic(c, d); int breaks = SkDCubic::ComplexBreak(c, loopT); SkASSERT(breaks < 2); - if (breaks && cubicType == SkCubicType::kLoop_SkCubicType) { + if (breaks && cubicType == SkCubicType::kLoop) { SkIntersections i; SkPoint twoCubics[7]; SkChopCubicAt(c, twoCubics, loopT[0]); -- cgit v1.2.3