diff options
| author | 2015-11-05 20:27:43 +0000 | |
|---|---|---|
| committer | 2015-11-05 20:27:43 +0000 | |
| commit | dfaf23f84669b2f45da892f49b2d8c07f161f7a2 (patch) | |
| tree | dafd4b92433a6b1b4e6ca504e472b823ac1a2474 | |
| parent | bab8dfd79327309c042b234316813b2c867c9a2c (diff) | |
| parent | d829ab76831a0c323f669385c54f666f8a91e4f1 (diff) | |
Merge "When the incoming light source is invalid, don\'t generate any shadow" into mnc-dr-dev am: 76d20b4a5c am: 1c7fbe0efb
am: d829ab7683
* commit 'd829ab76831a0c323f669385c54f666f8a91e4f1':
When the incoming light source is invalid, don't generate any shadow
| -rw-r--r-- | libs/hwui/ShadowTessellator.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp index 1bca3e7cb206..6c8665b50c53 100644 --- a/libs/hwui/ShadowTessellator.cpp +++ b/libs/hwui/ShadowTessellator.cpp @@ -80,6 +80,11 @@ void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque, ALOGD("light center %f %f %f %d", adjustedLightCenter.x, adjustedLightCenter.y, adjustedLightCenter.z, lightRadius); #endif + if (isnan(adjustedLightCenter.x) + || isnan(adjustedLightCenter.y) + || isnan(adjustedLightCenter.z)) { + return; + } // light position (because it's in local space) needs to compensate for receiver transform // TODO: should apply to light orientation, not just position |