blob: ab4c15d670f01b506c3ade58849a71a2057f731c [file] [log] [blame]
Vishnu Nair04f89692022-11-16 23:21:05 +00001/*
2 * Copyright 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define ATRACE_TAG ATRACE_TAG_GRAPHICS
18#undef LOG_TAG
Vishnu Naira02943f2023-06-03 13:44:46 -070019#define LOG_TAG "SurfaceFlinger"
Vishnu Nair04f89692022-11-16 23:21:05 +000020
21#include "LayerHierarchy.h"
Vishnu Nair80a5a702023-02-11 01:21:51 +000022#include "LayerLog.h"
Vishnu Nair04f89692022-11-16 23:21:05 +000023#include "SwapErase.h"
24
25namespace android::surfaceflinger::frontend {
26
27namespace {
28auto layerZCompare = [](const std::pair<LayerHierarchy*, LayerHierarchy::Variant>& lhs,
29 const std::pair<LayerHierarchy*, LayerHierarchy::Variant>& rhs) {
30 auto lhsLayer = lhs.first->getLayer();
31 auto rhsLayer = rhs.first->getLayer();
Vishnu Naircfb2d252023-01-19 04:44:02 +000032 if (lhsLayer->layerStack.id != rhsLayer->layerStack.id) {
Vishnu Nair444f3952023-04-11 13:01:02 -070033 return lhsLayer->layerStack.id < rhsLayer->layerStack.id;
Vishnu Nair04f89692022-11-16 23:21:05 +000034 }
35 if (lhsLayer->z != rhsLayer->z) {
36 return lhsLayer->z < rhsLayer->z;
37 }
38 return lhsLayer->id < rhsLayer->id;
39};
40
41void insertSorted(std::vector<std::pair<LayerHierarchy*, LayerHierarchy::Variant>>& vec,
42 std::pair<LayerHierarchy*, LayerHierarchy::Variant> value) {
43 auto it = std::upper_bound(vec.begin(), vec.end(), value, layerZCompare);
44 vec.insert(it, std::move(value));
45}
46} // namespace
47
48LayerHierarchy::LayerHierarchy(RequestedLayerState* layer) : mLayer(layer) {}
49
50LayerHierarchy::LayerHierarchy(const LayerHierarchy& hierarchy, bool childrenOnly) {
51 mLayer = (childrenOnly) ? nullptr : hierarchy.mLayer;
52 mChildren = hierarchy.mChildren;
53}
54
55void LayerHierarchy::traverse(const Visitor& visitor,
56 LayerHierarchy::TraversalPath& traversalPath) const {
57 if (mLayer) {
58 bool breakTraversal = !visitor(*this, traversalPath);
59 if (breakTraversal) {
60 return;
61 }
62 }
63 if (traversalPath.hasRelZLoop()) {
64 LOG_ALWAYS_FATAL("Found relative z loop layerId:%d", traversalPath.invalidRelativeRootId);
65 }
66 for (auto& [child, childVariant] : mChildren) {
67 ScopedAddToTraversalPath addChildToTraversalPath(traversalPath, child->mLayer->id,
68 childVariant);
69 child->traverse(visitor, traversalPath);
70 }
71}
72
73void LayerHierarchy::traverseInZOrder(const Visitor& visitor,
74 LayerHierarchy::TraversalPath& traversalPath) const {
75 bool traverseThisLayer = (mLayer != nullptr);
76 for (auto it = mChildren.begin(); it < mChildren.end(); it++) {
77 auto& [child, childVariant] = *it;
78 if (traverseThisLayer && child->getLayer()->z >= 0) {
Vishnu Naircfb2d252023-01-19 04:44:02 +000079 traverseThisLayer = false;
Vishnu Nair04f89692022-11-16 23:21:05 +000080 bool breakTraversal = !visitor(*this, traversalPath);
81 if (breakTraversal) {
82 return;
83 }
Vishnu Nair04f89692022-11-16 23:21:05 +000084 }
85 if (childVariant == LayerHierarchy::Variant::Detached) {
86 continue;
87 }
88 ScopedAddToTraversalPath addChildToTraversalPath(traversalPath, child->mLayer->id,
89 childVariant);
90 child->traverseInZOrder(visitor, traversalPath);
91 }
92
93 if (traverseThisLayer) {
94 visitor(*this, traversalPath);
95 }
96}
97
98void LayerHierarchy::addChild(LayerHierarchy* child, LayerHierarchy::Variant variant) {
99 insertSorted(mChildren, {child, variant});
100}
101
102void LayerHierarchy::removeChild(LayerHierarchy* child) {
103 auto it = std::find_if(mChildren.begin(), mChildren.end(),
104 [child](const std::pair<LayerHierarchy*, Variant>& x) {
105 return x.first == child;
106 });
107 if (it == mChildren.end()) {
108 LOG_ALWAYS_FATAL("Could not find child!");
109 }
110 mChildren.erase(it);
111}
112
113void LayerHierarchy::sortChildrenByZOrder() {
114 std::sort(mChildren.begin(), mChildren.end(), layerZCompare);
115}
116
117void LayerHierarchy::updateChild(LayerHierarchy* hierarchy, LayerHierarchy::Variant variant) {
118 auto it = std::find_if(mChildren.begin(), mChildren.end(),
119 [hierarchy](std::pair<LayerHierarchy*, Variant>& child) {
120 return child.first == hierarchy;
121 });
122 if (it == mChildren.end()) {
123 LOG_ALWAYS_FATAL("Could not find child!");
124 } else {
125 it->second = variant;
126 }
127}
128
129const RequestedLayerState* LayerHierarchy::getLayer() const {
130 return mLayer;
131}
132
Vishnu Nairea6ff812023-02-27 17:41:39 +0000133const LayerHierarchy* LayerHierarchy::getRelativeParent() const {
134 return mRelativeParent;
135}
136
137const LayerHierarchy* LayerHierarchy::getParent() const {
138 return mParent;
139}
140
Vishnu Nair04f89692022-11-16 23:21:05 +0000141std::string LayerHierarchy::getDebugStringShort() const {
142 std::string debug = "LayerHierarchy{";
Vishnu Nair8fc721b2022-12-22 20:06:32 +0000143 debug += ((mLayer) ? mLayer->getDebugString() : "root") + " ";
Vishnu Nair04f89692022-11-16 23:21:05 +0000144 if (mChildren.empty()) {
145 debug += "no children";
146 } else {
147 debug += std::to_string(mChildren.size()) + " children";
148 }
149 return debug + "}";
150}
151
Vishnu Nair3cc15a42023-06-30 06:20:22 +0000152void LayerHierarchy::dump(std::ostream& out, const std::string& prefix,
153 LayerHierarchy::Variant variant, bool isLastChild) const {
154 if (!mLayer) {
155 out << " ROOT";
156 } else {
157 out << prefix + (isLastChild ? "└─ " : "├─ ");
158 if (variant == LayerHierarchy::Variant::Relative) {
159 out << "(Relative) ";
160 } else if (variant == LayerHierarchy::Variant::Mirror) {
161 out << "(Mirroring) " << *mLayer << "\n" + prefix + " └─ ...";
162 return;
163 }
164 out << *mLayer;
Vishnu Nair04f89692022-11-16 23:21:05 +0000165 }
Vishnu Nair3cc15a42023-06-30 06:20:22 +0000166
167 for (size_t i = 0; i < mChildren.size(); i++) {
168 auto& [child, childVariant] = mChildren[i];
169 if (childVariant == LayerHierarchy::Variant::Detached) continue;
170 const bool lastChild = i == (mChildren.size() - 1);
171 std::string childPrefix = prefix;
172 if (mLayer) {
173 childPrefix += (isLastChild ? " " : "│ ");
174 }
175 out << "\n";
176 child->dump(out, childPrefix, childVariant, lastChild);
177 }
178 return;
Vishnu Nair04f89692022-11-16 23:21:05 +0000179}
180
181bool LayerHierarchy::hasRelZLoop(uint32_t& outInvalidRelativeRoot) const {
182 outInvalidRelativeRoot = UNASSIGNED_LAYER_ID;
183 traverse([&outInvalidRelativeRoot](const LayerHierarchy&,
184 const LayerHierarchy::TraversalPath& traversalPath) -> bool {
185 if (traversalPath.hasRelZLoop()) {
186 outInvalidRelativeRoot = traversalPath.invalidRelativeRootId;
187 return false;
188 }
189 return true;
190 });
191 return outInvalidRelativeRoot != UNASSIGNED_LAYER_ID;
192}
193
194LayerHierarchyBuilder::LayerHierarchyBuilder(
195 const std::vector<std::unique_ptr<RequestedLayerState>>& layers) {
196 mHierarchies.reserve(layers.size());
197 mLayerIdToHierarchy.reserve(layers.size());
198 for (auto& layer : layers) {
199 mHierarchies.emplace_back(std::make_unique<LayerHierarchy>(layer.get()));
200 mLayerIdToHierarchy[layer->id] = mHierarchies.back().get();
201 }
202 for (const auto& layer : layers) {
203 onLayerAdded(layer.get());
204 }
205 detachHierarchyFromRelativeParent(&mOffscreenRoot);
206}
207
208void LayerHierarchyBuilder::attachToParent(LayerHierarchy* hierarchy) {
209 auto layer = hierarchy->mLayer;
210 LayerHierarchy::Variant type = layer->hasValidRelativeParent()
211 ? LayerHierarchy::Variant::Detached
212 : LayerHierarchy::Variant::Attached;
213
214 LayerHierarchy* parent;
215
216 if (layer->parentId != UNASSIGNED_LAYER_ID) {
217 parent = getHierarchyFromId(layer->parentId);
218 } else if (layer->canBeRoot) {
219 parent = &mRoot;
220 } else {
221 parent = &mOffscreenRoot;
222 }
223 parent->addChild(hierarchy, type);
224 hierarchy->mParent = parent;
225}
226
227void LayerHierarchyBuilder::detachFromParent(LayerHierarchy* hierarchy) {
228 hierarchy->mParent->removeChild(hierarchy);
229 hierarchy->mParent = nullptr;
230}
231
232void LayerHierarchyBuilder::attachToRelativeParent(LayerHierarchy* hierarchy) {
233 auto layer = hierarchy->mLayer;
234 if (!layer->hasValidRelativeParent() || hierarchy->mRelativeParent) {
235 return;
236 }
237
238 if (layer->relativeParentId != UNASSIGNED_LAYER_ID) {
239 hierarchy->mRelativeParent = getHierarchyFromId(layer->relativeParentId);
240 } else {
241 hierarchy->mRelativeParent = &mOffscreenRoot;
242 }
243 hierarchy->mRelativeParent->addChild(hierarchy, LayerHierarchy::Variant::Relative);
244 hierarchy->mParent->updateChild(hierarchy, LayerHierarchy::Variant::Detached);
245}
246
247void LayerHierarchyBuilder::detachFromRelativeParent(LayerHierarchy* hierarchy) {
248 if (hierarchy->mRelativeParent) {
249 hierarchy->mRelativeParent->removeChild(hierarchy);
250 }
251 hierarchy->mRelativeParent = nullptr;
252 hierarchy->mParent->updateChild(hierarchy, LayerHierarchy::Variant::Attached);
253}
254
255void LayerHierarchyBuilder::attachHierarchyToRelativeParent(LayerHierarchy* root) {
256 if (root->mLayer) {
257 attachToRelativeParent(root);
258 }
259 for (auto& [child, childVariant] : root->mChildren) {
260 if (childVariant == LayerHierarchy::Variant::Detached ||
261 childVariant == LayerHierarchy::Variant::Attached) {
262 attachHierarchyToRelativeParent(child);
263 }
264 }
265}
266
267void LayerHierarchyBuilder::detachHierarchyFromRelativeParent(LayerHierarchy* root) {
268 if (root->mLayer) {
269 detachFromRelativeParent(root);
270 }
271 for (auto& [child, childVariant] : root->mChildren) {
272 if (childVariant == LayerHierarchy::Variant::Detached ||
273 childVariant == LayerHierarchy::Variant::Attached) {
274 detachHierarchyFromRelativeParent(child);
275 }
276 }
277}
278
279void LayerHierarchyBuilder::onLayerAdded(RequestedLayerState* layer) {
280 LayerHierarchy* hierarchy = getHierarchyFromId(layer->id);
281 attachToParent(hierarchy);
282 attachToRelativeParent(hierarchy);
283
Vishnu Naira9c43762023-01-27 19:10:25 +0000284 for (uint32_t mirrorId : layer->mirrorIds) {
285 LayerHierarchy* mirror = getHierarchyFromId(mirrorId);
Vishnu Nair04f89692022-11-16 23:21:05 +0000286 hierarchy->addChild(mirror, LayerHierarchy::Variant::Mirror);
287 }
288}
289
290void LayerHierarchyBuilder::onLayerDestroyed(RequestedLayerState* layer) {
Vishnu Nair80a5a702023-02-11 01:21:51 +0000291 LLOGV(layer->id, "");
Vishnu Nair04f89692022-11-16 23:21:05 +0000292 LayerHierarchy* hierarchy = getHierarchyFromId(layer->id, /*crashOnFailure=*/false);
293 if (!hierarchy) {
294 // Layer was never part of the hierarchy if it was created and destroyed in the same
295 // transaction.
296 return;
297 }
298 // detach from parent
299 detachFromRelativeParent(hierarchy);
300 detachFromParent(hierarchy);
301
302 // detach children
303 for (auto& [child, variant] : hierarchy->mChildren) {
304 if (variant == LayerHierarchy::Variant::Attached ||
305 variant == LayerHierarchy::Variant::Detached) {
306 mOffscreenRoot.addChild(child, LayerHierarchy::Variant::Attached);
307 child->mParent = &mOffscreenRoot;
308 } else if (variant == LayerHierarchy::Variant::Relative) {
309 mOffscreenRoot.addChild(child, LayerHierarchy::Variant::Attached);
310 child->mRelativeParent = &mOffscreenRoot;
311 }
312 }
313
314 swapErase(mHierarchies, [hierarchy](std::unique_ptr<LayerHierarchy>& layerHierarchy) {
315 return layerHierarchy.get() == hierarchy;
316 });
317 mLayerIdToHierarchy.erase(layer->id);
318}
319
320void LayerHierarchyBuilder::updateMirrorLayer(RequestedLayerState* layer) {
321 LayerHierarchy* hierarchy = getHierarchyFromId(layer->id);
322 auto it = hierarchy->mChildren.begin();
323 while (it != hierarchy->mChildren.end()) {
324 if (it->second == LayerHierarchy::Variant::Mirror) {
Vishnu Naira9c43762023-01-27 19:10:25 +0000325 it = hierarchy->mChildren.erase(it);
326 } else {
327 it++;
Vishnu Nair04f89692022-11-16 23:21:05 +0000328 }
Vishnu Nair04f89692022-11-16 23:21:05 +0000329 }
330
Vishnu Naira9c43762023-01-27 19:10:25 +0000331 for (uint32_t mirrorId : layer->mirrorIds) {
332 hierarchy->addChild(getHierarchyFromId(mirrorId), LayerHierarchy::Variant::Mirror);
Vishnu Nair04f89692022-11-16 23:21:05 +0000333 }
334}
335
336void LayerHierarchyBuilder::update(
337 const std::vector<std::unique_ptr<RequestedLayerState>>& layers,
338 const std::vector<std::unique_ptr<RequestedLayerState>>& destroyedLayers) {
339 // rebuild map
340 for (auto& layer : layers) {
341 if (layer->changes.test(RequestedLayerState::Changes::Created)) {
342 mHierarchies.emplace_back(std::make_unique<LayerHierarchy>(layer.get()));
343 mLayerIdToHierarchy[layer->id] = mHierarchies.back().get();
344 }
345 }
346
347 for (auto& layer : layers) {
348 if (layer->changes.get() == 0) {
349 continue;
350 }
351 if (layer->changes.test(RequestedLayerState::Changes::Created)) {
352 onLayerAdded(layer.get());
353 continue;
354 }
355 LayerHierarchy* hierarchy = getHierarchyFromId(layer->id);
356 if (layer->changes.test(RequestedLayerState::Changes::Parent)) {
357 detachFromParent(hierarchy);
358 attachToParent(hierarchy);
359 }
360 if (layer->changes.test(RequestedLayerState::Changes::RelativeParent)) {
361 detachFromRelativeParent(hierarchy);
362 attachToRelativeParent(hierarchy);
363 }
364 if (layer->changes.test(RequestedLayerState::Changes::Z)) {
365 hierarchy->mParent->sortChildrenByZOrder();
366 if (hierarchy->mRelativeParent) {
367 hierarchy->mRelativeParent->sortChildrenByZOrder();
368 }
369 }
370 if (layer->changes.test(RequestedLayerState::Changes::Mirror)) {
371 updateMirrorLayer(layer.get());
372 }
373 }
374
375 for (auto& layer : destroyedLayers) {
376 onLayerDestroyed(layer.get());
377 }
378 // When moving from onscreen to offscreen and vice versa, we need to attach and detach
379 // from our relative parents. This walks down both trees to do so. We can optimize this
380 // further by tracking onscreen, offscreen state in LayerHierarchy.
381 detachHierarchyFromRelativeParent(&mOffscreenRoot);
382 attachHierarchyToRelativeParent(&mRoot);
383}
384
385const LayerHierarchy& LayerHierarchyBuilder::getHierarchy() const {
386 return mRoot;
387}
388
389const LayerHierarchy& LayerHierarchyBuilder::getOffscreenHierarchy() const {
390 return mOffscreenRoot;
391}
392
393std::string LayerHierarchyBuilder::getDebugString(uint32_t layerId, uint32_t depth) const {
394 if (depth > 10) return "too deep, loop?";
395 if (layerId == UNASSIGNED_LAYER_ID) return "";
396 auto it = mLayerIdToHierarchy.find(layerId);
397 if (it == mLayerIdToHierarchy.end()) return "not found";
398
399 LayerHierarchy* hierarchy = it->second;
400 if (!hierarchy->mLayer) return "none";
401
402 std::string debug =
403 "[" + std::to_string(hierarchy->mLayer->id) + "] " + hierarchy->mLayer->name;
404 if (hierarchy->mRelativeParent) {
405 debug += " Relative:" + hierarchy->mRelativeParent->getDebugStringShort();
406 }
407 if (hierarchy->mParent) {
408 debug += " Parent:" + hierarchy->mParent->getDebugStringShort();
409 }
410 return debug;
411}
412
413LayerHierarchy LayerHierarchyBuilder::getPartialHierarchy(uint32_t layerId,
414 bool childrenOnly) const {
415 auto it = mLayerIdToHierarchy.find(layerId);
416 if (it == mLayerIdToHierarchy.end()) return {nullptr};
417
418 LayerHierarchy hierarchy(*it->second, childrenOnly);
419 return hierarchy;
420}
421
422LayerHierarchy* LayerHierarchyBuilder::getHierarchyFromId(uint32_t layerId, bool crashOnFailure) {
423 auto it = mLayerIdToHierarchy.find(layerId);
424 if (it == mLayerIdToHierarchy.end()) {
425 if (crashOnFailure) {
426 LOG_ALWAYS_FATAL("Could not find hierarchy for layer id %d", layerId);
427 }
428 return nullptr;
429 };
430
431 return it->second;
432}
433
Vishnu Nair8fc721b2022-12-22 20:06:32 +0000434const LayerHierarchy::TraversalPath LayerHierarchy::TraversalPath::ROOT =
Vishnu Nair04f89692022-11-16 23:21:05 +0000435 {.id = UNASSIGNED_LAYER_ID, .variant = LayerHierarchy::Attached};
436
437std::string LayerHierarchy::TraversalPath::toString() const {
Vishnu Nair8fc721b2022-12-22 20:06:32 +0000438 if (id == UNASSIGNED_LAYER_ID) {
439 return "TraversalPath{ROOT}";
440 }
Vishnu Nair80a5a702023-02-11 01:21:51 +0000441 std::stringstream ss;
442 ss << "TraversalPath{.id = " << id;
Vishnu Nair04f89692022-11-16 23:21:05 +0000443
Vishnu Nair80a5a702023-02-11 01:21:51 +0000444 if (mirrorRootId != UNASSIGNED_LAYER_ID) {
445 ss << ", .mirrorRootId=" << mirrorRootId;
Vishnu Nair04f89692022-11-16 23:21:05 +0000446 }
447
448 if (!relativeRootIds.empty()) {
Vishnu Nair80a5a702023-02-11 01:21:51 +0000449 ss << ", .relativeRootIds=";
Vishnu Nair04f89692022-11-16 23:21:05 +0000450 for (auto rootId : relativeRootIds) {
Vishnu Nair80a5a702023-02-11 01:21:51 +0000451 ss << rootId << ",";
Vishnu Nair04f89692022-11-16 23:21:05 +0000452 }
453 }
454
455 if (hasRelZLoop()) {
Vishnu Nair80a5a702023-02-11 01:21:51 +0000456 ss << "hasRelZLoop=true invalidRelativeRootId=" << invalidRelativeRootId << ",";
Vishnu Nair04f89692022-11-16 23:21:05 +0000457 }
Vishnu Nair80a5a702023-02-11 01:21:51 +0000458 ss << "}";
459 return ss.str();
460}
Vishnu Nair04f89692022-11-16 23:21:05 +0000461
Vishnu Nair80a5a702023-02-11 01:21:51 +0000462LayerHierarchy::TraversalPath LayerHierarchy::TraversalPath::getMirrorRoot() const {
463 LOG_ALWAYS_FATAL_IF(!isClone(), "Cannot get mirror root of a non cloned node");
464 TraversalPath mirrorRootPath = *this;
465 mirrorRootPath.id = mirrorRootId;
466 return mirrorRootPath;
Vishnu Nair04f89692022-11-16 23:21:05 +0000467}
468
469// Helper class to update a passed in TraversalPath when visiting a child. When the object goes out
470// of scope the TraversalPath is reset to its original state.
471LayerHierarchy::ScopedAddToTraversalPath::ScopedAddToTraversalPath(TraversalPath& traversalPath,
472 uint32_t layerId,
473 LayerHierarchy::Variant variant)
Vishnu Nair80a5a702023-02-11 01:21:51 +0000474 : mTraversalPath(traversalPath), mParentPath(traversalPath) {
Vishnu Nair04f89692022-11-16 23:21:05 +0000475 // Update the traversal id with the child layer id and variant. Parent id and variant are
476 // stored to reset the id upon destruction.
477 traversalPath.id = layerId;
478 traversalPath.variant = variant;
479 if (variant == LayerHierarchy::Variant::Mirror) {
Vishnu Nair92990e22023-02-24 20:01:05 +0000480 traversalPath.mirrorRootId = mParentPath.id;
Vishnu Nair8fc721b2022-12-22 20:06:32 +0000481 } else if (variant == LayerHierarchy::Variant::Relative) {
Vishnu Nair04f89692022-11-16 23:21:05 +0000482 if (std::find(traversalPath.relativeRootIds.begin(), traversalPath.relativeRootIds.end(),
483 layerId) != traversalPath.relativeRootIds.end()) {
484 traversalPath.invalidRelativeRootId = layerId;
485 }
486 traversalPath.relativeRootIds.emplace_back(layerId);
Vishnu Nair8fc721b2022-12-22 20:06:32 +0000487 } else if (variant == LayerHierarchy::Variant::Detached) {
488 traversalPath.detached = true;
Vishnu Nair04f89692022-11-16 23:21:05 +0000489 }
490}
491LayerHierarchy::ScopedAddToTraversalPath::~ScopedAddToTraversalPath() {
492 // Reset the traversal id to its original parent state using the state that was saved in
493 // the constructor.
494 if (mTraversalPath.variant == LayerHierarchy::Variant::Mirror) {
Vishnu Nair80a5a702023-02-11 01:21:51 +0000495 mTraversalPath.mirrorRootId = mParentPath.mirrorRootId;
Vishnu Nair8fc721b2022-12-22 20:06:32 +0000496 } else if (mTraversalPath.variant == LayerHierarchy::Variant::Relative) {
Vishnu Nair04f89692022-11-16 23:21:05 +0000497 mTraversalPath.relativeRootIds.pop_back();
498 }
499 if (mTraversalPath.invalidRelativeRootId == mTraversalPath.id) {
500 mTraversalPath.invalidRelativeRootId = UNASSIGNED_LAYER_ID;
501 }
Vishnu Nair80a5a702023-02-11 01:21:51 +0000502 mTraversalPath.id = mParentPath.id;
503 mTraversalPath.variant = mParentPath.variant;
504 mTraversalPath.detached = mParentPath.detached;
Vishnu Nair04f89692022-11-16 23:21:05 +0000505}
506
507} // namespace android::surfaceflinger::frontend