From 9f0495aa765ae53b877b1e7fdffba70f4ee1a056 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Mon, 31 Aug 2009 10:22:19 +0200 Subject: [PATCH] Gallium xlib: Add support for BGRA visuals. --- src/gallium/state_trackers/glx/xlib/xm_api.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.30.2