summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/LayerBase.cpp10
-rw-r--r--services/surfaceflinger/LayerBase.h4
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp4
3 files changed, 17 insertions, 1 deletions
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index f4eebb2..f654445 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -77,6 +77,7 @@ void LayerBase::initStates(uint32_t w, uint32_t h, uint32_t flags)
mCurrentState.active.crop.makeInvalid();
mCurrentState.z = 0;
mCurrentState.alpha = 0xFF;
+ mCurrentState.layerStack = 0;
mCurrentState.flags = layerFlags;
mCurrentState.sequence = 0;
mCurrentState.transform.set(0, 0);
@@ -169,6 +170,15 @@ bool LayerBase::setCrop(const Rect& crop) {
return true;
}
+bool LayerBase::setLayerStack(uint32_t layerStack) {
+ if (mCurrentState.layerStack == layerStack)
+ return false;
+ mCurrentState.sequence++;
+ mCurrentState.layerStack = layerStack;
+ requestTransaction();
+ return true;
+}
+
void LayerBase::setVisibleRegion(const Region& visibleRegion) {
// always called from main thread
this->visibleRegion = visibleRegion;
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index 80bc4c3..aeafe4f 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -79,6 +79,7 @@ public:
Geometry active;
Geometry requested;
uint32_t z;
+ uint32_t layerStack;
uint8_t alpha;
uint8_t flags;
uint8_t reserved[2];
@@ -113,7 +114,8 @@ public:
bool setTransparentRegionHint(const Region& opaque);
bool setFlags(uint8_t flags, uint8_t mask);
bool setCrop(const Rect& crop);
-
+ bool setLayerStack(uint32_t layerStack);
+
void commitTransaction();
bool requestTransaction();
void forceVisibilityTransaction();
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 8da2543..b70c720 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1572,6 +1572,10 @@ uint32_t SurfaceFlinger::setClientStateLocked(
if (layer->setCrop(s.crop))
flags |= eTraversalNeeded;
}
+ if (what & eLayerStackChanged) {
+ if (layer->setLayerStack(s.layerStack))
+ flags |= eTraversalNeeded;
+ }
}
return flags;
}