summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PathCache.h
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2015-02-12 14:10:21 -0500
committerDerek Sollenberger <djsollen@google.com>2015-03-13 08:05:55 -0400
commitee248599d49a15fc207c5aeb0b90ec263cc1d600 (patch)
treeabb62a362ef1962a3097a586b638c1d7efc93a31 /libs/hwui/PathCache.h
parent247dc6e125783b31f5c9a2cbccb34bd2ac575e6d (diff)
downloadframeworks_base-ee248599d49a15fc207c5aeb0b90ec263cc1d600.zip
frameworks_base-ee248599d49a15fc207c5aeb0b90ec263cc1d600.tar.gz
frameworks_base-ee248599d49a15fc207c5aeb0b90ec263cc1d600.tar.bz2
Refactor DisplayList path caching.
This removes dependence on SkPath ptrs that HWUI does not control the lifecycle of. This clears up some errors where the paths are not generated from Java, but rather the Skia test suites. Cherry-pick of a change that originally landed in master-skia and is dependent on a skia merge (ag/655422). Change-Id: I41b9797a2b0af5d6b4ea51891565469d4f1d832d
Diffstat (limited to 'libs/hwui/PathCache.h')
-rw-r--r--libs/hwui/PathCache.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index 7378018..23e35cb 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -118,7 +118,7 @@ struct PathDescription {
SkPathEffect* pathEffect;
union Shape {
struct Path {
- const SkPath* mPath;
+ uint32_t mGenerationID;
} path;
struct RoundRect {
float mWidth;
@@ -198,7 +198,7 @@ public:
* Removes the specified path. This is meant to be called from threads
* that are not the EGL context thread.
*/
- void removeDeferred(SkPath* path);
+ ANDROID_API void removeDeferred(const SkPath* path);
/**
* Process deferred removals.
*/
@@ -227,8 +227,6 @@ 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);
@@ -245,12 +243,6 @@ private:
}
/**
- * Removes an entry.
- * The pair must define first=path, second=sourcePath
- */
- void remove(Vector<PathDescription>& pathsToRemove, const path_pair_t& pair);
-
- /**
* Ensures there is enough space in the cache for a texture of the specified
* dimensions.
*/
@@ -279,8 +271,7 @@ private:
delete future()->get();
}
- // copied, since input path not refcounted / guaranteed to survive for duration of task
- // TODO: avoid deep copy with refcounting
+ // copied, since input path not guaranteed to survive for duration of task
const SkPath path;
// copied, since input paint may not be immutable
@@ -308,7 +299,7 @@ private:
sp<PathProcessor> mProcessor;
- Vector<path_pair_t> mGarbage;
+ Vector<uint32_t> mGarbage;
mutable Mutex mLock;
}; // class PathCache