aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-07-24 01:08:31 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-25 17:29:26 +0000
commit1d474dd1941bfdfec7a5a005b37ddc96482a7706 (patch)
treeb26b635b3953b6030aef0acef6927c6f17848d55 /gm
parent4014ba6ec7a7825495ac0a6ed591c5dadd30751d (diff)
Pin max curvature solutions to 0..1
Pins out-of-range solutions for cubic/quad max curvature instead of throwing them out. Code that wants to know the endpoint(s) closest to max curvature now has the information. Code not interested in these values can just ignore 0 and 1. Bug: skia: Change-Id: I8e7e2ef236b4ab963865dc049ac3e09d5396757d Reviewed-on: https://skia-review.googlesource.com/143041 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'gm')
-rw-r--r--gm/beziereffects.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index d3af3db802..dbae8693df 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -439,7 +439,7 @@ private:
// and dst[1] are the two new conics.
int split_conic(const SkPoint src[3], SkConic dst[2], const SkScalar weight) {
SkScalar t = SkFindQuadMaxCurvature(src);
- if (t == 0) {
+ if (t == 0 || t == 1) {
if (dst) {
dst[0].set(src, weight);
}