summaryrefslogtreecommitdiff
path: root/src/egl/main/eglcontext.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-10-14 16:38:58 +0800
committerChia-I Wu <olv@lunarg.com>2010-10-14 17:16:14 +0800
commit3fa21881b18044292e7d9455e9a370a71249df22 (patch)
treed1b75b07ae9505e89895f0a862b903fbcf107f9e /src/egl/main/eglcontext.c
parent282e514240c8f514da768af6377ae61b9f79c81f (diff)
egl: Access config attributes directly.
Replace SET_CONFIG_ATTRIB/GET_CONFIG_ATTRIB by direct dereferences.
Diffstat (limited to 'src/egl/main/eglcontext.c')
-rw-r--r--src/egl/main/eglcontext.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index bc22913d40..ec35be9d3a 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -113,13 +113,12 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
err = _eglParseContextAttribList(ctx, attrib_list);
if (err == EGL_SUCCESS && ctx->Config) {
- EGLint renderable_type, api_bit;
+ EGLint api_bit;
- renderable_type = GET_CONFIG_ATTRIB(ctx->Config, EGL_RENDERABLE_TYPE);
api_bit = _eglGetContextAPIBit(ctx);
- if (!(renderable_type & api_bit)) {
+ if (!(ctx->Config->RenderableType & api_bit)) {
_eglLog(_EGL_DEBUG, "context api is 0x%x while config supports 0x%x",
- api_bit, renderable_type);
+ api_bit, ctx->Config->RenderableType);
err = EGL_BAD_CONFIG;
}
}
@@ -183,7 +182,9 @@ _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *c,
switch (attribute) {
case EGL_CONFIG_ID:
- *value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID);
+ if (!c->Config)
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
+ *value = c->Config->ConfigID;
break;
case EGL_CONTEXT_CLIENT_VERSION:
*value = c->ClientVersion;