summaryrefslogtreecommitdiff
path: root/src/egl/drivers/dri2/platform_x11.c
diff options
context:
space:
mode:
authorHal Gentz <zegentzy@protonmail.com>2019-10-10 18:35:50 -0600
committerAdam Jackson <ajax@nwnk.net>2019-10-11 21:57:21 +0000
commit90a19074b4e1d4d8f8ababaade8170c05aeecffe (patch)
tree78803ff106d46c0fd627e643887c1011ec57b721 /src/egl/drivers/dri2/platform_x11.c
parent173bc9d6842efdec54ea3fd415a6946dcee7b02a (diff)
egl: Fixes transparency with EGL and X11.
This commit does this by allowing both RGB and RGBA visuals to match with EGL configs. We also expose the `EGL_MESA_config_select_group` egl extension, which is similar to GLX's visual select group extension, to allow the RGBA visuals to get less priority. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676 Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs" Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hal Gentz <zegentzy@protonmail.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_x11.c')
-rw-r--r--src/egl/drivers/dri2/platform_x11.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 5a1e2f31890..414d5f74c5d 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -816,28 +816,25 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
if (dri2_conf->base.ConfigID == config_count + 1)
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.
+ /* Allows 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 || d.data->depth == 30) {
- unsigned int rgba_mask = ~(visuals[i].red_mask |
- visuals[i].green_mask |
- visuals[i].blue_mask);
- rgba_shifts[3] = ffs(rgba_mask) - 1;
- rgba_sizes[3] = util_bitcount(rgba_mask);
- dri2_conf = dri2_add_config(disp, config, config_count + 1,
- surface_type, config_attrs,
- rgba_shifts, rgba_sizes);
- if (dri2_conf)
- if (dri2_conf->base.ConfigID == config_count + 1)
- config_count++;
- }
- }
+ unsigned int rgba_mask = ~(visuals[i].red_mask |
+ visuals[i].green_mask |
+ visuals[i].blue_mask);
+ rgba_shifts[3] = ffs(rgba_mask) - 1;
+ rgba_sizes[3] = util_bitcount(rgba_mask);
+ dri2_conf = dri2_add_config(disp, config, config_count + 1,
+ surface_type, config_attrs,
+ rgba_shifts, rgba_sizes);
+ if (dri2_conf)
+ if (dri2_conf->base.ConfigID == config_count + 1)
+ config_count++;
+ }
}
xcb_depth_next(&d);