summaryrefslogtreecommitdiff
path: root/libs/hwui/DisplayList.h
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-10-16 14:23:12 -0700
committerChris Craik <ccraik@google.com>2015-10-19 11:32:28 -0700
commitb36af87f8275f4b982906f88193ec27600f2746a (patch)
treee2523b8fdff8b73761869a0075ff6ca8d455ae71 /libs/hwui/DisplayList.h
parent5419280fb325eaf52102cf543deebb95a10a0871 (diff)
Use LinearStdAllocator in DisplayList
bug:24300128 This removes most of the remaining calls to malloc when recording DisplayLists. Change-Id: If928bd53dac0f145aadc436a62759086b67da0ed
Diffstat (limited to 'libs/hwui/DisplayList.h')
-rw-r--r--libs/hwui/DisplayList.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index d32406f3d308..86796c5a5e0c 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -132,32 +132,22 @@ public:
DisplayList();
~DisplayList();
- // pointers to all ops within display list, pointing into allocator data
- std::vector<DisplayListOp*> displayListOps;
-
// index of DisplayListOp restore, after which projected descendents should be drawn
int projectionReceiveIndex;
- std::vector<const SkBitmap*> bitmapResources;
- std::vector<const SkPath*> pathResources;
- std::vector<const Res_png_9patch*> patchResources;
+ const LsaVector<Chunk>& getChunks() const { return chunks; }
+ const LsaVector<BaseOpType*>& getOps() const { return ops; }
- std::vector<std::unique_ptr<const SkPaint>> paints;
- std::vector<std::unique_ptr<const SkRegion>> regions;
- Vector<Functor*> functors;
+ const LsaVector<NodeOpType*>& getChildren() const { return children; }
- const std::vector<Chunk>& getChunks() const {
- return chunks;
- }
- const std::vector<BaseOpType*>& getOps() const {
- return ops;
- }
+ const LsaVector<const SkBitmap*>& getBitmapResources() const { return bitmapResources; }
+ const LsaVector<Functor*>& getFunctors() const { return functors; }
size_t addChild(NodeOpType* childOp);
- const std::vector<NodeOpType*>& children() { return mChildren; }
+
void ref(VirtualLightRefBase* prop) {
- mReferenceHolders.push_back(prop);
+ referenceHolders.push_back(prop);
}
size_t getUsedSize() {
@@ -168,17 +158,27 @@ public:
}
private:
- std::vector<BaseOpType*> ops;
+ // allocator into which all ops and LsaVector arrays allocated
+ LinearAllocator allocator;
+ LinearStdAllocator<void*> stdAllocator;
- std::vector< sp<VirtualLightRefBase> > mReferenceHolders;
+ LsaVector<Chunk> chunks;
+ LsaVector<BaseOpType*> ops;
- // list of children display lists for quick, non-drawing traversal
- std::vector<NodeOpType*> mChildren;
+ // list of Ops referring to RenderNode children for quick, non-drawing traversal
+ LsaVector<NodeOpType*> children;
- std::vector<Chunk> chunks;
+ // Resources - Skia objects + 9 patches referred to by this DisplayList
+ LsaVector<const SkBitmap*> bitmapResources;
+ LsaVector<const SkPath*> pathResources;
+ LsaVector<const Res_png_9patch*> patchResources;
+ LsaVector<std::unique_ptr<const SkPaint>> paints;
+ LsaVector<std::unique_ptr<const SkRegion>> regions;
+ LsaVector< sp<VirtualLightRefBase> > referenceHolders;
+
+ // List of functors
+ LsaVector<Functor*> functors;
- // allocator into which all ops were allocated
- LinearAllocator allocator;
bool hasDrawOps;
void cleanupResources();