Any protocol documentation about premultiplied alpha?

Hoosier, Matt Matt.Hoosier at garmin.com
Tue Sep 28 13:16:36 UTC 2021


Hi there,



Is there any definitive word about whether or not clients should be expected or allowed to premultiply alpha the alpha channels in the normal EGL and linux-dmabuf buffers they send to a compositor?


I have never seen this practice used with Wayland -- the shaders in the gl-renderer certainly don't seem to expect clients to premultiply. But I stumbled on a comment or two that maybe gnome-calculator [1] does this and that Sway settled on that convention [2].



I see hardly any mention of premult in the Weston codebase. In fact, the only real reference to it occurs at a site dealing with Pixman color formats. In this location, it's a prominent warning to the reader that Pixman does use premultiplication; this seems to carry the meaning that Pixman's premult usage stands apart from the rest of Weston.


To me, it seems that Wayland's adoption of the DRM_FORMAT_xxx identifiers in the wire protocols (e.g., dmabuf) combined with drm_fourcc.h's complete stonewalled silence on the subject, seems to be a fairly strong indicating that premultiplication should not be used.



-Matt


[1] https://github.com/swaywm/wlroots/issues/984#issue-324334642


[2] https://github.com/swaywm/wlroots/issues/984#issuecomment-390221778



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20210928/3ea4f637/attachment.htm>


More information about the wayland-devel mailing list