summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2011-03-18 17:03:09 -0400
committerAdam Jackson <ajax@redhat.com>2011-03-28 12:46:38 -0400
commitc327d07cc68802256c679a65d78f98f17327abda (patch)
tree1160cf1ff8d1cb7291119db54ffb34bbbfc1ec5d
parenta48dadc98a28c969741979b70b7a639f24f4cbbd (diff)
glx: Remove ->forceCurrent from the context vtable
All the implementations of makeCurrent and forceCurrent are identical, so just use makeCurrent everywhere. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--glx/glxcontext.h2
-rw-r--r--glx/glxdri.c14
-rw-r--r--glx/glxdri2.c14
-rw-r--r--glx/glxdriswrast.c14
-rw-r--r--glx/glxext.c2
-rw-r--r--hw/xquartz/GL/indirect.c15
-rw-r--r--hw/xwin/glx/indirect.c8
7 files changed, 1 insertions, 68 deletions
diff --git a/glx/glxcontext.h b/glx/glxcontext.h
index 79bc083a8..65d51f507 100644
--- a/glx/glxcontext.h
+++ b/glx/glxcontext.h
@@ -53,8 +53,6 @@ struct __GLXcontext {
int (*copy) (__GLXcontext *dst,
__GLXcontext *src,
unsigned long mask);
- int (*forceCurrent) (__GLXcontext *context);
-
Bool (*wait) (__GLXcontext *context,
__GLXclientState *cl,
int *error);
diff --git a/glx/glxdri.c b/glx/glxdri.c
index 3a573372a..c87ac9a65 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -335,19 +335,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
src->driContext, mask);
}
-static int
-__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
-{
- __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
- __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
- __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
- __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
-
- return (*screen->core->bindContext)(context->driContext,
- draw->driDrawable,
- read->driDrawable);
-}
-
static void
glxFillAlphaChannel (CARD32 *pixels, CARD32 rowstride, int width, int height)
{
@@ -641,7 +628,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
- context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
/* Find the requested X visual */
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 18927d75d..e8961e255 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -283,19 +283,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
src->driContext, mask);
}
-static int
-__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
-{
- __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
- __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
- __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
- __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
-
- return (*screen->core->bindContext)(context->driContext,
- draw->driDrawable,
- read->driDrawable);
-}
-
static Bool
__glXDRIcontextWait(__GLXcontext *baseContext,
__GLXclientState *cl, int *error)
@@ -411,7 +398,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
- context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->base.wait = __glXDRIcontextWait;
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 78b24ff62..ed142c167 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -174,19 +174,6 @@ __glXDRIcontextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
src->driContext, mask);
}
-static int
-__glXDRIcontextForceCurrent(__GLXcontext *baseContext)
-{
- __GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
- __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
- __GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
- __GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
-
- return (*screen->core->bindContext)(context->driContext,
- draw->driDrawable,
- read->driDrawable);
-}
-
#ifdef __DRI_TEX_BUFFER
static int
@@ -289,7 +276,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
- context->base.forceCurrent = __glXDRIcontextForceCurrent;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->driContext =
diff --git a/glx/glxext.c b/glx/glxext.c
index 16315b876..e083c6cf8 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -420,7 +420,7 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
/* Make this context the current one for the GL. */
if (!cx->isDirect) {
- if (!(*cx->forceCurrent)(cx)) {
+ if (!(*cx->makeCurrent)(cx)) {
/* Bind failed, and set the error code. Bummer */
cl->client->errorValue = cx->id;
*error = __glXError(GLXBadContextState);
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 1375beaa6..32fb12a5f 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -174,7 +174,6 @@ static __GLXdrawable * __glXAquaScreenCreateDrawable(ClientPtr client, __GLXscre
static void __glXAquaContextDestroy(__GLXcontext *baseContext);
static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext);
static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext);
-static int __glXAquaContextForceCurrent(__GLXcontext *baseContext);
static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask);
static CGLPixelFormatObj makeFormat(__GLXconfig *conf);
@@ -235,7 +234,6 @@ __glXAquaScreenCreateContext(__GLXscreen *screen,
context->base.makeCurrent = __glXAquaContextMakeCurrent;
context->base.loseCurrent = __glXAquaContextLoseCurrent;
context->base.copy = __glXAquaContextCopy;
- context->base.forceCurrent = __glXAquaContextForceCurrent;
/*FIXME verify that the context->base is fully initialized. */
context->pixelFormat = makeFormat(conf);
@@ -458,19 +456,6 @@ static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, un
return gl_err == 0;
}
-static int __glXAquaContextForceCurrent(__GLXcontext *baseContext)
-{
- CGLError gl_err;
- __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
- GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx %p)\n", context->ctx);
-
- gl_err = CGLSetCurrentContext(context->ctx);
- if (gl_err != 0)
- ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
-
- return gl_err == 0;
-}
-
/* Drawing surface notification callbacks */
static GLboolean __glXAquaDrawableSwapBuffers(ClientPtr client, __GLXdrawable *base) {
CGLError err;
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index c9831f3ea..e32ac5102 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -1480,13 +1480,6 @@ glxWinContextCopy(__GLXcontext *dst_base, __GLXcontext *src_base, unsigned long
return ret;
}
-static int
-glxWinContextForceCurrent(__GLXcontext *base)
-{
- /* wglMakeCurrent always flushes the previous context, so this is equivalent to glxWinContextMakeCurrent */
- return glxWinContextMakeCurrent(base);
-}
-
static void
glxWinContextDestroy(__GLXcontext *base)
{
@@ -1541,7 +1534,6 @@ glxWinCreateContext(__GLXscreen *screen,
context->base.makeCurrent = glxWinContextMakeCurrent;
context->base.loseCurrent = glxWinContextLoseCurrent;
context->base.copy = glxWinContextCopy;
- context->base.forceCurrent = glxWinContextForceCurrent;
context->base.textureFromPixmap = &glxWinTextureFromPixmap;
context->base.config = modes;
context->base.pGlxScreen = screen;