aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/CubicKLMBench.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-06-08 13:12:02 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-09 17:13:54 +0000
commitfebbffad1c24136f041d7fc2d5ffcd50e47a047f (patch)
tree860970fa626aa0901fadce958e755c107f7c97ca /bench/CubicKLMBench.cpp
parent01b2b83aba10bc3767d660cd619c1da58b5eb0b5 (diff)
Improve cubic KLM accuracy
Moves cubic root finding logic out of GrPathUtils and PathOpsCubicIntersectionTest, and unifies it in SkGeometry. "Normalizes" the homogeneous parameter values of the roots, rather than the cubic inflection function. Does this normalization by twiddling the exponents instead of division (which causes a loss of precision). Abandons the built-in derivatives in GrCubicEffect. These don't have high enough precision on many mobile gpus. Instead we pass the KLM matrix to the vertex shader via uniform, where we can use it to set up new linear functionals from which the fragment shader can calculate the gradient of the implicit function. Bug: skia:4410 Change-Id: Ibd64e999520adc8cdef7803a492d3699995aef5a Reviewed-on: https://skia-review.googlesource.com/19017 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'bench/CubicKLMBench.cpp')
-rw-r--r--bench/CubicKLMBench.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/bench/CubicKLMBench.cpp b/bench/CubicKLMBench.cpp
index 1cdb068c08..cbf3d13ea4 100644
--- a/bench/CubicKLMBench.cpp
+++ b/bench/CubicKLMBench.cpp
@@ -22,8 +22,7 @@ public:
fPoints[3].set(x3, y3);
fName = "cubic_klm_";
- SkScalar d[4];
- switch (SkClassifyCubic(fPoints, d)) {
+ switch (SkClassifyCubic(fPoints)) {
case SkCubicType::kSerpentine:
fName.append("serp");
break;