summaryrefslogtreecommitdiff
path: root/libs/hwui/TreeInfo.h
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2016-03-31 18:31:30 +0000
committer android-build-merger <android-build-merger@google.com> 2016-03-31 18:31:30 +0000
commit3c77e5aa9d219193ba8a8e5f33ad23e63f55d4f5 (patch)
tree1a49677d870e243f369150d7b83d2d3fcdd16fe2 /libs/hwui/TreeInfo.h
parent53418556ed61370e4980d537619eb88a71c4e932 (diff)
parentbbb4c2eb2e871977289a9c48f414962e46b56ddc (diff)
Merge "Add a callback for rendernode parentcount=0" into nyc-dev
am: bbb4c2e * commit 'bbb4c2eb2e871977289a9c48f414962e46b56ddc': Add a callback for rendernode parentcount=0 Change-Id: I8168b028ce61413da8ecea76e6531c5dde9ddb46
Diffstat (limited to 'libs/hwui/TreeInfo.h')
-rw-r--r--libs/hwui/TreeInfo.h16
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;