summaryrefslogtreecommitdiffstats
path: root/libs/hwui/AmbientShadow.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-08-12 14:31:35 -0700
committerChris Craik <ccraik@google.com>2014-08-12 16:00:09 -0700
commit91a8c7c62913c2597e3bf5a6d59d2ed5fc7ba4e0 (patch)
tree22f6e0e41bccc3df2b4b053a5decddabe5382c95 /libs/hwui/AmbientShadow.cpp
parentddc122ee5015f9ca0cc124a53c175aadf85f50ad (diff)
downloadframeworks_base-91a8c7c62913c2597e3bf5a6d59d2ed5fc7ba4e0.zip
frameworks_base-91a8c7c62913c2597e3bf5a6d59d2ed5fc7ba4e0.tar.gz
frameworks_base-91a8c7c62913c2597e3bf5a6d59d2ed5fc7ba4e0.tar.bz2
Switch to cos interpolation of shadow alpha
bug:16852257 Updates default shadow opacities to compensate. Also, update variable/constant naming related to vertex alpha. Change-Id: I9055b4ac3c9ac305ca9d515f21b52d6aa6dc9c5c
Diffstat (limited to 'libs/hwui/AmbientShadow.cpp')
-rw-r--r--libs/hwui/AmbientShadow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp
index 181230a..9cc83ed 100644
--- a/libs/hwui/AmbientShadow.cpp
+++ b/libs/hwui/AmbientShadow.cpp
@@ -117,10 +117,13 @@ void AmbientShadow::createAmbientShadow(bool isCasterOpaque,
// inner ring of points
float opacity = 1.0 / (1 + rayHeight[rayIndex] * heightFactor);
+ // NOTE: Shadow alpha values are transformed when stored in alphavertices,
+ // so that they can be consumed directly by gFS_Main_ApplyVertexAlphaShadowInterp
+ float transformedOpacity = acos(1.0f - 2.0f * opacity);
AlphaVertex::set(&shadowVertices[rays + rayIndex],
intersection.x,
intersection.y,
- opacity);
+ transformedOpacity);
}
if (isCasterOpaque) {