Cleanup properties

bug:19967854

Separate properties from Caches, into static, RenderThread-only class.

Also rewrites the means for java to set properties to correctly handle
threading, and adds an override for profile bars so that SysUi doesn't clutter
the screen with them.

Change-Id: I6e21a96065f52b9ecc49d1a126244804ba106fa9
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp
index 30d3f41..fb28531 100644
--- a/libs/hwui/ShadowTessellator.cpp
+++ b/libs/hwui/ShadowTessellator.cpp
@@ -20,11 +20,13 @@
 #include <math.h>
 #include <utils/Log.h>
 #include <utils/Trace.h>
+#include <utils/Vector.h>
 
 #include "AmbientShadow.h"
-#include "Caches.h"
+#include "Properties.h"
 #include "ShadowTessellator.h"
 #include "SpotShadow.h"
+#include "Vector.h"
 
 namespace android {
 namespace uirenderer {
@@ -40,9 +42,8 @@
     float heightFactor = 1.0f / 128;
     const float geomFactor = 64;
 
-    Caches& caches = Caches::getInstance();
-    if (CC_UNLIKELY(caches.propertyAmbientRatio > 0.0f)) {
-        heightFactor *= caches.propertyAmbientRatio;
+    if (CC_UNLIKELY(Properties::overrideAmbientRatio > 0.0f)) {
+        heightFactor *= Properties::overrideAmbientRatio;
     }
 
     Rect ambientShadowBounds(casterBounds);
@@ -66,14 +67,12 @@
         const Rect& casterBounds, const Rect& localClip, VertexBuffer& shadowVertexBuffer) {
     ATRACE_CALL();
 
-    Caches& caches = Caches::getInstance();
-
     Vector3 adjustedLightCenter(lightCenter);
-    if (CC_UNLIKELY(caches.propertyLightPosY > 0)) {
-        adjustedLightCenter.y = - caches.propertyLightPosY; // negated since this shifts up
+    if (CC_UNLIKELY(Properties::overrideLightPosY > 0)) {
+        adjustedLightCenter.y = - Properties::overrideLightPosY; // negated since this shifts up
     }
-    if (CC_UNLIKELY(caches.propertyLightPosZ > 0)) {
-        adjustedLightCenter.z = caches.propertyLightPosZ;
+    if (CC_UNLIKELY(Properties::overrideLightPosZ > 0)) {
+        adjustedLightCenter.z = Properties::overrideLightPosZ;
     }
 
 #if DEBUG_SHADOW
@@ -87,8 +86,8 @@
     reverseReceiverTransform.loadInverse(receiverTransform);
     reverseReceiverTransform.mapPoint3d(adjustedLightCenter);
 
-    if (CC_UNLIKELY(caches.propertyLightRadius > 0)) {
-        lightRadius = caches.propertyLightRadius;
+    if (CC_UNLIKELY(Properties::overrideLightRadius > 0)) {
+        lightRadius = Properties::overrideLightRadius;
     }
 
     // Now light and caster are both in local space, we will check whether