From f7ad81737bd87d47218e6294f03ede2c4108d3a3 Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Wed, 13 Mar 2013 20:01:12 +0100 Subject: wayland: remove asserts from egl_create_context Instead of assert return false on most check. Removes the redundant second inclusion of the assert header. --- video/out/gl_common.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'video') diff --git a/video/out/gl_common.c b/video/out/gl_common.c index c2e3fed7e6..43e8c0de78 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -1312,7 +1312,6 @@ static void swapGlBuffers_x11(MPGLContext *ctx) #include #include #include -#include struct egl_context { EGLSurface egl_surface; @@ -1377,13 +1376,11 @@ static bool egl_create_context(struct vo_wayland_state *wl, MPGLContext *ctx) { EGLint major, minor, n; - EGLBoolean ret; GL *gl = ctx->gl; const char *eglstr = ""; - egl_ctx->egl.dpy = eglGetDisplay(wl->display->display); - if (!egl_ctx->egl.dpy) + if (!(egl_ctx->egl.dpy = eglGetDisplay(wl->display->display))) return false; EGLint config_attribs[] = { @@ -1398,8 +1395,7 @@ static bool egl_create_context(struct vo_wayland_state *wl, }; /* major and minor here returns the supported EGL version (e.g.: 1.4) */ - ret = eglInitialize(egl_ctx->egl.dpy, &major, &minor); - if (ret != EGL_TRUE) + if (eglInitialize(egl_ctx->egl.dpy, &major, &minor) != EGL_TRUE) return false; EGLint context_attribs[] = { @@ -1412,12 +1408,11 @@ static bool egl_create_context(struct vo_wayland_state *wl, EGL_NONE }; - ret = eglBindAPI(EGL_OPENGL_API); - assert(ret == EGL_TRUE); + if (eglBindAPI(EGL_OPENGL_API) != EGL_TRUE) + return false; - ret = eglChooseConfig(egl_ctx->egl.dpy, config_attribs, - &egl_ctx->egl.conf, 1, &n); - assert(ret && n == 1); + eglChooseConfig(egl_ctx->egl.dpy, config_attribs, + &egl_ctx->egl.conf, 1, &n); egl_ctx->egl.ctx = eglCreateContext(egl_ctx->egl.dpy, egl_ctx->egl.conf, @@ -1426,12 +1421,7 @@ static bool egl_create_context(struct vo_wayland_state *wl, if (!egl_ctx->egl.ctx) return false; - ret = eglMakeCurrent(egl_ctx->egl.dpy, - NULL, - NULL, - egl_ctx->egl.ctx); - - assert(ret == EGL_TRUE); + eglMakeCurrent(egl_ctx->egl.dpy, NULL, NULL, egl_ctx->egl.ctx); eglstr = eglQueryString(egl_ctx->egl.dpy, EGL_EXTENSIONS); -- cgit v1.2.3