File tree Expand file tree Collapse file tree
services/surfaceflinger/FrontEnd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,29 @@ maintain policies at different levels without needing to understand the entire h
1717This allows control to be delegated to different parts of the system - such as SystemServer,
1818SysUI and Apps.
1919
20+ ### Layer Drawing Order
21+ Layers are drawn based on an inorder traversal, treating relative parents as
22+ direct parents. Negative z-values place layers below their parent, while
23+ non-negative values place them above. Layers with the same z-value are drawn
24+ in creation order (newer on top). However, relying on creation order for
25+ z-ordering is discouraged; use unique z-values whenever possible for better
26+ control.
27+
28+ Traversal pseudo code:
29+ ```
30+ fn traverseBottomToTop(root):
31+ for each child node including relative children,
32+ sorted by z then layer id, with z less than 0:
33+ traverseBottomToTop(childNode)
34+
35+ visit(root)
36+
37+ for each child node including relative children,
38+ sorted by z then layer id, with z greater than
39+ or equal to 0:
40+ traverseBottomToTop(childNode)
41+ ```
42+
2043### Layer Lifecycle
2144Layer is created by a client. The client receives a strong binder reference to the layer
2245handle, which will keep the layer alive as long as the client holds the reference. The
You can’t perform that action at this time.
0 commit comments