diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2015-11-04 16:57:53 -0800 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-11-05 17:35:25 -0800 |
commit | 76cb25b6f2c3891477885b66d378bcf606568352 (patch) | |
tree | a8a7872dfd00497e30e73be17fd85fd1246e09ee /libs/hwui | |
parent | 12412ce87025d41e3cd3ac3f93f8638c6dae1b32 (diff) | |
download | frameworks_base-76cb25b6f2c3891477885b66d378bcf606568352.zip frameworks_base-76cb25b6f2c3891477885b66d378bcf606568352.tar.gz frameworks_base-76cb25b6f2c3891477885b66d378bcf606568352.tar.bz2 |
When the incoming light source is invalid, don't generate any shadow
b/25417885
Change-Id: I4b87e35ca68091fd0409cb9fe9b9400af860a507
Diffstat (limited to 'libs/hwui')
-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 1bca3e7..6c8665b 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 |