summaryrefslogtreecommitdiff
path: root/src/gallium/targets/graw-xlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/targets/graw-xlib')
-rw-r--r--src/gallium/targets/graw-xlib/graw_xlib.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/gallium/targets/graw-xlib/graw_xlib.c b/src/gallium/targets/graw-xlib/graw_xlib.c
index 578086f8f9..b6d798e577 100644
--- a/src/gallium/targets/graw-xlib/graw_xlib.c
+++ b/src/gallium/targets/graw-xlib/graw_xlib.c
@@ -66,9 +66,6 @@ graw_create_window_and_screen( int x,
root = RootWindow( graw.display, scrnum );
- if (format != PIPE_FORMAT_R8G8B8A8_UNORM)
- goto fail;
-
if (graw.display == NULL)
goto fail;
@@ -88,6 +85,23 @@ graw_create_window_and_screen( int x,
exit(1);
}
+ /* See if the requirested pixel format matches the visual */
+ if (visinfo->red_mask == 0xff0000 &&
+ visinfo->green_mask == 0xff00 &&
+ visinfo->blue_mask == 0xff) {
+ if (format != PIPE_FORMAT_B8G8R8A8_UNORM)
+ goto fail;
+ }
+ else if (visinfo->red_mask == 0xff &&
+ visinfo->green_mask == 0xff00 &&
+ visinfo->blue_mask == 0xff0000) {
+ if (format != PIPE_FORMAT_R8G8B8A8_UNORM)
+ goto fail;
+ }
+ else {
+ goto fail;
+ }
+
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;