summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-07-24 21:41:09 -0700
committerMathias Agopian <mathias@google.com>2012-07-24 21:42:27 -0700
commit8785578391eacd4192333d7b0ce3afedd7d163e6 (patch)
tree62249d4b8556b12eede54e09c9b5a5f34f9e52ec /libs
parent8b33f032327f8de0dcc0e6d0d43ed80f834b51f6 (diff)
downloadframeworks_native-8785578391eacd4192333d7b0ce3afedd7d163e6.zip
frameworks_native-8785578391eacd4192333d7b0ce3afedd7d163e6.tar.gz
frameworks_native-8785578391eacd4192333d7b0ce3afedd7d163e6.tar.bz2
add a layerStack attribute to Layers.
this attribute can be set through a regular transaction using SurfaceComposerClient (just like any other attribute, eg: position or size) Change-Id: I701a47c677ea6442ca713728a93335328cd2b172
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 8aa0c55..4930e33 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -124,6 +124,8 @@ public:
status_t setOrientation(int orientation);
status_t setCrop(const sp<SurfaceComposerClient>& client, SurfaceID id,
const Rect& crop);
+ status_t setLayerStack(const sp<SurfaceComposerClient>& client,
+ SurfaceID id, uint32_t layerStack);
static void closeGlobalTransaction(bool synchronous) {
Composer::getInstance().closeGlobalTransactionImpl(synchronous);
@@ -255,6 +257,17 @@ status_t Composer::setAlpha(const sp<SurfaceComposerClient>& client,
return NO_ERROR;
}
+status_t Composer::setLayerStack(const sp<SurfaceComposerClient>& client,
+ SurfaceID id, uint32_t layerStack) {
+ Mutex::Autolock _l(mLock);
+ layer_state_t* s = getLayerStateLocked(client, id);
+ if (!s)
+ return BAD_INDEX;
+ s->what |= ISurfaceComposer::eLayerStackChanged;
+ s->layerStack = layerStack;
+ return NO_ERROR;
+}
+
status_t Composer::setMatrix(const sp<SurfaceComposerClient>& client,
SurfaceID id, float dsdx, float dtdx,
float dsdy, float dtdy) {
@@ -443,6 +456,10 @@ status_t SurfaceComposerClient::setAlpha(SurfaceID id, float alpha) {
return getComposer().setAlpha(this, id, alpha);
}
+status_t SurfaceComposerClient::setLayerStack(SurfaceID id, uint32_t layerStack) {
+ return getComposer().setLayerStack(this, id, layerStack);
+}
+
status_t SurfaceComposerClient::setMatrix(SurfaceID id, float dsdx, float dtdx,
float dsdy, float dtdy) {
return getComposer().setMatrix(this, id, dsdx, dtdx, dsdy, dtdy);