Bug 1701123 Comment 139 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Calvin Walton from comment #138)
> Note that one of the big issues with the gtk3 version of Firefox on Wayland is the fact that Firefox renders its UI in a wayland subsurface, rather than into the window surface itself. This is one of the (several) hangups holding back support for native fractional scaling in Firefox on Wayland - there is no way to correctly position and size a subsurface so that it aligns correctly with the pixels on the screen, so the result will often be blurry.

Subsurfaces, pixel alignment or fractional scaling or blurry output are different and independent issues. 

> You will want to have Firefox's code render to … something? … which can be used as a [GdkPaintable](https://docs.gtk.org/gdk4/iface.Paintable.html) and therefore can be composited directly into the window by Gtk4's renderer. There's a variety of options here, but I'd recommend seeing if you can use a [DMA-Buf texture](https://docs.gtk.org/gdk4/class.DmabufTextureBuilder.html) which is the best way in Linux of getting a GPU texture across rendering API (gtk normally uses Vulkan, not OpenGL!) or process boundaries.

AFAIK even Gtk uses subsurfaces for GtkGraphicsOffload. Firefox will implement similar mechanism for HDR playback (Bug 1642854) where dmabuf is directly send to compositor as wl_buffer which allows direct composition of video/webgl and natively supports fractional scaling (it doesn't matter how do you paint to dmabuf, if you se va-api, gl, vulkan ...).
(In reply to Calvin Walton from comment #138)
> Note that one of the big issues with the gtk3 version of Firefox on Wayland is the fact that Firefox renders its UI in a wayland subsurface, rather than into the window surface itself. This is one of the (several) hangups holding back support for native fractional scaling in Firefox on Wayland - there is no way to correctly position and size a subsurface so that it aligns correctly with the pixels on the screen, so the result will often be blurry.

Subsurfaces, pixel alignment or fractional scaling or blurry output are different and independent issues. 

> You will want to have Firefox's code render to … something? … which can be used as a [GdkPaintable](https://docs.gtk.org/gdk4/iface.Paintable.html) and therefore can be composited directly into the window by Gtk4's renderer. There's a variety of options here, but I'd recommend seeing if you can use a [DMA-Buf texture](https://docs.gtk.org/gdk4/class.DmabufTextureBuilder.html) which is the best way in Linux of getting a GPU texture across rendering API (gtk normally uses Vulkan, not OpenGL!) or process boundaries.

AFAIK even Gtk uses subsurfaces for GtkGraphicsOffload. Firefox will implement similar mechanism for HDR playback (Bug 1642854) where dmabuf is directly send to compositor as wl_buffer which allows direct composition of video/webgl and natively supports fractional scaling (it doesn't matter how do you paint to dmabuf, if you use va-api, gl, vulkan ...).

Back to Bug 1701123 Comment 139