diff options
author | John Reck <jreck@google.com> | 2016-06-17 20:20:38 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-06-17 20:20:38 +0000 |
commit | 61513724f075aa8e4a1dfc04fa15aca7f8359365 (patch) | |
tree | dfa4a411c058b7821c741b781ac3dc552c663072 /libs/hwui/RenderNode.h | |
parent | 6a06372bb97b6c3882f6146254b27c9f972f831b (diff) | |
parent | e66dedf35b940ca88ff31ebc12dfcb08026d2c94 (diff) |
Merge \"Move SurfaceView offscreen if the app stops drawing it\" into nyc-mr1-dev
am: e66dedf35b
Change-Id: I3d070161a4bdacd0cdcf2e61f026f9fffe15890e
Diffstat (limited to 'libs/hwui/RenderNode.h')
-rw-r--r-- | libs/hwui/RenderNode.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h index 5aecaa3b23e2..1eaf5d61d465 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; |