[PATCH xserver 1/3] xwayland-shm: don't create alpha buffers if the window doesn't have alpha
Giovanni Campagna
scampa.giovanni at gmail.com
Wed Aug 21 00:53:25 PDT 2013
From: Giovanni Campagna <gcampagn at redhat.com>
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
More information about the wayland-devel
mailing list