Even better assignment of views to HW planes / Handling of mixed-use case of underlays and overlays
Handling a mixed-use of HW planes (underlay and overlays) seems to require a bit more thought in order to maximize the chances of putting views on both overlays and underlays without ignoring or skipping one or the other. Possibly, we won't able to cover all situations.
As our current strategy is to look at HW plane overlays, with !1258 (merged) merged it, it seems that there might some potential scene-graphs that would not make use of underlays, as explained in !1258 (comment 2303111). Dynamically switching between the order of the planes (ascending, rather than descending), looking prior at the (current) scene-graph and use that determine which views occlude others, might be some alternative strategies, as to maximize our chances.
Worth mentioning also some previous work with respect to zpos implementation was made previously in #275 (closed). Found also that libliftoff seems to tackle this issue at emersion/libliftoff#76
Also some further comments on Pekka on the matter !1258 (comment 2325164), about an approach and possible issues.