summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderNode.h
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2016-06-16 15:36:13 -0700
committer John Reck <jreck@google.com> 2016-06-17 10:23:54 -0700
commitaa6e84f21ddf89ea649a3f00044bc23adfe86978 (patch)
treeb0654d9dfee0cfa15bad5f56835521f6191d1bc2 /libs/hwui/RenderNode.h
parent18c57b5cd546120ccbc9cce80758813244af6d37 (diff)
Move SurfaceView offscreen if the app stops drawing it
Bug: 29360411 Change-Id: Iefb9d7a9dafb34a2b4f79130a2a8b5a7cf7de906
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;