From 62aa44c5eef2b1e888f0eee8841dc87074eaa0e8 Mon Sep 17 00:00:00 2001 From: ztenghui Date: Fri, 20 Feb 2015 10:53:22 -0800 Subject: [PATCH] Correctly name the lightRadius b/18282208 Change-Id: I5b6edcb37b710464c6ff0f5c05583bb7da720ff3 --- libs/hwui/Caches.cpp | 8 ++++---- libs/hwui/Caches.h | 2 +- libs/hwui/ShadowTessellator.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index f4fc06840bee5..d2838558d6537 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -405,7 +405,7 @@ TextureVertex* Caches::getRegionMesh() { /////////////////////////////////////////////////////////////////////////////// void Caches::initTempProperties() { - propertyLightDiameter = -1.0f; + propertyLightRadius = -1.0f; propertyLightPosY = -1.0f; propertyLightPosZ = -1.0f; propertyAmbientRatio = -1.0f; @@ -419,9 +419,9 @@ void Caches::setTempProperty(const char* name, const char* value) { propertyAmbientRatio = fmin(fmax(atof(value), 0.0), 10.0); ALOGD("ambientRatio = %.2f", propertyAmbientRatio); return; - } else if (!strcmp(name, "lightDiameter")) { - propertyLightDiameter = fmin(fmax(atof(value), 0.0), 3000.0); - ALOGD("lightDiameter = %.2f", propertyLightDiameter); + } else if (!strcmp(name, "lightRadius")) { + propertyLightRadius = fmin(fmax(atof(value), 0.0), 3000.0); + ALOGD("lightRadius = %.2f", propertyLightRadius); return; } else if (!strcmp(name, "lightPosY")) { propertyLightPosY = fmin(fmax(atof(value), 0.0), 3000.0); diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h index 18bb5e6eba1ee..92a87e2ce9b41 100644 --- a/libs/hwui/Caches.h +++ b/libs/hwui/Caches.h @@ -214,7 +214,7 @@ public: void initTempProperties(); void setTempProperty(const char* name, const char* value); - float propertyLightDiameter; + float propertyLightRadius; float propertyLightPosY; float propertyLightPosZ; float propertyAmbientRatio; diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp index ca7f48db4c2f3..9509c48038cfd 100644 --- a/libs/hwui/ShadowTessellator.cpp +++ b/libs/hwui/ShadowTessellator.cpp @@ -87,8 +87,8 @@ void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque, reverseReceiverTransform.loadInverse(receiverTransform); reverseReceiverTransform.mapPoint3d(adjustedLightCenter); - if (CC_UNLIKELY(caches.propertyLightDiameter > 0)) { - lightRadius = caches.propertyLightDiameter; + if (CC_UNLIKELY(caches.propertyLightRadius > 0)) { + lightRadius = caches.propertyLightRadius; } // Now light and caster are both in local space, we will check whether