xorg-x11-server/0013-xwayland-shm-don-t-create-alpha-buffers-if-the-windo.patch
Adam Jackson 973c76f74d xserver 1.14.99.3
- xwayland branch refresh
- Drop some F17-era Obsoletes
- Update BuildReqs to match reality
2013-10-25 13:57:11 -04:00

32 lines
1.1 KiB
Diff

From 2d673d0606ca79ede96c019670286338949e59ec Mon Sep 17 00:00:00 2001
From: Giovanni Campagna <gcampagn@redhat.com>
Date: Wed, 21 Aug 2013 09:53:25 +0200
Subject: [PATCH 13/39] xwayland-shm: don't create alpha buffers if the window
doesn't have alpha
If the window is using a 24 bit visual, we must request a buffer
format without alpha, or garbage is rendered.
---
hw/xfree86/xwayland/xwayland.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/xfree86/xwayland/xwayland.c b/hw/xfree86/xwayland/xwayland.c
index f59bfe4..880b7ec 100644
--- a/hw/xfree86/xwayland/xwayland.c
+++ b/hw/xfree86/xwayland/xwayland.c
@@ -278,7 +278,10 @@ xwl_create_window_buffer_shm(struct xwl_window *xwl_window,
xwl_window->buffer = wl_shm_pool_create_buffer(pool, 0,
pixmap->drawable.width,
pixmap->drawable.height,
- stride, WL_SHM_FORMAT_ARGB8888);
+ stride,
+ pixmap->drawable.depth == 32 ?
+ WL_SHM_FORMAT_ARGB8888 :
+ WL_SHM_FORMAT_XRGB8888);
wl_shm_pool_destroy(pool);
return xwl_window->buffer ? Success : BadDrawable;
--
1.8.3.1