summaryrefslogtreecommitdiff
path: root/libs/hwui/SpotShadow.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2014-03-11 12:20:17 -0700
committer Chris Craik <ccraik@google.com> 2014-03-12 09:44:41 -0700
commitb79a3e301a8d89b9e1b1f6f3d7fd6aa56610a6f0 (patch)
tree6b92898b802b665b62127766baa87e8261569062 /libs/hwui/SpotShadow.cpp
parente361ad7ab15fcf4919a56a6293689d968ee8dcff (diff)
Fix orthographic shadows projection, simplify shadow reordering
Separate matrix passed to shadow system into two parts, one for transforming the polygon XY points (using the actual draw matrix) and a separate one which respects correct 4x4 3d rotations and translations for determining Z values. Change-Id: I7e30a84774a8709df6b2241e8f51fc5583648fe8
Diffstat (limited to 'libs/hwui/SpotShadow.cpp')
-rw-r--r--libs/hwui/SpotShadow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/SpotShadow.cpp b/libs/hwui/SpotShadow.cpp
index 54039c017f53..4e52555feff3 100644
--- a/libs/hwui/SpotShadow.cpp
+++ b/libs/hwui/SpotShadow.cpp
@@ -35,7 +35,7 @@ static const double EPSILON = 1e-7;
* Calculate the angle between and x and a y coordinate.
* The atan2 range from -PI to PI.
*/
-float angle(const Vector2& point, const Vector2& center) {
+static float angle(const Vector2& point, const Vector2& center) {
return atan2(point.y - center.y, point.x - center.x);
}
@@ -51,7 +51,7 @@ float angle(const Vector2& point, const Vector2& center) {
* @param p2 The second point defining the line segment
* @return The distance along the ray if it intersects with the line segment, negative if otherwise
*/
-float rayIntersectPoints(const Vector2& rayOrigin, float dx, float dy,
+static float rayIntersectPoints(const Vector2& rayOrigin, float dx, float dy,
const Vector2& p1, const Vector2& p2) {
// The math below is derived from solving this formula, basically the
// intersection point should stay on both the ray and the edge of (p1, p2).
@@ -550,12 +550,12 @@ void SpotShadow::computeSpotShadow(const Vector3* lightPoly, int lightPolyLength
for (int i = 0; i < polyLength; i++) {
if (poly[i].z <= 0.00001) {
inputPolyPositionValid = false;
- ALOGE("polygon below the surface");
+ ALOGW("polygon below the surface");
break;
}
if (poly[i].z >= lightPoly[0].z) {
inputPolyPositionValid = false;
- ALOGE("polygon above the light");
+ ALOGW("polygon above the light");
break;
}
}