OSDN Git Service

Merge "When the incoming light source is invalid, don't generate any shadow" into...
authorTenghui Zhu <ztenghui@google.com>
Thu, 5 Nov 2015 20:05:37 +0000 (20:05 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 5 Nov 2015 20:05:37 +0000 (20:05 +0000)
1  2 
libs/hwui/ShadowTessellator.cpp

@@@ -77,9 -77,14 +77,14 @@@ void ShadowTessellator::tessellateSpotS
      }
  
  #if DEBUG_SHADOW
 -    ALOGD("light center %f %f %f",
 -            adjustedLightCenter.x, adjustedLightCenter.y, adjustedLightCenter.z);
 +    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