DisplayList optimizations and fixes.

We now use a copy of SkPaint objects to avoid having it changed from under us.
We reuse copies that have not changed. We also copy the SkMatrix every time to
avoid the same problem.

Change-Id: If3fd80698f2d43ea16d23302063e0fd8d0549027
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index 467e851..6718597 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -25,6 +25,20 @@
 namespace android {
 namespace uirenderer {
 
+///////////////////////////////////////////////////////////////////////////////
+// Defines
+///////////////////////////////////////////////////////////////////////////////
+
+// Debug
+#define DEBUG_TEXTURES 0
+
+// Debug
+#if DEBUG_TEXTURES
+    #define TEXTURE_LOGD(...) LOGD(__VA_ARGS__)
+#else
+    #define TEXTURE_LOGD(...)
+#endif
+
 /**
  * A simple LRU texture cache. The cache has a maximum size expressed in bytes.
  * Any texture added to the cache causing the cache to grow beyond the maximum