diff options
| author | 2023-08-29 17:59:11 +0000 | |
|---|---|---|
| committer | 2023-08-29 17:59:11 +0000 | |
| commit | 0d11430e3d4daef55e0dfb1cf5a451421c00d240 (patch) | |
| tree | adbff819ef612cb1bbe436f10792ea74339ac8b1 | |
| parent | b5224713d18ca30917c67452e9857e57769d2ddb (diff) | |
| parent | 2896bca21173662910740d6bc5c78853bdb27b1d (diff) | |
Update LayerVector if the mirrorRoot is already inside am: b8e4c135a9 am: 2896bca211
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/24558641
Change-Id: Ida07df84230bb55c563ed188c4056d15f5762073
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index ee95b1a333..cb8edc38ca 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -8471,7 +8471,13 @@ bool SurfaceFlinger::commitMirrorDisplays(VsyncId vsyncId) { // Set mirror layer's default layer stack to -1 so it doesn't end up rendered on a display // accidentally. sp<Layer> rootMirrorLayer = LayerHandle::getLayer(mirrorDisplay.rootHandle); - rootMirrorLayer->setLayerStack(ui::LayerStack::fromValue(-1)); + ssize_t idx = mCurrentState.layersSortedByZ.indexOf(rootMirrorLayer); + bool ret = rootMirrorLayer->setLayerStack(ui::LayerStack::fromValue(-1)); + if (idx >= 0 && ret) { + mCurrentState.layersSortedByZ.removeAt(idx); + mCurrentState.layersSortedByZ.add(rootMirrorLayer); + } + for (const auto& layer : mDrawingState.layersSortedByZ) { if (layer->getLayerStack() != mirrorDisplay.layerStack || layer->isInternalDisplayOverlay()) { |