Property support for light positioning.
Tune up the light size to make it look better.
Change-Id: I139a05f3dd53dacbe55759b91188f0e1cc2c7f80
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 2e7990e..8bd9de0 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -686,6 +686,10 @@
propertyEnable3d = false;
propertyCameraDistance = 1.0f;
propertyShadowStrength = 0x3f;
+
+ propertyLightPosXScale = 0.5f;
+ propertyLightPosYScale = 0.0f;
+ propertyLightPosZScale = 1.0f;
}
void Caches::setTempProperty(const char* name, const char* value) {
@@ -704,6 +708,21 @@
propertyShadowStrength = atoi(value);
ALOGD("shadow strength = 0x%x out of 0xff", propertyShadowStrength);
return;
+ } else if (!strcmp(name, "lightPosXScale")) {
+ propertyLightPosXScale = fmin(fmax(atof(value), 0.0), 1.0);
+ propertyDirtyViewport = true;
+ ALOGD("lightPos X Scale = %.2f", propertyLightPosXScale);
+ return;
+ } else if (!strcmp(name, "lightPosYScale")) {
+ propertyLightPosYScale = fmin(fmax(atof(value), 0.0), 1.0);
+ propertyDirtyViewport = true;
+ ALOGD("lightPos Y Scale = %.2f", propertyLightPosXScale);
+ return;
+ } else if (!strcmp(name, "lightPosZScale")) {
+ propertyLightPosZScale = fmin(fmax(atof(value), 0.0), 1.0);
+ propertyDirtyViewport = true;
+ ALOGD("lightPos Z Scale = %.2f", propertyLightPosXScale);
+ return;
}
ALOGD(" failed");
}