From 5d9b50e596c9d81c37ce0844ae0f8c9da3f6bea6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Tue, 7 Jun 2016 13:33:34 +0300 Subject: [PATCH] glx: apple specific occurences of dummyContext check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Tapani Pälli Reviewed-by: Jeremy Huddleston Sequoia Cc: Jeremy Huddleston Sequoia --- src/glx/apple/apple_xgl_api_stereo.c | 4 ++-- src/glx/apple/apple_xgl_api_viewport.c | 2 +- src/glx/glxcmds.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glx/apple/apple_xgl_api_stereo.c b/src/glx/apple/apple_xgl_api_stereo.c index 4b21aaf79ef..0d2f6fa6531 100644 --- a/src/glx/apple/apple_xgl_api_stereo.c +++ b/src/glx/apple/apple_xgl_api_stereo.c @@ -54,7 +54,7 @@ __applegl_glDrawBuffer(GLenum mode) { struct glx_context * gc = __glXGetCurrentContext(); - if (gc && apple_glx_context_uses_stereo(gc->driContext)) { + if (gc != &dummyContext && apple_glx_context_uses_stereo(gc->driContext)) { GLenum buf[2]; GLsizei n = 0; @@ -89,7 +89,7 @@ __applegl_glDrawBuffers(GLsizei n, const GLenum * bufs) { struct glx_context * gc = __glXGetCurrentContext(); - if (gc && apple_glx_context_uses_stereo(gc->driContext)) { + if (gc != &dummyContext && apple_glx_context_uses_stereo(gc->driContext)) { GLenum newbuf[n + 2]; GLsizei i, outi = 0; bool have_back = false; diff --git a/src/glx/apple/apple_xgl_api_viewport.c b/src/glx/apple/apple_xgl_api_viewport.c index 281c90c6bbd..c40061df490 100644 --- a/src/glx/apple/apple_xgl_api_viewport.c +++ b/src/glx/apple/apple_xgl_api_viewport.c @@ -41,7 +41,7 @@ __applegl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) struct glx_context *gc = __glXGetCurrentContext(); Display *dpy = glXGetCurrentDisplay(); - if (gc && gc->driContext) + if (gc != &dummyContext && gc->driContext) apple_glx_context_update(dpy, gc->driContext); __ogl_framework_api->Viewport(x, y, width, height); diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 8191da03616..ebb8bc6af7d 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -820,7 +820,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable) { #ifdef GLX_USE_APPLEGL struct glx_context * gc = __glXGetCurrentContext(); - if(gc && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) { + if(gc != &DummyContext && apple_glx_is_current_drawable(dpy, gc->driContext, drawable)) { apple_glx_swap_buffers(gc->driContext); } else { __glXSendError(dpy, GLXBadCurrentWindow, 0, X_GLXSwapBuffers, false); -- 2.30.2