From: Michel Dänzer Date: Mon, 31 Aug 2009 08:22:19 +0000 (+0200) Subject: Gallium xlib: Add support for BGRA visuals. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f0495aa765ae53b877b1e7fdffba70f4ee1a056;p=mesa.git Gallium xlib: Add support for BGRA visuals. --- diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index f4c5893427d..651a9a9fea7 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -286,6 +286,18 @@ choose_pixel_format(XMesaVisual v) return PIPE_FORMAT_B8G8R8A8_UNORM; } } + else if ( GET_REDMASK(v) == 0x0000ff00 + && GET_GREENMASK(v) == 0x00ff0000 + && GET_BLUEMASK(v) == 0xff000000 + && v->BitsPerPixel == 32) { + if (native_byte_order) { + /* no byteswapping needed */ + return PIPE_FORMAT_B8G8R8A8_UNORM; + } + else { + return PIPE_FORMAT_A8R8G8B8_UNORM; + } + } else if ( GET_REDMASK(v) == 0xf800 && GET_GREENMASK(v) == 0x07e0 && GET_BLUEMASK(v) == 0x001f