From 479c60c85c40fd3536b0c88036e838dc1a4c56a0 Mon Sep 17 00:00:00 2001 From: Albert Chaulk Date: Fri, 27 Jan 2017 14:21:34 -0500 Subject: Refactor how layer metadata for use by VR is propagated from WindowManager based on feedback in frameworks/base. Since windowType and ownerUid are immutable, they are sent on creation instead of separate IPC. Bug: 30984984 Test: built locally Change-Id: I380b3cdcf6aec471fc23f1e27846ab80492e8add --- libs/gui/SurfaceComposerClient.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index ece07a33fb..ae81c8fbd1 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -149,8 +149,6 @@ public: uint32_t w, uint32_t h); status_t setLayer(const sp& client, const sp& id, int32_t z); - status_t setLayerInfo(const sp& client, const sp& id, - uint32_t type, uint32_t appid); status_t setFlags(const sp& client, const sp& id, uint32_t flags, uint32_t mask); status_t setTransparentRegionHint( @@ -340,18 +338,6 @@ status_t Composer::setLayer(const sp& client, return NO_ERROR; } -status_t Composer::setLayerInfo(const sp& client, - const sp& id, uint32_t type, uint32_t appid) { - Mutex::Autolock _l(mLock); - layer_state_t* s = getLayerStateLocked(client, id); - if (!s) - return BAD_INDEX; - s->what |= layer_state_t::eLayerInfoChanged; - s->type = type; - s->appid = appid; - return NO_ERROR; -} - status_t Composer::setFlags(const sp& client, const sp& id, uint32_t flags, uint32_t mask) { @@ -636,7 +622,9 @@ sp SurfaceComposerClient::createSurface( uint32_t h, PixelFormat format, uint32_t flags, - SurfaceControl* parent) + SurfaceControl* parent, + uint32_t windowType, + uint32_t ownerUid) { sp sur; if (mStatus == NO_ERROR) { @@ -648,7 +636,7 @@ sp SurfaceComposerClient::createSurface( parentHandle = parent->getHandle(); } status_t err = mClient->createSurface(name, w, h, format, flags, parentHandle, - &handle, &gbp); + windowType, ownerUid, &handle, &gbp); ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err)); if (err == NO_ERROR) { sur = new SurfaceControl(this, handle, gbp); @@ -749,10 +737,6 @@ status_t SurfaceComposerClient::setLayer(const sp& id, int32_t z) { return getComposer().setLayer(this, id, z); } -status_t SurfaceComposerClient::setLayerInfo(const sp& id, uint32_t type, uint32_t appid) { - return getComposer().setLayerInfo(this, id, type, appid); -} - status_t SurfaceComposerClient::hide(const sp& id) { return getComposer().setFlags(this, id, layer_state_t::eLayerHidden, -- cgit v1.2.3-59-g8ed1b