egl: set the EGL version in common code
authorMarek Olšák <marek.olsak@amd.com>
Mon, 11 May 2015 20:16:52 +0000 (22:16 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 5 Jun 2015 17:44:33 +0000 (19:44 +0200)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c
src/egl/main/eglapi.c

index f4825261badc502fe4ce85812f2aa2a437b28389..fed3073088acc6d72f9bb1865365b69cc935809e 100644 (file)
@@ -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.
     */
index 486b0030dcd80def5be4478d2fe594754af142e3..3391afc635c438fbfe9bef5a0d983f723bc3d28e 100644 (file)
@@ -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.
     */
index 9914b687fb8760a5cc1216897b6385555e98cc27..ea2f9f23b96eef8e48fe2ee3f1062b00093383ad 100644 (file)
@@ -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.
     */
index 300072d6d9270750a2d97ce50dbc93de6cd345f4..e0d0fdc8205dde9e2b304e7bdeffa2dc0acf6288 100644 (file)
@@ -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.
     */
index fbb14f1524ad5a33adca8ea678b02ebddefd5970..9a17f8d31f281d54c4087fd6cda35591e667237c 100644 (file)
@@ -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),