diff options
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri/egldri.c | 4 | ||||
-rw-r--r-- | src/egl/main/egldriver.c | 18 | ||||
-rw-r--r-- | src/egl/main/egldriver.h | 21 |
3 files changed, 25 insertions, 18 deletions
diff --git a/src/egl/drivers/dri/egldri.c b/src/egl/drivers/dri/egldri.c index 2e8c7451bb..d9dc29cd8d 100644 --- a/src/egl/drivers/dri/egldri.c +++ b/src/egl/drivers/dri/egldri.c @@ -1117,6 +1117,6 @@ _eglDRIInitDriverFallbacks(_EGLDriver *drv) drv->API.SwapBuffers = _eglDRISwapBuffers; /* enable supported extensions */ - drv->MESA_screen_surface = EGL_TRUE; - drv->MESA_copy_context = EGL_TRUE; + drv->Extensions.MESA_screen_surface = EGL_TRUE; + drv->Extensions.MESA_copy_context = EGL_TRUE; } diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index e2cc0692bc..2b9034dbcf 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -201,15 +201,15 @@ _eglInitDriverFallbacks(_EGLDriver *drv) * the driver's Extensions string. */ static void -UpdateExtensionsString(_EGLDriver *drv) +_eglUpdateExtensionsString(_EGLDriver *drv) { - drv->Extensions[0] = 0; + drv->Extensions.String[0] = 0; - if (drv->MESA_screen_surface) - strcat(drv->Extensions, "EGL_MESA_screen_surface "); - if (drv->MESA_copy_context) - strcat(drv->Extensions, "EGL_MESA_copy_context "); - assert(strlen(drv->Extensions) < MAX_EXTENSIONS_LEN); + if (drv->Extensions.MESA_screen_surface) + strcat(drv->Extensions.String, "EGL_MESA_screen_surface "); + if (drv->Extensions.MESA_copy_context) + strcat(drv->Extensions.String, "EGL_MESA_copy_context "); + assert(strlen(drv->Extensions.String) < MAX_EXTENSIONS_LEN); } @@ -225,8 +225,8 @@ _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name) case EGL_VERSION: return "1.0"; case EGL_EXTENSIONS: - UpdateExtensionsString(drv); - return drv->Extensions; + _eglUpdateExtensionsString(drv); + return drv->Extensions.String; default: _eglError(EGL_BAD_PARAMETER, "eglQueryString"); return NULL; diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index 6d2d7075cd..51ec27c06f 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -5,11 +5,23 @@ #include "egltypedefs.h" #include "eglapi.h" -/* should probably use a dynamic-lengh string, but this will do */ +/* should probably use a dynamic-length string, but this will do */ #define MAX_EXTENSIONS_LEN 1000 /** + * Optional EGL extensions info. + */ +struct _egl_extensions +{ + EGLBoolean MESA_screen_surface; + EGLBoolean MESA_copy_context; + + char String[MAX_EXTENSIONS_LEN]; +}; + + +/** * Base class for device drivers. */ struct _egl_driver @@ -25,12 +37,7 @@ struct _egl_driver _EGLAPI API; - /* Extension enable flags */ - EGLBoolean MESA_screen_surface; - EGLBoolean MESA_copy_context; - - /* Extensions string */ - char Extensions[MAX_EXTENSIONS_LEN]; + _EGLExtensions Extensions; }; |