commit | 3c8ae888b9d439640a8ebc461696e21c43c40a26 | [log] [tgz] |
---|---|---|
author | Jim Van Verth <jvanverth@google.com> | Thu Jul 15 17:53:16 2021 +0000 |
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Thu Jul 15 17:53:35 2021 +0000 |
tree | 8fc99e56042819e38057eef2ac16deac6c23aad7 | |
parent | 6789b824015373104bc3282c971e435a9f542f59 [diff] [blame] |
Revert "Fix directional shadows." This reverts commit 6789b824015373104bc3282c971e435a9f542f59. Reason for revert: Failing CK test. Original change's description: > Fix directional shadows. > > The xy offset calculation for drawShadow was not quite correct. Rather > than normalizing the light vector and using the xy values of that as the > base offset value, we should scale the light vector by 1/z. > > See https://github.com/flutter/engine/pull/27124#issuecomment-880182653 > for more detail. > > Bug: skia:10781 > Change-Id: Ib69a313cb96a532f8d89644e3d69f666a184e897 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428880 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com Change-Id: Id22c2113fc1b62109975b83a0dcda5b1b16380a8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:10781 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428977 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/utils/SkShadowUtils.cpp b/src/utils/SkShadowUtils.cpp index f433821..5a32ec4 100644 --- a/src/utils/SkShadowUtils.cpp +++ b/src/utils/SkShadowUtils.cpp
@@ -664,7 +664,9 @@ SkPoint3 zPlaneParams = rec.fZPlaneParams; SkPoint3 devLightPos = rec.fLightPos; - if (!directional) { + if (directional) { + devLightPos.normalize(); + } else { viewMatrix.mapPoints((SkPoint*)&devLightPos.fX, 1); } float lightRadius = rec.fLightRadius;