summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderNode.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/RenderNode.h')
-rw-r--r--libs/hwui/RenderNode.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index 7d42b59054ad..54fa143f9aa8 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -168,6 +168,7 @@ public:
}
ANDROID_API virtual void prepareTree(TreeInfo& info);
+ void destroyHardwareResources();
// UI thread only!
ANDROID_API void addAnimator(const sp<BaseRenderNodeAnimator>& animator);
@@ -248,6 +249,10 @@ private:
void applyLayerPropertiesToLayer(TreeInfo& info);
void prepareLayer(TreeInfo& info);
void pushLayerUpdate(TreeInfo& info);
+ void deleteDisplayListData();
+
+ void incParentRefCount() { mParentCount++; }
+ void decParentRefCount();
String8 mName;
@@ -256,6 +261,7 @@ private:
RenderProperties mStagingProperties;
bool mNeedsDisplayListDataSync;
+ // WARNING: Do not delete this directly, you must go through deleteDisplayListData()!
DisplayListData* mDisplayListData;
DisplayListData* mStagingDisplayListData;
@@ -272,6 +278,14 @@ private:
// for projection surfaces, contains a list of all children items
Vector<DrawRenderNodeOp*> mProjectedNodes;
+
+ // How many references our parent(s) have to us. Typically this should alternate
+ // between 2 and 1 (when a staging push happens we inc first then dec)
+ // When this hits 0 we are no longer in the tree, so any hardware resources
+ // (specifically Layers) should be released.
+ // This is *NOT* thread-safe, and should therefore only be tracking
+ // mDisplayListData, not mStagingDisplayListData.
+ uint32_t mParentCount;
}; // class RenderNode
} /* namespace uirenderer */