Purge Skia objects from GL caches as needed.

Change-Id: I754c671cf790ad5ae8bf047ad328034217da4ecc
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index 522e5e0..bde0e7d 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -114,6 +114,10 @@
      * Clears the cache. This causes all textures to be deleted.
      */
     void clear();
+    /**
+     * Removes an entry.
+     */
+    void remove(SkPath* path);
 
     /**
      * Sets the maximum size of the cache in bytes.
@@ -143,6 +147,12 @@
     uint32_t mSize;
     uint32_t mMaxSize;
     GLuint mMaxTextureSize;
+
+    /**
+     * Used to access mCache and mSize. All methods are accessed from a single
+     * thread except for remove().
+     */
+    mutable Mutex mLock;
 }; // class PathCache
 
 }; // namespace uirenderer