[PATCH xserver v2] Always use WL_SHM_FORMAT_ARGB8888 for shm surfaces.

Kristian Høgsberg hoegsberg at gmail.com
Thu May 31 10:10:40 PDT 2012


On Sun, May 27, 2012 at 02:58:34AM -0600, Scott Moreau wrote:
> ---

Looks good, committed.

> Remove unused variables.
> 
>  hw/xfree86/xwayland/xwayland.c |   21 +++++----------------
>  1 files changed, 5 insertions(+), 16 deletions(-)
> 
> diff --git a/hw/xfree86/xwayland/xwayland.c b/hw/xfree86/xwayland/xwayland.c
> index fea5210..e5037fd 100644
> --- a/hw/xfree86/xwayland/xwayland.c
> +++ b/hw/xfree86/xwayland/xwayland.c
> @@ -276,28 +276,17 @@ int
>  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 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
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list