Improve accuracy of cubic classification
authorChris Dalton <csmartdalton@google.com>
Thu, 13 Apr 2017 20:26:00 +0000 (14:26 -0600)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 14 Apr 2017 15:14:11 +0000 (15:14 +0000)
commit4343654bc4a93812cba168a665deef0de2ebcfdd
treebee82de71d4671febf21ba1c13c2f312cbd2f8de
parent028c3d77ea0e49982e92c6c9614cf59d687f4370
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 <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
bench/CubicKLMBench.cpp
src/core/SkGeometry.cpp
src/core/SkGeometry.h
src/gpu/GrPathUtils.cpp
src/pathops/SkPathOpsCubic.cpp
tests/PathOpsCubicIntersectionTest.cpp