summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-07-28 17:30:34 +0200
committerMarek Olšák <[email protected]>2017-07-31 12:49:30 +0200
commit1bf703e4ea5c4f742bc7ba55d01e5afc3f4e11f9 (patch)
tree11fe6774ef619cc9a5f073c58c5cf19ddedb611d /src/egl
parent5d8359ff4d8c379fdf1a78758f405bb4cdf69459 (diff)
dri_interface,egl,gallium: only expose RGBA visuals on Android
X/GLX can't handle them. This removes almost 500 GLX visuals that were incorrectly exposed. Add an optional getCapability callback for querying what the loader can do. I'm not splitting this patch, because it's already too small. v2: also add the callback to __DRIimageLoaderExtension Reviewed-by: Nicolai Hähnle <[email protected]> Cc: 17.2 <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/platform_android.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 300e2d9dbfb..bae42412b57 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1013,6 +1013,18 @@ droid_get_buffers_with_format(__DRIdrawable * driDrawable,
return dri2_surf->buffers;
}
+static unsigned
+droid_get_capability(void *loaderPrivate, enum dri_loader_cap cap)
+{
+ /* Note: loaderPrivate is _EGLDisplay* */
+ switch (cap) {
+ case DRI_LOADER_CAP_RGBA_ORDERING:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
static EGLBoolean
droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
{
@@ -1125,18 +1137,20 @@ static const struct dri2_egl_display_vtbl droid_display_vtbl = {
};
static const __DRIdri2LoaderExtension droid_dri2_loader_extension = {
- .base = { __DRI_DRI2_LOADER, 3 },
+ .base = { __DRI_DRI2_LOADER, 4 },
.getBuffers = NULL,
.flushFrontBuffer = droid_flush_front_buffer,
.getBuffersWithFormat = droid_get_buffers_with_format,
+ .getCapability = droid_get_capability;
};
static const __DRIimageLoaderExtension droid_image_loader_extension = {
- .base = { __DRI_IMAGE_LOADER, 1 },
+ .base = { __DRI_IMAGE_LOADER, 2 },
.getBuffers = droid_image_get_buffers,
.flushFrontBuffer = droid_flush_front_buffer,
+ .getCapability = droid_get_capability,
};
static const __DRIextension *droid_dri2_loader_extensions[] = {