summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/egl/drivers/dri2/platform_x11.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 2a19cdcc746..16cc31340e0 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -730,13 +730,7 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
xcb_depth_iterator_t d;
xcb_visualtype_t *visuals;
int count = 0;
- unsigned int rgba_masks[4];
EGLint surface_type;
- EGLint config_attrs[] = {
- EGL_NATIVE_VISUAL_ID, 0,
- EGL_NATIVE_VISUAL_TYPE, 0,
- EGL_NONE
- };
d = xcb_screen_allowed_depths_iterator(dri2_dpy->screen);
@@ -763,13 +757,19 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
struct dri2_egl_config *dri2_conf;
const __DRIconfig *config = dri2_dpy->driver_configs[j];
- config_attrs[1] = visuals[i].visual_id;
- config_attrs[3] = visuals[i]._class;
+ const EGLint config_attrs[] = {
+ EGL_NATIVE_VISUAL_ID, visuals[i].visual_id,
+ EGL_NATIVE_VISUAL_TYPE, visuals[i]._class,
+ EGL_NONE
+ };
+
+ unsigned int rgba_masks[4] = {
+ visuals[i].red_mask,
+ visuals[i].green_mask,
+ visuals[i].blue_mask,
+ 0,
+ };
- rgba_masks[0] = visuals[i].red_mask;
- rgba_masks[1] = visuals[i].green_mask;
- rgba_masks[2] = visuals[i].blue_mask;
- rgba_masks[3] = 0;
dri2_conf = dri2_add_config(disp, config, count + 1, surface_type,
config_attrs, rgba_masks);
if (dri2_conf)