summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderNode.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-06-17 20:13:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-06-17 20:13:20 +0000
commite66dedf35b940ca88ff31ebc12dfcb08026d2c94 (patch)
tree54c828eb6da545d41a619159fa1a4b49e4979b54 /libs/hwui/RenderNode.h
parentffaec89277c1b276e2cdd8832aea660b4fc5dc7e (diff)
parentaa6e84f21ddf89ea649a3f00044bc23adfe86978 (diff)
Merge "Move SurfaceView offscreen if the app stops drawing it" into nyc-mr1-dev
Diffstat (limited to 'libs/hwui/RenderNode.h')
-rw-r--r--libs/hwui/RenderNode.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index acdc3d835b4d..f80be5ec9ae9 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -196,7 +196,7 @@ public:
}
ANDROID_API virtual void prepareTree(TreeInfo& info);
- void destroyHardwareResources(TreeObserver* observer);
+ void destroyHardwareResources(TreeObserver* observer, TreeInfo* info = nullptr);
// UI thread only!
ANDROID_API void addAnimator(const sp<BaseRenderNodeAnimator>& animator);
@@ -228,10 +228,19 @@ public:
OffscreenBuffer** getLayerHandle() { return &mLayer; } // ugh...
#endif
+ // Note: The position callbacks are relying on the listener using
+ // the frameNumber to appropriately batch/synchronize these transactions.
+ // There is no other filtering/batching to ensure that only the "final"
+ // state called once per frame.
class ANDROID_API PositionListener {
public:
virtual ~PositionListener() {}
+ // Called when the RenderNode's position changes
virtual void onPositionUpdated(RenderNode& node, const TreeInfo& info) = 0;
+ // Called when the RenderNode no longer has a position. As in, it's
+ // no longer being drawn.
+ // Note, tree info might be null
+ virtual void onPositionLost(RenderNode& node, const TreeInfo* info) = 0;
};
// Note this is not thread safe, this needs to be called
@@ -306,7 +315,7 @@ private:
void syncProperties();
- void syncDisplayList(TreeObserver* observer);
+ void syncDisplayList(TreeInfo* info);
void prepareTreeImpl(TreeInfo& info, bool functorsNeedLayer);
void pushStagingPropertiesChanges(TreeInfo& info);
@@ -317,11 +326,11 @@ private:
#endif
void prepareLayer(TreeInfo& info, uint32_t dirtyMask);
void pushLayerUpdate(TreeInfo& info);
- void deleteDisplayList(TreeObserver* observer);
+ void deleteDisplayList(TreeObserver* observer, TreeInfo* info = nullptr);
void damageSelf(TreeInfo& info);
void incParentRefCount() { mParentCount++; }
- void decParentRefCount(TreeObserver* observer);
+ void decParentRefCount(TreeObserver* observer, TreeInfo* info = nullptr);
String8 mName;
sp<VirtualLightRefBase> mUserContext;