Create private properties on GLCanvas for experimentation with 3d

Change-Id: I17772f61efce727cb4c1111f4d97f58c741786b8
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 5b751b9..2e7990e 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -55,6 +55,7 @@
     initProperties();
     initStaticProperties();
     initExtensions();
+    initTempProperties();
 
     mDebugLevel = readDebugLevel();
     ALOGD("Enabling debug mode %d", mDebugLevel);
@@ -676,5 +677,36 @@
     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