summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2009-08-31 10:22:19 +0200
committerMichel Dänzer <[email protected]>2009-08-31 10:22:19 +0200
commit9f0495aa765ae53b877b1e7fdffba70f4ee1a056 (patch)
tree24c6c5932dc9d69d41597f8c383c496eb22a557a /src/gallium/state_trackers
parent1ea114958baba14ff3bcac1d92bb6acf93289e59 (diff)
Gallium xlib: Add support for BGRA visuals.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c12
1 files changed, 12 insertions, 0 deletions
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