Skip to content

Create and destroy subsurface views at source, many view/surface cleanups

Daniel Stone requested to merge daniels/weston:subsurface-adventure-2 into main

This series continues from where !1276 (merged) left off. Most of the work is pushing through more status bits from surface commit, so we can see the overall effect any commit has, including subsurface reconfiguration in particular. Once we have that, we're free to rework subsurface view construction: instead of walking layer_list at repaint time to completely rebuild the view_list, including creating new subsurface views if they weren't already there, or nuking old ones if we no longer need them, we can create new views when they first become relevant (when subsurfaces are committed, or new views created), and destroy them as necessary.

In the middle of this series, there's a detour from what I've described above. The only way we can avoid rebuilding view_list is if we know that the set of relevant views hasn't changed. Using weston_view_move_to_layer helps us know exactly what's changed, and perhaps slim down the effect of our layer changes as well. Other helpers are introduced which give us an API transition point: any time weston_view_geometry_dirty() is called, we assume that we don't know anything about the view list any more and have to rebuild it. Eventually, all users of weston_view_geometry_dirty() should be converted to using the view-manipulation helpers; I would like to mark it deprecated in 13.0 and remove it for 14.0 if that makes sense.

There are two paths we can build on from this series. One is to continue the path of pushing more detailed status down the surface -> view -> paint node path (some of which @derekf has already done), and trying to slim down our updates so we only do the bare minimum of work. Another - more of a side quest - would be to do the equivalent on the input side, so we don't have to repick so aggressively - we can now build a { view, input_region } list every time the view list changes, and then only cheaply test against that region when the pointer actually moves.

I wrote another subsurface-shot test (to prove that the current code was broken and mine was right), which actually proved that the original code was right and my first attempts at this branch were wrong. But it does pass all the tests on all the commits, and also works irl with desktop-shell and subsurface tests.

Merge request reports

Loading