diff options
author | Chris Craik <ccraik@google.com> | 2014-12-09 16:54:03 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-12-10 12:27:08 -0800 |
commit | 4ac36f80beb958c77a92a3e1a235f6ed9daaa510 (patch) | |
tree | b555302a34a4a81cb32699aa3b987536c6ab2982 /libs/hwui/DisplayList.h | |
parent | 596d4e7230ae1858aaafbae7987e46d65181f1bd (diff) | |
download | frameworks_base-4ac36f80beb958c77a92a3e1a235f6ed9daaa510.zip frameworks_base-4ac36f80beb958c77a92a3e1a235f6ed9daaa510.tar.gz frameworks_base-4ac36f80beb958c77a92a3e1a235f6ed9daaa510.tar.bz2 |
Fix frame-allocated path lifecycles
bug:18667472
Previously, we were allocating per-frame temporary paths within the
PlaybackStateStruct, but these are not safe as layers allocate these
transiently. Instead, move these to the OpenGLRenderer, which has
better define lifecycle.
Additionally, don't store SkPath objects directly in vector, since
they are then subject to relocation.
Change-Id: I8187ef542fcd5b030502bb75eb123ee26c0daa96
Diffstat (limited to 'libs/hwui/DisplayList.h')
-rw-r--r-- | libs/hwui/DisplayList.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h index cb8a8d1..7a43a2a 100644 --- a/libs/hwui/DisplayList.h +++ b/libs/hwui/DisplayList.h @@ -77,18 +77,14 @@ public: OpenGLRenderer& mRenderer; const int mReplayFlags; - // Allocator with the lifetime of a single frame. - // replay uses an Allocator owned by the struct, while defer shares the DeferredDisplayList's Allocator + // Allocator with the lifetime of a single frame. replay uses an Allocator owned by the struct, + // while defer shares the DeferredDisplayList's Allocator + // TODO: move this allocator to be owned by object with clear frame lifecycle LinearAllocator * const mAllocator; SkPath* allocPathForFrame() { - mTempPaths.push_back(); - return &mTempPaths.back(); + return mRenderer.allocPathForFrame(); } - -private: - // Paths kept alive for the duration of the frame - std::vector<SkPath> mTempPaths; }; class DeferStateStruct : public PlaybackStateStruct { |