diff options
Diffstat (limited to 'libs/hwui/TreeInfo.h')
-rw-r--r-- | libs/hwui/TreeInfo.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/hwui/TreeInfo.h b/libs/hwui/TreeInfo.h index accd3038cb9c..a43e544b4507 100644 --- a/libs/hwui/TreeInfo.h +++ b/libs/hwui/TreeInfo.h @@ -32,6 +32,7 @@ class CanvasContext; class DamageAccumulator; class LayerUpdateQueue; class OpenGLRenderer; +class RenderNode; class RenderState; class ErrorHandler { @@ -41,6 +42,17 @@ protected: ~ErrorHandler() {} }; +class TreeObserver { +public: + // Called when a RenderNode's parent count hits 0. + // Due to the unordered nature of tree pushes, once prepareTree + // is finished it is possible that the node was "resurrected" and has + // a non-zero parent count. + virtual void onMaybeRemovedFromTree(RenderNode* node) {} +protected: + ~TreeObserver() {} +}; + // This would be a struct, but we want to PREVENT_COPY_AND_ASSIGN class TreeInfo { PREVENT_COPY_AND_ASSIGN(TreeInfo); @@ -86,6 +98,10 @@ public: #endif ErrorHandler* errorHandler = nullptr; + // Optional, may be nullptr. Used to allow things to observe interesting + // tree state changes + TreeObserver* observer = nullptr; + // Frame number for use with synchronized surfaceview position updating int64_t frameNumber = -1; int32_t windowInsetLeft = 0; |