[PATCH xserver] Always use WL_SHM_FORMAT_ARGB8888 for shm surfaces.
Scott Moreau
oreaus at gmail.com
Sun May 27 01:29:30 PDT 2012
---
hw/xfree86/xwayland/xwayland.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/hw/xfree86/xwayland/xwayland.c b/hw/xfree86/xwayland/xwayland.c
index fea5210..af7706e 100644
--- a/hw/xfree86/xwayland/xwayland.c
+++ b/hw/xfree86/xwayland/xwayland.c
@@ -277,27 +277,19 @@ xwl_create_window_buffer_shm(struct xwl_window *xwl_window,
PixmapPtr pixmap, int fd)
{
VisualID visual;
- uint32_t format;
WindowPtr window = xwl_window->window;
ScreenPtr screen = window->drawable.pScreen;
struct wl_shm_pool *pool;
- int i, size;
+ int i, size, stride;
- visual = wVisual(window);
- for (i = 0; i < screen->numVisuals; i++)
- if (screen->visuals[i].vid == visual)
- break;
-
- if (screen->visuals[i].nplanes == 32)
- format = WL_SHM_FORMAT_ARGB8888;
- else
- format = WL_SHM_FORMAT_XRGB8888;
+ stride = pixmap->drawable.width * 4;
size = pixmap->drawable.width * pixmap->drawable.height * 4;
pool = wl_shm_create_pool(xwl_window->xwl_screen->shm, fd, size);
xwl_window->buffer = wl_shm_pool_create_buffer(pool, 0,
- pixmap->drawable.width, pixmap->drawable.height,
- pixmap->drawable.width * 4, format);
+ pixmap->drawable.width,
+ pixmap->drawable.height,
+ stride, WL_SHM_FORMAT_ARGB8888);
wl_shm_pool_destroy(pool);
return xwl_window->buffer ? Success : BadDrawable;
--
1.7.7.6
More information about the wayland-devel
mailing list