aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl/wayland
diff options
context:
space:
mode:
authorBenjamin Franzke <[email protected]>2011-02-09 20:40:37 +0100
committerKristian Høgsberg <[email protected]>2011-02-10 23:07:01 -0500
commitc79a5a706727c40a856e36c043da608c825390a2 (patch)
tree7c5492437ec2a2183446c6e4a08ce76de34fd32a /src/gallium/state_trackers/egl/wayland
parent596684eb93067f5281ce7c32123a7f009c8a98c6 (diff)
st/egl wayland: Set color_format according to wl_visual
Diffstat (limited to 'src/gallium/state_trackers/egl/wayland')
-rw-r--r--src/gallium/state_trackers/egl/wayland/native_wayland.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/egl/wayland/native_wayland.c b/src/gallium/state_trackers/egl/wayland/native_wayland.c
index c526c599d08..f1461b58cc8 100644
--- a/src/gallium/state_trackers/egl/wayland/native_wayland.c
+++ b/src/gallium/state_trackers/egl/wayland/native_wayland.c
@@ -84,7 +84,7 @@ wayland_display_get_configs (struct native_display *ndpy, int *num_configs)
(1 << NATIVE_ATTACHMENT_FRONT_LEFT) |
(1 << NATIVE_ATTACHMENT_BACK_LEFT);
- format = PIPE_FORMAT_B8G8R8X8_UNORM;
+ format = PIPE_FORMAT_B8G8R8A8_UNORM;
nconf->color_format = format;
nconf->window_bit = TRUE;
@@ -378,14 +378,15 @@ wayland_create_pixmap_surface(struct native_display *ndpy,
return NULL;
surface->display = display;
- if (config)
- surface->color_format = config->base.color_format;
- else
- surface->color_format = PIPE_FORMAT_B8G8R8X8_UNORM;
surface->type = WL_PIXMAP_SURFACE;
surface->pix = egl_pixmap;
+ if (surface->pix->visual == wl_display_get_rgb_visual(display->dpy->display))
+ surface->color_format = PIPE_FORMAT_B8G8R8X8_UNORM;
+ else
+ surface->color_format = PIPE_FORMAT_B8G8R8A8_UNORM;
+
surface->attachment_mask = (1 << NATIVE_ATTACHMENT_FRONT_LEFT);
surface->rsurf = resource_surface_create(display->base.screen,