summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-06-22 11:00:41 -0700
committerChad Versace <[email protected]>2017-06-22 12:35:49 -0700
commita6fad5596141667b0986f083996b05ca829d1f45 (patch)
tree7d815c0f403525c9b202288a08e3323ad3c3072b /src/egl/drivers/dri2
parentf8ad7f405492ae1b6b035dd41b6b4b77be51f719 (diff)
egl/x11: Declare EGLConfig attrib array inside loop
No behavioral change. Just a readability cleanup. Instead of modifying this small array on each loop iteration, we now initialize it in-place with the values it needs. Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2')
-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)