struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
- int depth, EGLint surface_type, const EGLint *attr_list,
+ EGLint surface_type, const EGLint *attr_list,
const unsigned int *rgba_masks)
{
struct dri2_egl_config *conf;
for (i = 0; attr_list[i] != EGL_NONE; i += 2)
_eglSetConfigKey(&base, attr_list[i], attr_list[i+1]);
- /* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig. Otherwise
- * it will only match a 32-bit RGBA visual. On a composited window manager
- * on X11, this will make all of the EGLConfigs with destination alpha get
- * blended by the compositor. This is probably not what the application
- * wants... especially on drivers that only have 32-bit RGBA EGLConfigs!
- */
- if (depth > 0 && depth != base.BufferSize
- && !(depth == 24 && base.BufferSize == 32))
- return NULL;
-
if (rgba_masks && memcmp(rgba_masks, dri_masks, sizeof(dri_masks)))
return NULL;
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
- int depth, EGLint surface_type, const EGLint *attr_list,
+ EGLint surface_type, const EGLint *attr_list,
const unsigned int *rgba_masks);
_EGLImage *
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
const struct {
int format;
- int size;
unsigned int rgba_masks[4];
} visuals[] = {
- { HAL_PIXEL_FORMAT_RGBA_8888, 32, { 0xff, 0xff00, 0xff0000, 0xff000000 } },
- { HAL_PIXEL_FORMAT_RGBX_8888, 32, { 0xff, 0xff00, 0xff0000, 0x0 } },
- { HAL_PIXEL_FORMAT_RGB_888, 24, { 0xff, 0xff00, 0xff0000, 0x0 } },
- { HAL_PIXEL_FORMAT_RGB_565, 16, { 0xf800, 0x7e0, 0x1f, 0x0 } },
- { HAL_PIXEL_FORMAT_BGRA_8888, 32, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
+ { HAL_PIXEL_FORMAT_RGBA_8888, { 0xff, 0xff00, 0xff0000, 0xff000000 } },
+ { HAL_PIXEL_FORMAT_RGBX_8888, { 0xff, 0xff00, 0xff0000, 0x0 } },
+ { HAL_PIXEL_FORMAT_RGB_888, { 0xff, 0xff00, 0xff0000, 0x0 } },
+ { HAL_PIXEL_FORMAT_RGB_565, { 0xf800, 0x7e0, 0x1f, 0x0 } },
+ { HAL_PIXEL_FORMAT_BGRA_8888, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
{ 0, 0, { 0, 0, 0, 0 } }
};
int count, i, j;
continue;
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
- count + 1, visuals[i].size, surface_type, NULL,
- visuals[i].rgba_masks);
+ count + 1, surface_type, NULL, visuals[i].rgba_masks);
if (dri2_conf) {
dri2_conf->base.NativeVisualID = visuals[i].format;
dri2_conf->base.NativeVisualType = visuals[i].format;
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i],
- i + 1, 0, EGL_WINDOW_BIT, NULL, NULL);
+ i + 1, EGL_WINDOW_BIT, NULL, NULL);
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.DestroySurface = dri2_destroy_surface;
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
config = dri2_dpy->driver_configs[i];
if (dri2_dpy->formats & HAS_XRGB8888)
- dri2_add_config(disp, config, i + 1, 0, types, NULL, rgb_masks);
+ dri2_add_config(disp, config, i + 1, types, NULL, rgb_masks);
if (dri2_dpy->formats & HAS_ARGB8888)
- dri2_add_config(disp, config, i + 1, 0, types, NULL, argb_masks);
+ dri2_add_config(disp, config, i + 1, types, NULL, argb_masks);
if (dri2_dpy->formats & HAS_RGB565)
- dri2_add_config(disp, config, i + 1, 0, types, NULL, rgb565_masks);
+ dri2_add_config(disp, config, i + 1, types, NULL, rgb565_masks);
}
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
rgba_masks[2] = visuals[i].blue_mask;
rgba_masks[3] = 0;
dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
- 0, surface_type, config_attrs, rgba_masks);
+ surface_type, config_attrs, rgba_masks);
/* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig.
* Otherwise it will only match a 32-bit RGBA visual. On a
rgba_masks[3] =
~(rgba_masks[0] | rgba_masks[1] | rgba_masks[2]);
dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
- 0, surface_type, config_attrs, rgba_masks);
+ surface_type, config_attrs, rgba_masks);
}
}
}