diff options
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 4 | ||||
| -rw-r--r-- | services/surfaceflinger/layerproto/LayerProtoParser.cpp | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index d4babdbd79..9a5173ba9b 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -2325,15 +2325,11 @@ void Layer::writeToProtoCommonState(perfetto::protos::LayerProto* layerInfo, auto parent = useDrawing ? mDrawingParent.promote() : mCurrentParent.promote(); if (parent != nullptr) { layerInfo->set_parent(parent->sequence); - } else { - layerInfo->set_parent(-1); } auto zOrderRelativeOf = state.zOrderRelativeOf.promote(); if (zOrderRelativeOf != nullptr) { layerInfo->set_z_order_relative_of(zOrderRelativeOf->sequence); - } else { - layerInfo->set_z_order_relative_of(-1); } layerInfo->set_is_relative_of(state.isRelativeOf); diff --git a/services/surfaceflinger/layerproto/LayerProtoParser.cpp b/services/surfaceflinger/layerproto/LayerProtoParser.cpp index 8d48070e13..c3d0a40261 100644 --- a/services/surfaceflinger/layerproto/LayerProtoParser.cpp +++ b/services/surfaceflinger/layerproto/LayerProtoParser.cpp @@ -193,13 +193,13 @@ void LayerProtoParser::updateChildrenAndRelative(const perfetto::protos::LayerPr } } - if (layerProto.parent() != -1) { + if (layerProto.has_parent()) { if (layerMap.count(layerProto.parent()) > 0) { currLayer->parent = layerMap[layerProto.parent()]; } } - if (layerProto.z_order_relative_of() != -1) { + if (layerProto.has_z_order_relative_of()) { if (layerMap.count(layerProto.z_order_relative_of()) > 0) { currLayer->zOrderRelativeOf = layerMap[layerProto.z_order_relative_of()]; } |