From f3026c916ef91d78040913298170d5e538dd6618 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Tue, 9 May 2023 13:55:53 +0200 Subject: [PATCH] protocol: specify the exact form of premultiplication There are two ways to do pre-multiplication of the alpha channel into the color channels: on optical values or on electrical values. While pre-multiplication with optical values is arguably more correct, because operations like blending or scaling require pre-multiplied, optical color channels, wayland and compositors by default work with pre-multiplied electrical values. This is most likely a convention that Wayland took from Cairo. This commit makes sure that the expectation of pre-multiplied electrical values is properly documented. Signed-off-by: Sebastian Wick --- protocol/wayland.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index a2a969b..4e9f768 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -469,8 +469,8 @@ interface. If the buffer uses a format that has an alpha channel, the alpha channel - is assumed to be premultiplied in the color channels unless otherwise - specified. + is assumed to be premultiplied in the electrical color channel values + (after transfer function encoding) unless otherwise specified. Note, because wl_buffer objects are created from multiple independent factory interfaces, the wl_buffer interface is frozen at version 1.