qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC 2/6] hw/display/virtio-gpu.c: reverse alpha pre-multiplication


From: Daniel P . Berrangé
Subject: [RFC 2/6] hw/display/virtio-gpu.c: reverse alpha pre-multiplication
Date: Thu, 23 Jan 2025 19:15:32 +0000

The cursor data we receive from the guest has had the alpha channel
pre-multiplied into the RGB components. Reverse this before passing
the cursor onto the backends.

Without doing this, areas of the cursor with alpha are much less
saturated than they are intended to be. This effect is visible with
the SDL and GTK backends, but was masked with the VNC backend since
that forget to apply pre-multiplication with its alpha cursor
encoding thus cancelling out the virtio-gpu problem.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 hw/display/virtio-gpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 11a7a85750..156d4e0b9b 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -102,6 +102,7 @@ static void update_cursor(VirtIOGPU *g, struct 
virtio_gpu_update_cursor *cursor)
 
         if (cursor->resource_id > 0) {
             vgc->update_cursor_data(g, s, cursor->resource_id);
+            cursor_unmultiply_alpha(s->current_cursor);
         }
         dpy_cursor_define(s->con, s->current_cursor);
 
-- 
2.47.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]