diff options
author | reed <reed@google.com> | 2015-05-12 10:28:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-12 10:28:06 -0700 |
commit | 2629697933b5cc975e45d2a45c48f803fc6cbcec (patch) | |
tree | 53730ca8354552773d93adfe7ade5f1e2bc18192 /src/effects/SkCornerPathEffect.cpp | |
parent | 39a9a5069b25aa8b9529118cfd0ece5f412fb56b (diff) |
Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
Reason for revert:
need to wait for Blink roll (and patch android)
Original issue's description:
> stop calling SkScalarDiv
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a
TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1138263002
Diffstat (limited to 'src/effects/SkCornerPathEffect.cpp')
-rw-r--r-- | src/effects/SkCornerPathEffect.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/effects/SkCornerPathEffect.cpp b/src/effects/SkCornerPathEffect.cpp index 4b81f261fe..79d4c4cbd3 100644 --- a/src/effects/SkCornerPathEffect.cpp +++ b/src/effects/SkCornerPathEffect.cpp @@ -20,12 +20,13 @@ static bool ComputeStep(const SkPoint& a, const SkPoint& b, SkScalar radius, SkPoint* step) { SkScalar dist = SkPoint::Distance(a, b); - *step = b - a; + step->set(b.fX - a.fX, b.fY - a.fY); + if (dist <= radius * 2) { - *step *= SK_ScalarHalf; + step->scale(SK_ScalarHalf); return false; } else { - *step *= radius / dist; + step->scale(SkScalarDiv(radius, dist)); return true; } } @@ -46,7 +47,6 @@ bool SkCornerPathEffect::filterPath(SkPath* dst, const SkPath& src, bool prevIsValid = true; // to avoid warnings - step.set(0, 0); moveTo.set(0, 0); firstStep.set(0, 0); lastCorner.set(0, 0); |