diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-04-15 21:58:19 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-16 16:00:35 +0000 |
commit | 6fdbf6161bcb299f855fd467ac4cdbf38c14a5cb (patch) | |
tree | e2c25b43aba155c3ad485b92dca99a2d25a9a4d3 /src/pathops | |
parent | 209a5f3bea5ea4ca22060b8e44c6f63397a1b492 (diff) |
ccpr: Normalize the cubic inflection function instead of its roots
When solving for KLM, switches back to normalizing the cubic's
inflection function rather than both individual roots. Also performs
some general code clean up for SkClassifyCubic.
Bug: skia:
Change-Id: Id513e7e02c50a8709f3eccf92fad9e5134d73d83
Reviewed-on: https://skia-review.googlesource.com/121201
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/pathops')
-rw-r--r-- | src/pathops/SkPathOpsCubic.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/pathops/SkPathOpsCubic.cpp b/src/pathops/SkPathOpsCubic.cpp index eb2ddb7c7d..8d3baa038b 100644 --- a/src/pathops/SkPathOpsCubic.cpp +++ b/src/pathops/SkPathOpsCubic.cpp @@ -253,9 +253,7 @@ int SkDCubic::ComplexBreak(const SkPoint pointsPtr[4], SkScalar* t) { case SkCubicType::kLoop: { const double &td = tt[0], &te = tt[1], &sd = ss[0], &se = ss[1]; if (roughly_between(0, td, sd) && roughly_between(0, te, se)) { - SkASSERT(roughly_between(0, td/sd, 1) && roughly_between(0, te/se, 1)); t[0] = static_cast<SkScalar>((td * se + te * sd) / (2 * sd * se)); - SkASSERT(roughly_between(0, *t, 1)); return (int) (t[0] > 0 && t[0] < 1); } } |