summaryrefslogtreecommitdiff
path: root/libs/input/SpriteController.h
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2021-11-04 14:08:50 -0700
committer Prabir Pradhan <prabirmsp@google.com> 2021-11-11 19:58:14 +0000
commitfef0c61c9ccc1c0ca08ef4e8538d86d5e892e682 (patch)
treebf5b5494c892605f286520a02863b973df7dc79d /libs/input/SpriteController.h
parentaad5d61950046f7831cfd8b9ae9a7ad9f5fbe0e5 (diff)
SpriteController: Reparent pointer surfaces under DisplayContent
When using MediaProjection to mirror a display, only surfaces that are inside the mirrored DisplayContent's hierarcy show up in the mirror surface. Previously, since pointer icons created by SpriteController were not part of SF's hierarcy under the DisplayContent's SurfaceControl, they did not show up in the mirror surface. In this CL, we reparent pointer sprite surfaces to the the DisplayContent's SurfaceControl whenever there are surface changes, ensuring that they show up in screen recordings. Bug: 202258016 Test: manual: Start screen recording from quick settings tile Change-Id: Ib404ed36bd13b0fc8cc4a6fb593dc54b3e35dd1a
Diffstat (limited to 'libs/input/SpriteController.h')
-rw-r--r--libs/input/SpriteController.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/input/SpriteController.h b/libs/input/SpriteController.h
index 137b5646feae..2a80d9579711 100644
--- a/libs/input/SpriteController.h
+++ b/libs/input/SpriteController.h
@@ -114,7 +114,8 @@ protected:
virtual ~SpriteController();
public:
- SpriteController(const sp<Looper>& looper, int32_t overlayLayer);
+ using ParentSurfaceProvider = std::function<sp<SurfaceControl>(int /*displayId*/)>;
+ SpriteController(const sp<Looper>& looper, int32_t overlayLayer, ParentSurfaceProvider parent);
/* Creates a new sprite, initially invisible. */
virtual sp<Sprite> createSprite();
@@ -245,6 +246,7 @@ private:
sp<Looper> mLooper;
const int32_t mOverlayLayer;
sp<WeakMessageHandler> mHandler;
+ ParentSurfaceProvider mParentSurfaceProvider;
sp<SurfaceComposerClient> mSurfaceComposerClient;