diff options
author | John Reck <jreck@google.com> | 2016-03-25 14:29:48 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2016-03-31 08:36:50 -0700 |
commit | 44b49f070aafe8ad44efae87341121cce49ff11c (patch) | |
tree | d6be4f57d9b034657e69eb4bc39b2ed35cd5fb69 /libs/hwui/TreeInfo.h | |
parent | 7492e75ba3a6785c183638392f23a92950498922 (diff) |
Add a callback for rendernode parentcount=0
Bug: 27709981
Fixes: 22565656
Change-Id: I1cb4461baf9069dc4e7ca6de10d5862578c107f4
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; |