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 <eric@engestrom.ch>
This commit is contained in:
parent
f8ad7f4054
commit
a6fad55961
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue