summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayList.h
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-08-07 17:27:30 -0700
committerChris Craik <ccraik@google.com>2014-08-08 00:52:54 +0000
commit7466986d2055eb8711f36a85ac539b1572ffe805 (patch)
tree6c560d37db0e9f709e8b3114c126423ce99488fc /libs/hwui/DisplayList.h
parentf06009542390472872da986486d385001e91a2a7 (diff)
downloadframeworks_base-7466986d2055eb8711f36a85ac539b1572ffe805.zip
frameworks_base-7466986d2055eb8711f36a85ac539b1572ffe805.tar.gz
frameworks_base-7466986d2055eb8711f36a85ac539b1572ffe805.tar.bz2
Fix leak of SkPathRefs
bug:15939479 SkPath objects owned by DisplayListOps weren't being torn down, and thus weren't releasing their SkPathRef innards. Change-Id: I2581e124600a93a399ef3251f456c02ab52839a8
Diffstat (limited to 'libs/hwui/DisplayList.h')
-rw-r--r--libs/hwui/DisplayList.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index 79a2f61..acfa98e 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -69,7 +69,9 @@ class DrawRenderNodeOp;
class PlaybackStateStruct {
protected:
PlaybackStateStruct(OpenGLRenderer& renderer, int replayFlags, LinearAllocator* allocator)
- : mRenderer(renderer), mReplayFlags(replayFlags), mAllocator(allocator){}
+ : mRenderer(renderer)
+ , mReplayFlags(replayFlags)
+ , mAllocator(allocator) {}
public:
OpenGLRenderer& mRenderer;
@@ -78,6 +80,15 @@ public:
// Allocator with the lifetime of a single frame.
// replay uses an Allocator owned by the struct, while defer shares the DeferredDisplayList's Allocator
LinearAllocator * const mAllocator;
+
+ SkPath* allocPathForFrame() {
+ mTempPaths.push_back();
+ return &mTempPaths.back();
+ }
+
+private:
+ // Paths kept alive for the duration of the frame
+ std::vector<SkPath> mTempPaths;
};
class DeferStateStruct : public PlaybackStateStruct {