diff options
author | Chris Craik <ccraik@google.com> | 2014-08-21 17:41:57 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-08-25 15:35:40 -0700 |
commit | 8afd0f245cc0c4a0366f39f41b5f78e47ee83be3 (patch) | |
tree | 220f6cac192fe822650d4676ef3996da5fb02ad9 /libs/hwui/DisplayList.h | |
parent | cc3e5d5cd197ad45e051e31fd85af28588af4cf7 (diff) |
Create z reordering boundaries around dispatchDraw
bug:16012254
This means rendernodes with a Z will no longer be drawn at the end of
their parent's DisplayList, but at the end of the associated reorder
region (DisplayListData::Chunk).
Change-Id: Ia033fee9d9a4db567b2a8d5e90fc57a4d0a64544
Diffstat (limited to 'libs/hwui/DisplayList.h')
-rw-r--r-- | libs/hwui/DisplayList.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h index acfa98e20458..dea109cd57b7 100644 --- a/libs/hwui/DisplayList.h +++ b/libs/hwui/DisplayList.h @@ -115,13 +115,24 @@ public: * Data structure that holds the list of commands used in display list stream */ class DisplayListData { + friend class DisplayListRenderer; public: + struct Chunk { + // range of included ops in DLD::displayListOps + size_t beginOpIndex; + size_t endOpIndex; + + // range of included children in DLD::mChildren + size_t beginChildIndex; + size_t endChildIndex; + + // whether children with non-zero Z in the chunk should be reordered + bool reorderChildren; + }; + DisplayListData(); ~DisplayListData(); - // allocator into which all ops were allocated - LinearAllocator allocator; - // pointers to all ops within display list, pointing into allocator data Vector<DisplayListOp*> displayListOps; @@ -138,13 +149,12 @@ public: Vector<const SkRegion*> regions; Vector<Layer*> layers; Vector<Functor*> functors; - bool hasDrawOps; - bool isEmpty() { - return !displayListOps.size(); + const Vector<Chunk>& getChunks() const { + return chunks; } - void addChild(DrawRenderNodeOp* childOp); + size_t addChild(DrawRenderNodeOp* childOp); const Vector<DrawRenderNodeOp*>& children() { return mChildren; } void refProperty(CanvasPropertyPrimitive* prop) { @@ -155,12 +165,25 @@ public: mReferenceHolders.push(prop); } + size_t getUsedSize() { + return allocator.usedSize(); + } + bool isEmpty() { + return !hasDrawOps; + } + private: Vector< sp<VirtualLightRefBase> > mReferenceHolders; // list of children display lists for quick, non-drawing traversal Vector<DrawRenderNodeOp*> mChildren; + Vector<Chunk> chunks; + + // allocator into which all ops were allocated + LinearAllocator allocator; + bool hasDrawOps; + void cleanupResources(); }; |