From 310c76812e5a2013dad36fc9d1686f57e7b1e626 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 17 Aug 2009 15:53:54 +0800 Subject: egl: Allow binding to any client API. As a result, EGL_NONE is no longer a valid client API. And it is possible that no config supports the current bound API. Signed-off-by: Chia-I Wu --- src/egl/main/eglapi.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'src/egl/main/eglapi.c') diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 23d841d2d1..d86ef9ce56 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -92,8 +92,8 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) snprintf(disp->Version, sizeof(disp->Version), "%d.%d (%s)", major_int, minor_int, drv->Name); - /* update the global notion of supported APIs */ - _eglGlobal.ClientAPIsMask |= disp->ClientAPIsMask; + /* limit to APIs supported by core */ + disp->ClientAPIsMask &= _EGL_API_ALL_BITS; disp->Driver = drv; } else { @@ -842,33 +842,7 @@ eglBindAPI(EGLenum api) if (!_eglIsApiValid(api)) return _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - switch (api) { -#ifdef EGL_VERSION_1_4 - case EGL_OPENGL_API: - if (_eglGlobal.ClientAPIsMask & EGL_OPENGL_BIT) { - t->CurrentAPIIndex = _eglConvertApiToIndex(api); - return EGL_TRUE; - } - _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - return EGL_FALSE; -#endif - case EGL_OPENGL_ES_API: - if (_eglGlobal.ClientAPIsMask & (EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT)) { - t->CurrentAPIIndex = _eglConvertApiToIndex(api); - return EGL_TRUE; - } - _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - return EGL_FALSE; - case EGL_OPENVG_API: - if (_eglGlobal.ClientAPIsMask & EGL_OPENVG_BIT) { - t->CurrentAPIIndex = _eglConvertApiToIndex(api); - return EGL_TRUE; - } - _eglError(EGL_BAD_PARAMETER, "eglBindAPI"); - return EGL_FALSE; - default: - return EGL_FALSE; - } + t->CurrentAPIIndex = _eglConvertApiToIndex(api); return EGL_TRUE; } -- cgit v1.2.3