diff options
| author | 2014-01-17 10:34:10 -0800 | |
|---|---|---|
| committer | 2014-01-17 13:42:09 -0800 | |
| commit | cc3c25622c731d14a6f01bce684330eccba7db5a (patch) | |
| tree | 6e35c1358b88c77410f066f309590a0e87bc023b /libs/hwui/Caches.cpp | |
| parent | 3a3bdd042d8bd056d31a1b37332e91c1307060a0 (diff) | |
Property support for light positioning.
Tune up the light size to make it look better.
Change-Id: I139a05f3dd53dacbe55759b91188f0e1cc2c7f80
Diffstat (limited to 'libs/hwui/Caches.cpp')
| -rw-r--r-- | libs/hwui/Caches.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index 2e7990edb78e..8bd9de074152 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -686,6 +686,10 @@ void Caches::initTempProperties() { 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 @@ void Caches::setTempProperty(const char* name, const char* value) { 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"); } |