I'm not completely sure about the mechanism, but I think it's simple enough to consider having that upstream now. This shows at least how we can leverage win32u surface changes to decide to switch surfaces on/off-screen and fallback to manual blitting.
Having the surfaces on-screen makes sure they are presented as efficiently as possible, having them off-screen we use GDI blit to indirectly call XCopyArea and this will be suboptimal, probably with visible tearing, but hopefully not too common.
--
v4: win32u: Use GDI blit to implement partial or other process presentation.
winex11: Return an offscreen HDC from vulkan_surface_detach.
win32u: Pass a HDC parameter to vulkan_surface_detach.
winex11: Create a window surface even when there is client window.
winex11: Also attach child client windows to their toplevel window.
win32u: Make sure vulkan windows have a pixel format selected.
win32u: Detach vulkan surfaces that aren't fully visible.
win32u: Detach offscreen, child or vulkan surfaces for another process.
win32u: Move vulkan surfaces to their new parent when reparenting.
win32u: Introduce a new vulkan offscreen surfaces list.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5573
--
v4: winewayland: Use subsurfaces for unmanaged windows.
winewayland: Introduce a new update_wayland_surface_state_toplevel helper.
winewayland: Introduce a new wayland_surface_reconfigure_xdg helper.
winewayland: Introduce a new wayland_surface role enumeration.
winewayland: Call wayland_surface_clear_role in wayland_surface_destroy.
winewayland: Move surface title change to wayland_surface_make_toplevel.
winewayland: Attach client client surfaces to their toplevel surface.
winewayland: Use WindowPosChanged swp_flags to decide if a window is visible.
winewayland: Use the wayland_win_data client rect for child GL windows.
winewayland: Split wayland_win_data_update_wayland_surface helper.
winewayland: Call ensure_window_surface_contents with the toplevel window.
win32u: Update children window state when the parent state changes.
winewayland: Get rid of window_surface reference from wayland_win_data.
winewayland: Move client surface to wayland_win_data struct.
winewayland: Get rid of the window surface individual locks.
winewayland: Introduce a new wayland_client_surface_create helper.
winewayland: Get rid of wayland_surface reference from window_surface.
winewayland: Move window contents buffer to wayland_win_data struct.
winewayland: Reset the buffer damage region immediately after copy.
winewayland: Introduce a new get_window_surface_contents helper.
winewayland: Introduce a new set_window_surface_contents helper.
winewayland: Introduce a new ensure_window_surface_contents helper.
winewayland: Post WM_WAYLAND_CONFIGURE outside of the surface lock.
winewayland: Store all window rects in wayland_win_data.
This merge request has too many patches to be relayed via email.
Please visit the URL below to see the contents of the merge request.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6323