From fe94a225a556265e93b1ebfe520d3637fe7cc67d Mon Sep 17 00:00:00 2001 From: chaviw Date: Wed, 21 Aug 2019 13:52:59 -0700 Subject: [Mirror Layers] Added mirrorSurface API to enable mirroring (3/4) Added a new SurfaceComposer API called mirrorSurface that allows a client to request a mirror of a particular heirarchy starting from the passed in layer. The API will return a SurfaceControl that's the parent of the mirrored layer that can be updated by the client. Test: MirrorLayerTest Bug: 131622422 Change-Id: Ia6047f0334eabfc59d6222b2edfd4e9576ba31e5 --- libs/gui/ISurfaceComposerClient.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libs/gui/ISurfaceComposerClient.cpp') diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp index 129558bd15..b98e48b52a 100644 --- a/libs/gui/ISurfaceComposerClient.cpp +++ b/libs/gui/ISurfaceComposerClient.cpp @@ -34,7 +34,8 @@ enum class Tag : uint32_t { CREATE_WITH_SURFACE_PARENT, CLEAR_LAYER_FRAME_STATS, GET_LAYER_FRAME_STATS, - LAST = GET_LAYER_FRAME_STATS, + MIRROR_SURFACE, + LAST = MIRROR_SURFACE, }; } // Anonymous namespace @@ -80,6 +81,12 @@ public: &ISurfaceComposerClient::getLayerFrameStats)>(Tag::GET_LAYER_FRAME_STATS, handle, outStats); } + + status_t mirrorSurface(const sp& mirrorFromHandle, sp* outHandle) override { + return callRemote(Tag::MIRROR_SURFACE, + mirrorFromHandle, + outHandle); + } }; // Out-of-line virtual method definition to trigger vtable emission in this @@ -105,6 +112,8 @@ status_t BnSurfaceComposerClient::onTransact(uint32_t code, const Parcel& data, return callLocal(data, reply, &ISurfaceComposerClient::clearLayerFrameStats); case Tag::GET_LAYER_FRAME_STATS: return callLocal(data, reply, &ISurfaceComposerClient::getLayerFrameStats); + case Tag::MIRROR_SURFACE: + return callLocal(data, reply, &ISurfaceComposerClient::mirrorSurface); } } -- cgit v1.2.3-59-g8ed1b