summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PathCache.h
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-03-20 19:15:02 -0700
committerRomain Guy <romainguy@google.com>2013-03-20 19:16:53 -0700
commitc5cbee7d78513527e89450e6369a30a04b2d5e7a (patch)
treea3709dd93124509c4490b889622b277d11fbef30 /libs/hwui/PathCache.h
parent9eac52698b18d089e73c7ec2bf73a64a39504733 (diff)
downloadframeworks_base-c5cbee7d78513527e89450e6369a30a04b2d5e7a.zip
frameworks_base-c5cbee7d78513527e89450e6369a30a04b2d5e7a.tar.gz
frameworks_base-c5cbee7d78513527e89450e6369a30a04b2d5e7a.tar.bz2
Stop worker threads on memory trim & fix bad pointer access
Change-Id: I6fe7e31aeb6dd41fa65ab952caed97bc2da510d7
Diffstat (limited to 'libs/hwui/PathCache.h')
-rw-r--r--libs/hwui/PathCache.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index e6d92df..1467231 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -26,6 +26,7 @@
#include "Debug.h"
#include "Properties.h"
#include "Texture.h"
+#include "utils/Pair.h"
class SkBitmap;
class SkCanvas;
@@ -215,10 +216,6 @@ public:
PathTexture* get(SkPath* path, SkPaint* paint);
/**
- * Removes an entry.
- */
- void remove(SkPath* path);
- /**
* Removes the specified path. This is meant to be called from threads
* that are not the EGL context thread.
*/
@@ -251,6 +248,8 @@ public:
float& left, float& top, float& offset, uint32_t& width, uint32_t& height);
private:
+ typedef Pair<SkPath*, SkPath*> path_pair_t;
+
PathTexture* addTexture(const PathDescription& entry,
const SkPath *path, const SkPaint* paint);
PathTexture* addTexture(const PathDescription& entry, SkBitmap* bitmap);
@@ -261,6 +260,12 @@ private:
}
/**
+ * Removes an entry.
+ * The pair must define first=path, second=sourcePath
+ */
+ void remove(const path_pair_t& pair);
+
+ /**
* Ensures there is enough space in the cache for a texture of the specified
* dimensions.
*/
@@ -318,7 +323,8 @@ private:
bool mDebugEnabled;
sp<PathProcessor> mProcessor;
- Vector<SkPath*> mGarbage;
+
+ Vector<path_pair_t> mGarbage;
mutable Mutex mLock;
}; // class PathCache