planeshift icon indicating copy to clipboard operation
planeshift copied to clipboard

Wayland backend

Open rmader opened this issue 5 years ago • 1 comments

I recently browsed a bit through the code and would like to leave two notes about the wayland backend:

  1. You use subsurface.place_below. This was not supported by Mutter (Gnome Shell) until very recently, but it just landed and will be supported in 3.34 (https://gitlab.gnome.org/GNOME/mutter/merge_requests/664)
  2. It might be possible to simplify the code quite a bit by making use of wp_viewporter (https://gitlab.freedesktop.org/wayland/wayland-protocols/blob/master/stable/viewporter/viewporter.xml). It allows to select what part of a buffer you would like to display, so you can e.g. paint the whole website into a buffer (of a subsurface) and then simply move the viewport around. Support for that landed in Mutter 3.32, ~~but we need https://gitlab.gnome.org/GNOME/mutter/merge_requests/763 to land before it really works for this use case (I just wrote a test client and it works really well).~~

Edit: I created a MR for the demo client at https://gitlab.freedesktop.org/wayland/weston/merge_requests/259

Update:

After some discussion with Wayland and Mutter devs, we concluded that we don't need any additions for viewport scrolling and can use it simply with wl_surface.damage_buffer as long as EGL/DMABUF buffers are used, since we don't do extra copies then (with SHM buffers it would cause extra copies).

So since Webrender on Wayland already uses EGL, using wp_viewporter should be quite straight forward.

rmader avatar Aug 30 '19 12:08 rmader

See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1617498

Darkspirit avatar Feb 24 '20 02:02 Darkspirit