diff options
author | Mario Kleiner <[email protected]> | 2017-12-15 23:04:57 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-01-03 22:57:56 +0100 |
commit | be3d88e539acea970cb9b48ac202dbf94564f442 (patch) | |
tree | fd76f7ce65095e3ef67a5e957ba2d32798079907 /src | |
parent | 01ce3f2cad415ee9c081c87b9aa2e82c64b12b6d (diff) |
egl/x11: Match depth 30 RGB visuals to 32-bit RGBA EGLConfigs.
Similar to the matching of 24 bit RGB visuals to 32-bit
RGBA EGLConfigs, so X11 compositors won't alpha-blend any
config with a destination alpha buffer during compositing.
Additionally this fixes failure to select ARGB2101010
configs via eglChooseConfig() with EGL_ALPHA_BITS 2 on
a depth 30 X-Screen. The X-Server doesn't provide any
visuals of depth 32 for ARGB2101010 configs, it only
provides depth 30 visuals. Therefore if we'd only match
ARGB2101010 configs to depth 32 RGBA visuals, we would
not ever get a visual for such a config.
This was apparent in piglit tests for egl configs, which
are fixed by this commit.
Signed-off-by: Mario Kleiner <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 78a51ba0e53..fada5095ef8 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -782,13 +782,14 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy, config_count++; /* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig. + * Ditto for 30-bit RGB visuals 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 (d.data->depth == 24) { + if (d.data->depth == 24 || d.data->depth == 30) { rgba_masks[3] = ~(rgba_masks[0] | rgba_masks[1] | rgba_masks[2]); dri2_conf = dri2_add_config(disp, config, config_count + 1, |