diff options
author | Jim Van Verth <jvanverth@google.com> | 2018-06-14 14:43:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-14 19:09:44 +0000 |
commit | e39bc9fd4310a3bc19ccbc24c9471977bbf536f1 (patch) | |
tree | b9521a8f8b0426d616859eedf6cda5859f5c6ce2 /src/utils | |
parent | 0510edeebf76b8a9753acc06afde8b09a8f00a54 (diff) |
Implement tilted concave ambient shadow
Bug: skia:7971
Change-Id: I6a92a5021f53ae10fb35ef355081653e96bc04b0
Reviewed-on: https://skia-review.googlesource.com/134844
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/utils')
-rwxr-xr-x | src/utils/SkShadowTessellator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/SkShadowTessellator.cpp b/src/utils/SkShadowTessellator.cpp index c50265fd42..79f8f22636 100755 --- a/src/utils/SkShadowTessellator.cpp +++ b/src/utils/SkShadowTessellator.cpp @@ -794,9 +794,9 @@ bool SkAmbientShadowTessellator::computeConcaveShadow() { SkTDArray<int> penumbraIndices; penumbraPolygon.setReserve(umbraPolygon.count()); penumbraIndices.setReserve(umbraPolygon.count()); - // TODO: handle tilt - SkScalar radius = this->offset(fTransformedHeightFunc(fPathPolygon[0])); - if (!SkOffsetSimplePolygon(&fPathPolygon[0], fPathPolygon.count(), -radius, + + auto offsetFunc = [this](const SkPoint& p) { return -this->offset(fTransformedHeightFunc(p)); }; + if (!SkOffsetSimplePolygon(&fPathPolygon[0], fPathPolygon.count(), offsetFunc, &penumbraPolygon, &penumbraIndices)) { // TODO: figure out how to handle this case return false; |