xorg-x11-server/0013-xwayland-shm-don-t-create-alpha-buffers-if-the-windo.patch
Adam Jackson 488b3f2f01 1.15RC1
2013-11-06 15:45:57 -05:00

32 lines
1.1 KiB
Diff

From a8f7359014b9e604998a2da53764fe99e5c7b784 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