summaryrefslogtreecommitdiff
path: root/src/glx/glxcurrent.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-11-14 15:13:02 -0500
committerAdam Jackson <ajax@redhat.com>2017-12-01 15:46:46 -0500
commit75d5d22fb790d856809a9dd896ffc22a268d1d96 (patch)
treef877671b7df53ec2ef745905ae3ea67724d14674 /src/glx/glxcurrent.c
parentbcb15bee52aff0faae37d4b933f462735ccb918b (diff)
downloadmesa-75d5d22fb790d856809a9dd896ffc22a268d1d96.tar.gz
mesa-75d5d22fb790d856809a9dd896ffc22a268d1d96.tar.bz2
mesa-75d5d22fb790d856809a9dd896ffc22a268d1d96.zip
glx: Use __glXSendError instead of open-coding it
This also fixes a bug, the error path through MakeCurrent didn't translate the error code by the extension's error base. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/glx/glxcurrent.c')
-rw-r--r--src/glx/glxcurrent.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index d1193265f90..fd04929b89f 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -36,8 +36,8 @@
#include <pthread.h>
#include "glxclient.h"
-
#include "glapi.h"
+#include "glx_error.h"
/*
** We setup some dummy structures here so that the API can be used
@@ -165,21 +165,6 @@ glXGetCurrentDrawable(void)
return gc->currentDrawable;
}
-static void
-__glXGenerateError(Display * dpy, XID resource,
- BYTE errorCode, CARD16 minorCode)
-{
- xError error;
-
- error.errorCode = errorCode;
- error.resourceID = resource;
- error.sequenceNumber = dpy->request;
- error.type = X_Error;
- error.majorCode = __glXSetupForCommand(dpy);
- error.minorCode = minorCode;
- _XError(dpy, &error);
-}
-
/**
* Make a particular context current.
*
@@ -228,7 +213,8 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
if (gc->vtable->bind(gc, oldGC, draw, read) != Success) {
__glXSetCurrentContextNull();
__glXUnlock();
- __glXGenerateError(dpy, None, GLXBadContext, X_GLXMakeContextCurrent);
+ __glXSendError(dpy, GLXBadContext, None, X_GLXMakeContextCurrent,
+ False);
return GL_FALSE;
}