Pass surface control instead of handle as reference to layers in
LayerState
Allows us to have access to the layer id stored in surface control so that it can be dumped when tracing the transaction merges
Test: Existing tests
Change-Id: I3e466c69585937d8ce74a29a49fdbb7b3353a460
diff --git a/services/surfaceflinger/SurfaceInterceptor.cpp b/services/surfaceflinger/SurfaceInterceptor.cpp
index 4407f4c..2687313 100644
--- a/services/surfaceflinger/SurfaceInterceptor.cpp
+++ b/services/surfaceflinger/SurfaceInterceptor.cpp
@@ -472,9 +472,10 @@
}
if (state.what & layer_state_t::eDeferTransaction_legacy) {
sp<Layer> otherLayer = nullptr;
- if (state.barrierHandle_legacy != nullptr) {
- otherLayer =
- static_cast<Layer::Handle*>(state.barrierHandle_legacy.get())->owner.promote();
+ if (state.barrierSurfaceControl_legacy != nullptr) {
+ otherLayer = static_cast<Layer::Handle*>(
+ state.barrierSurfaceControl_legacy->getHandle().get())
+ ->owner.promote();
} else if (state.barrierGbp_legacy != nullptr) {
auto const& gbp = state.barrierGbp_legacy;
if (mFlinger->authenticateSurfaceTextureLocked(gbp)) {
@@ -489,17 +490,23 @@
addOverrideScalingModeLocked(transaction, layerId, state.overrideScalingMode);
}
if (state.what & layer_state_t::eReparent) {
- addReparentLocked(transaction, layerId, getLayerIdFromHandle(state.parentHandleForChild));
+ auto parentHandle = (state.parentSurfaceControlForChild)
+ ? state.parentSurfaceControlForChild->getHandle()
+ : nullptr;
+ addReparentLocked(transaction, layerId, getLayerIdFromHandle(parentHandle));
}
if (state.what & layer_state_t::eReparentChildren) {
- addReparentChildrenLocked(transaction, layerId, getLayerIdFromHandle(state.reparentHandle));
+ addReparentChildrenLocked(transaction, layerId,
+ getLayerIdFromHandle(state.reparentSurfaceControl->getHandle()));
}
if (state.what & layer_state_t::eDetachChildren) {
addDetachChildrenLocked(transaction, layerId, true);
}
if (state.what & layer_state_t::eRelativeLayerChanged) {
addRelativeParentLocked(transaction, layerId,
- getLayerIdFromHandle(state.relativeLayerHandle), state.z);
+ getLayerIdFromHandle(
+ state.relativeLayerSurfaceControl->getHandle()),
+ state.z);
}
if (state.what & layer_state_t::eShadowRadiusChanged) {
addShadowRadiusLocked(transaction, layerId, state.shadowRadius);