diff options
author | John Reck <jreck@google.com> | 2016-02-02 15:18:23 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2016-02-04 11:23:49 -0800 |
commit | f648108f83d4e74811919e9811efb8fcc184b8a3 (patch) | |
tree | a7e20b3298846cd072499a921bfa59d244c717e0 /libs/hwui/RenderNode.h | |
parent | 15d21b3aca1c3eeb3932752194e9f196b546387b (diff) |
Have RT drive window positioning
Bug: 22802885
Change-Id: I6beed5474d3a943b16e9097f7bd61ce3cbd37505
Diffstat (limited to 'libs/hwui/RenderNode.h')
-rw-r--r-- | libs/hwui/RenderNode.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h index 8e4a3df271f5..f248de54acba 100644 --- a/libs/hwui/RenderNode.h +++ b/libs/hwui/RenderNode.h @@ -209,6 +209,19 @@ public: OffscreenBuffer** getLayerHandle() { return &mLayer; } // ugh... #endif + class ANDROID_API PositionListener { + public: + virtual ~PositionListener() {} + virtual void onPositionUpdated(RenderNode& node, const TreeInfo& info) = 0; + }; + + // Note this is not thread safe, this needs to be called + // before the RenderNode is used for drawing. + // RenderNode takes ownership of the pointer + ANDROID_API void setPositionListener(PositionListener* listener) { + mPositionListener.reset(listener); + } + private: typedef key_value_pair_t<float, DrawRenderNodeOp*> ZDrawRenderNodeOpPair; @@ -317,6 +330,8 @@ private: // This is *NOT* thread-safe, and should therefore only be tracking // mDisplayList, not mStagingDisplayList. uint32_t mParentCount; + + std::unique_ptr<PositionListener> mPositionListener; }; // class RenderNode } /* namespace uirenderer */ |