diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-04-28 11:00:35 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-28 15:34:54 +0000 |
commit | b6069dfba7b7ab563a3fccb2f38307e47035300c (patch) | |
tree | e5eb0c2ff7bf5efe4d84b2a70f6439b4f6155e0b /src/utils/SkShadowTessellator.cpp | |
parent | 713b8ef3748609ee20f6005a66d6aafd02aab4b6 (diff) |
Fix fast blur for shadow rrects.
* Handles case where blur is greater than
corner radius.
* Speeds up shader by avoiding a divide.
* Tweaks shadow sample to be more MD-ish.
Bug: skia:
Change-Id: I2990357b39784c22f02a8e51872391fd68e8226a
Reviewed-on: https://skia-review.googlesource.com/14141
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/utils/SkShadowTessellator.cpp')
-rwxr-xr-x | src/utils/SkShadowTessellator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/SkShadowTessellator.cpp b/src/utils/SkShadowTessellator.cpp index 7d29b063a0..5dee5df3e0 100755 --- a/src/utils/SkShadowTessellator.cpp +++ b/src/utils/SkShadowTessellator.cpp @@ -778,7 +778,7 @@ SkSpotShadowTessellator::SkSpotShadowTessellator(const SkPath& path, const SkMat // if the umbra would collapse, we back off a bit on inner blur and adjust the alpha SkScalar newRadius = SkScalarSqrt(minDistSq) - kTolerance; fOffsetAdjust = newRadius - radius; - SkScalar ratio = 256 * newRadius / radius; + SkScalar ratio = 128 * (newRadius + radius) / radius; // they aren't PMColors, but the interpolation algorithm is the same fUmbraColor = SkPMLerp(fUmbraColor, fPenumbraColor, (unsigned)ratio); radius = newRadius; |