summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Albert Chaulk <achaulk@google.com> 2016-11-22 13:52:43 -0500
committer Daniel Nicoara <dnicoara@google.com> 2017-01-24 10:59:40 -0500
commit6cf6af0299f7e48bc5bcdcd6a6c0f5a8725e9411 (patch)
tree9570c8effb020bad764b3e5f88339a60ea77543f /libs/gui/SurfaceComposerClient.cpp
parent146abf38c2442b77dc78a0565ad010376c9d1b69 (diff)
VR: Add API to plumb surface type and owner through to SurfaceFlinger
This is a cherry-pick of https://googleplex-android-review.git.corp.google.com/c/1648886/ Test: None Bug: None Change-Id: I338c84c2576ab85fa4f6d8e759c9e7ce912cdd61
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 58b2a8737a..3346a83f3a 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -149,6 +149,8 @@ public:
uint32_t w, uint32_t h);
status_t setLayer(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id,
uint32_t z);
+ status_t setLayerInfo(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id,
+ uint32_t type, uint32_t appid);
status_t setFlags(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id,
uint32_t flags, uint32_t mask);
status_t setTransparentRegionHint(
@@ -335,6 +337,18 @@ status_t Composer::setLayer(const sp<SurfaceComposerClient>& client,
return NO_ERROR;
}
+status_t Composer::setLayerInfo(const sp<SurfaceComposerClient>& client,
+ const sp<IBinder>& 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<SurfaceComposerClient>& client,
const sp<IBinder>& id, uint32_t flags,
uint32_t mask) {
@@ -704,6 +718,10 @@ status_t SurfaceComposerClient::setLayer(const sp<IBinder>& id, uint32_t z) {
return getComposer().setLayer(this, id, z);
}
+status_t SurfaceComposerClient::setLayerInfo(const sp<IBinder>& id, uint32_t type, uint32_t appid) {
+ return getComposer().setLayerInfo(this, id, type, appid);
+}
+
status_t SurfaceComposerClient::hide(const sp<IBinder>& id) {
return getComposer().setFlags(this, id,
layer_state_t::eLayerHidden,