diff options
| author | 2013-12-15 17:10:19 -0800 | |
|---|---|---|
| committer | 2013-12-16 14:57:00 -0800 | |
| commit | ba9b613437c34873fa95800a25fc51720638267c (patch) | |
| tree | c47ac384de0306a48956ad6efaa3c5c5e51553c0 /libs/hwui/Caches.cpp | |
| parent | d83adf00ae6cb073fa0e4fbb837c2b87d824ec4f (diff) | |
Create private properties on GLCanvas for experimentation with 3d
Change-Id: I17772f61efce727cb4c1111f4d97f58c741786b8
Diffstat (limited to 'libs/hwui/Caches.cpp')
| -rw-r--r-- | libs/hwui/Caches.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index 5b751b91d384..2e7990edb78e 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -55,6 +55,7 @@ Caches::Caches(): Singleton<Caches>(), initProperties(); initStaticProperties(); initExtensions(); + initTempProperties(); mDebugLevel = readDebugLevel(); ALOGD("Enabling debug mode %d", mDebugLevel); @@ -676,5 +677,36 @@ TextureVertex* Caches::getRegionMesh() { return mRegionMesh; } +/////////////////////////////////////////////////////////////////////////////// +// Temporary Properties +/////////////////////////////////////////////////////////////////////////////// + +void Caches::initTempProperties() { + propertyDirtyViewport = false; + propertyEnable3d = false; + propertyCameraDistance = 1.0f; + propertyShadowStrength = 0x3f; +} + +void Caches::setTempProperty(const char* name, const char* value) { + ALOGD("setting property %s to %s", name, value); + if (!strcmp(name, "enable3d")) { + propertyEnable3d = !strcmp(value, "true"); + propertyDirtyViewport = true; + ALOGD("enable3d = %d", propertyEnable3d); + return; + } else if (!strcmp(name, "cameraDistance")) { + propertyCameraDistance = fmin(fmax(atof(value), 0.001), 10); + propertyDirtyViewport = true; + ALOGD("camera dist multiplier = %.2f", propertyCameraDistance); + return; + } else if (!strcmp(name, "shadowStrength")) { + propertyShadowStrength = atoi(value); + ALOGD("shadow strength = 0x%x out of 0xff", propertyShadowStrength); + return; + } + ALOGD(" failed"); +} + }; // namespace uirenderer }; // namespace android |