From efda9c56491f5cb90e77f5fe7979477fc9b2b529 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 11 May 2015 22:16:52 +0200 Subject: [PATCH] egl: set the EGL version in common code Reviewed-by: Emil Velikov Reviewed-by: Chad Versace --- src/egl/drivers/dri2/platform_android.c | 4 ---- src/egl/drivers/dri2/platform_drm.c | 4 ---- src/egl/drivers/dri2/platform_wayland.c | 8 -------- src/egl/drivers/dri2/platform_x11.c | 8 -------- src/egl/main/eglapi.c | 7 +++++++ 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index f4825261bad..fed3073088a 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -707,10 +707,6 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy) dpy->Extensions.ANDROID_image_native_buffer = EGL_TRUE; dpy->Extensions.KHR_image_base = EGL_TRUE; - /* we're supporting EGL 1.4 */ - dpy->VersionMajor = 1; - dpy->VersionMinor = 4; - /* Fill vtbl last to prevent accidentally calling virtual function during * initialization. */ diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 486b0030dcd..3391afc635c 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -715,10 +715,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp) } #endif - /* we're supporting EGL 1.4 */ - disp->VersionMajor = 1; - disp->VersionMinor = 4; - /* Fill vtbl last to prevent accidentally calling virtual function during * initialization. */ diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 9914b687fb8..ea2f9f23b96 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -1206,10 +1206,6 @@ dri2_initialize_wayland_drm(_EGLDriver *drv, _EGLDisplay *disp) disp->Extensions.EXT_swap_buffers_with_damage = EGL_TRUE; - /* we're supporting EGL 1.4 */ - disp->VersionMajor = 1; - disp->VersionMinor = 4; - /* Fill vtbl last to prevent accidentally calling virtual function during * initialization. */ @@ -1853,10 +1849,6 @@ dri2_initialize_wayland_swrast(_EGLDriver *drv, _EGLDisplay *disp) dri2_add_config(disp, config, i + 1, types, NULL, rgb565_masks); } - /* we're supporting EGL 1.4 */ - disp->VersionMajor = 1; - disp->VersionMinor = 4; - /* Fill vtbl last to prevent accidentally calling virtual function during * initialization. */ diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 300072d6d92..e0d0fdc8205 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -1129,10 +1129,6 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp) goto cleanup_configs; } - /* we're supporting EGL 1.4 */ - disp->VersionMajor = 1; - disp->VersionMinor = 4; - /* Fill vtbl last to prevent accidentally calling virtual function during * initialization. */ @@ -1303,10 +1299,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp) goto cleanup_configs; } - /* we're supporting EGL 1.4 */ - disp->VersionMajor = 1; - disp->VersionMinor = 4; - /* Fill vtbl last to prevent accidentally calling virtual function during * initialization. */ diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index fbb14f1524a..9a17f8d31f2 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -407,6 +407,12 @@ _eglCreateAPIsString(_EGLDisplay *dpy) assert(strlen(dpy->ClientAPIsString) < sizeof(dpy->ClientAPIsString)); } +static void +_eglComputeVersion(_EGLDisplay *disp) +{ + disp->VersionMajor = 1; + disp->VersionMinor = 4; +} /** * This is typically the second EGL function that an application calls. @@ -444,6 +450,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) */ disp->Extensions.KHR_get_all_proc_addresses = EGL_TRUE; + _eglComputeVersion(disp); _eglCreateExtensionsString(disp); _eglCreateAPIsString(disp); _eglsnprintf(disp->VersionString, sizeof(disp->VersionString), -- 2.30.2