[Mesa-dev] [PATCH 03/15] egl: combine VersionMajor and VersionMinor into one variable

Marek Olšák maraeo at gmail.com
Tue May 12 15:54:38 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

---
 src/egl/main/eglapi.c     | 9 ++++-----
 src/egl/main/egldisplay.h | 3 +--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index d9053dc..51c2e78 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -411,8 +411,7 @@ _eglCreateAPIsString(_EGLDisplay *dpy)
 static void
 _eglComputeVersion(_EGLDisplay *disp)
 {
-   disp->VersionMajor = 1;
-   disp->VersionMinor = 4;
+   disp->Version = 14;
 }
 
 /**
@@ -455,14 +454,14 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
       _eglCreateExtensionsString(disp);
       _eglCreateAPIsString(disp);
       _eglsnprintf(disp->VersionString, sizeof(disp->VersionString),
-              "%d.%d (%s)", disp->VersionMajor, disp->VersionMinor,
+              "%d.%d (%s)", disp->Version / 10, disp->Version % 10,
               disp->Driver->Name);
    }
 
    /* Update applications version of major and minor if not NULL */
    if ((major != NULL) && (minor != NULL)) {
-      *major = disp->VersionMajor;
-      *minor = disp->VersionMinor;
+      *major = disp->Version / 10;
+      *minor = disp->Version % 10;
    }
 
    RETURN_EGL_SUCCESS(disp, EGL_TRUE);
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 36f50b9..faf6e87 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -150,8 +150,7 @@ struct _egl_display
 
    /* these fields are set by the driver during init */
    void *DriverData;          /**< Driver private data */
-   EGLint VersionMajor;       /**< EGL major version */
-   EGLint VersionMinor;       /**< EGL minor version */
+   EGLint Version;            /**< EGL version major*10+minor */
    EGLint ClientAPIs;         /**< Bitmask of APIs supported (EGL_xxx_BIT) */
    _EGLExtensions Extensions; /**< Extensions supported */
 
-- 
2.1.0



More information about the mesa-dev mailing list