summaryrefslogtreecommitdiff
path: root/libs/hwui/SpotShadow.cpp
diff options
context:
space:
mode:
author ztenghui <ztenghui@google.com> 2014-03-18 15:58:57 -0700
committer ztenghui <ztenghui@google.com> 2014-03-18 15:58:57 -0700
commit28c3ea018771562a9150f30c6a088e5bf7502972 (patch)
tree97b9430612263de1dbd5aa67df57ced48ab51b59 /libs/hwui/SpotShadow.cpp
parent99af9429cda84ad0af1d7fcecb580295b0046882 (diff)
Get rid of useless code
Change-Id: I7fedd0df349e1d9408d58edcab25396e2ff2edd6
Diffstat (limited to 'libs/hwui/SpotShadow.cpp')
-rw-r--r--libs/hwui/SpotShadow.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/libs/hwui/SpotShadow.cpp b/libs/hwui/SpotShadow.cpp
index f81cd12d82ab..5fa0ba59efac 100644
--- a/libs/hwui/SpotShadow.cpp
+++ b/libs/hwui/SpotShadow.cpp
@@ -573,10 +573,8 @@ void SpotShadow::computeSpotShadow(bool isCasterOpaque, const Vector3* lightPoly
for (int j = 0; j < lightPolyLength; j++) {
int m = 0;
for (int i = 0; i < polyLength; i++) {
+ // After validating the input, deltaZ is guaranteed to be positive.
float deltaZ = lightPoly[j].z - poly[i].z;
- if (deltaZ == 0) {
- return;
- }
float ratioZ = lightPoly[j].z / deltaZ;
float x = lightPoly[j].x - ratioZ * (lightPoly[j].x - poly[i].x);
float y = lightPoly[j].y - ratioZ * (lightPoly[j].y - poly[i].y);
@@ -615,9 +613,6 @@ void SpotShadow::computeSpotShadow(bool isCasterOpaque, const Vector3* lightPoly
// If there is no real umbra, make a fake one.
for (int i = 0; i < polyLength; i++) {
float deltaZ = lightCenter.z - poly[i].z;
- if (deltaZ == 0) {
- return;
- }
float ratioZ = lightCenter.z / deltaZ;
float x = lightCenter.x - ratioZ * (lightCenter.x - poly[i].x);
float y = lightCenter.y - ratioZ * (lightCenter.y - poly[i].y);