Ensure browsers can be implemented in a power efficient manner
There are currently multiple channels with discussions regarding blending behaviour between Wayland subsurfaces and which guarantees clients should be given by Wayland compositors. This issue aims to be a central place for such discussions to avoid further short-lived ad-hoc communication.
The context is that until now, Wayland does not specify blending behaviour between surfaces. In practice what compositors currently do is sRGB blending (sRGB inverse EOTF non-linearity on source and destination - feel free to propose other names). In light of current HDR/color management work, this will likely need to change.
AFAIK there are two main use-cases where browsers and similar multimedia apps currently rely on sRGB blending that are important to allow performant Wayland implementations:
- Videos with overlays. In an ideal case
- browsers would put video content (in YUV formats) and overlays in separate subsurfaces, so that if the hardware supports it, composition can be fully offloaded to the display controller / CRTC
- we'd have guarantees about how semi-transparent overlays would be blended on top of the video, including in a web compatible way. Note that on several platforms such as Youtube, content creators have semi-transparent logos that are permanently visible on top of the video. Ideally those logos would get uniform and predictable blending behaviour.
- Offloading of layer composition. Browsers content usually consists of several layers that need composition with sRGB blending. In order to minimize GPU work, delegating composition to the system compositor instead of using a in-client one can have major benefits, see also here.
- If we want to support this on the Wayland platform in a meaningful way, we'll need to have some kind of blending guarantees, at least for subsurface trees.
- Client side composition with direct scanout on the system compositor side should have similar or better performance characteristics than doing all composition in the system compositor. As browser are likely often used in a scanout compatible manner (e.g. maximized / not overlapped by other windows), good scanout detection can compensate for a lack of offloading capabilities.
Lets find some consensus what's a good forward here.
Relevant links and previous discussions: