summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2016-08-16 17:23:23 +0100
committerEmil Velikov <[email protected]>2016-10-14 12:17:18 +0100
commit6a8fe32430077c44fda8a84c014a986e3fc77204 (patch)
treee10c457fe26f57d2985c0d9fbb781199348cd0a4
parent675719817e7bf7c5b9da22c02252aca77a41338d (diff)
egl/android: don't populate dri2_dpy->dri2_loader_extension
The extension stored in struct dri2_egl_display isn't used, thus we can create a static const instance of the extension and point extensions[] to it. Signed-off-by: Emil Velikov <[email protected]>
-rw-r--r--src/egl/drivers/dri2/platform_android.c16
-rw-r--r--src/egl/drivers/dri2/platform_surfaceless.c8
2 files changed, 17 insertions, 7 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 9581c9617d6..4f09b26e130 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -883,6 +883,14 @@ static struct dri2_egl_display_vtbl droid_display_vtbl = {
.get_dri_drawable = dri2_surface_get_dri_drawable,
};
+static const __DRIdri2LoaderExtension droid_dri2_loader_extension = {
+ .base = { __DRI_DRI2_LOADER, 3 },
+
+ .getBuffers = NULL,
+ .flushFrontBuffer = droid_flush_front_buffer,
+ .getBuffersWithFormat = droid_get_buffers_with_format,
+};
+
static const __DRIimageLoaderExtension droid_image_loader_extension = {
.base = { __DRI_IMAGE_LOADER, 1 },
@@ -928,13 +936,7 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
/* render nodes cannot use Gem names, and thus do not support
* the __DRI_DRI2_LOADER extension */
if (!dri2_dpy->is_render_node) {
- dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
- dri2_dpy->dri2_loader_extension.base.version = 3;
- dri2_dpy->dri2_loader_extension.getBuffers = NULL;
- dri2_dpy->dri2_loader_extension.flushFrontBuffer = droid_flush_front_buffer;
- dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
- droid_get_buffers_with_format;
- dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
+ dri2_dpy->extensions[0] = &droid_dri2_loader_extension.base;
} else {
dri2_dpy->extensions[0] = &droid_image_loader_extension.base;
}
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index b4653cc807b..797c013133a 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -265,6 +265,14 @@ surfaceless_get_buffers_with_format(__DRIdrawable * driDrawable,
return dri2_surf->buffers;
}
+static const __DRIdri2LoaderExtension droid_dri2_loader_extension = {
+ .base = { __DRI_DRI2_LOADER, 3 },
+
+ .getBuffers = NULL,
+ .flushFrontBuffer = droid_flush_front_buffer,
+ .getBuffersWithFormat = droid_get_buffers_with_format,
+};
+
static const __DRIimageLoaderExtension image_loader_extension = {
.base = { __DRI_IMAGE_LOADER, 1 },
.getBuffers = surfaceless_image_get_buffers,