<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div style="">
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Hi there,</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Is there any definitive word about whether or not clients should be expected or allowed to
<span style="">premultiply</span> alpha the alpha channels in the normal EGL and linux-dmabuf buffers they send to a compositor?</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><br>
</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">I have never seen this practice used with Wayland -- t<span style="font-family: Calibri, sans-serif; font-size: 14.6667px;">he shaders in the gl-renderer certainly don't seem to expect
clients to premultiply. B</span>ut I stumbled on a comment or two that maybe gnome-calculator [1] does this and that Sway settled on that convention [2].</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">I see hardly any mention of
<span style="">premult</span> in the Weston codebase. In fact, the only real reference to it occurs at a site dealing with
<span style="">Pixman</span> color formats. In this location, it's a prominent warning to the reader that
<span style="">Pixman</span> does use <span style="">premultiplication</span>; this seems to carry the meaning that Pixman's premult usage stands apart from the rest of Weston.</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><br>
</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">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.</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">-Matt</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"><br>
</p>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">[1] <a href="https://github.com/swaywm/wlroots/issues/984#issue-324334642" class="OWAAutoLink" id="LPlnk92704" previewremoved="true">https://github.com/swaywm/wlroots/issues/984#issue-324334642</a></p>
<br>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">[2] <a href="https://github.com/swaywm/wlroots/issues/984#issuecomment-390221778" class="OWAAutoLink" id="LPlnk687581" previewremoved="true">https://github.com/swaywm/wlroots/issues/984#issuecomment-390221778</a></p>
<br>
<div>
<div>
<p style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;"> </p>
</div>
</div>
</div>
</div>
</body>
</html>