glx: Remove some indirection around EXT_texture_from_pixmap

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Adam Jackson 2017-06-16 15:44:49 -04:00
parent c33541e59e
commit 0b1831d043
5 changed files with 15 additions and 32 deletions

View File

@ -1807,10 +1807,10 @@ __glXDisp_BindTexImageEXT(__GLXclientState * cl, GLbyte * pc)
DixReadAccess, &pGlxDraw, &error))
return error;
if (!context->textureFromPixmap)
if (!context->bindTexImage)
return __glXError(GLXUnsupportedPrivateRequest);
return context->textureFromPixmap->bindTexImage(context, buffer, pGlxDraw);
return context->bindTexImage(context, buffer, pGlxDraw);
}
int
@ -1839,11 +1839,10 @@ __glXDisp_ReleaseTexImageEXT(__GLXclientState * cl, GLbyte * pc)
DixReadAccess, &pGlxDraw, &error))
return error;
if (!context->textureFromPixmap)
if (!context->releaseTexImage)
return __glXError(GLXUnsupportedPrivateRequest);
return context->textureFromPixmap->releaseTexImage(context,
buffer, pGlxDraw);
return context->releaseTexImage(context, buffer, pGlxDraw);
}
int

View File

@ -35,14 +35,6 @@
* Silicon Graphics, Inc.
*/
typedef struct __GLXtextureFromPixmap __GLXtextureFromPixmap;
struct __GLXtextureFromPixmap {
int (*bindTexImage) (__GLXcontext * baseContext,
int buffer, __GLXdrawable * pixmap);
int (*releaseTexImage) (__GLXcontext * baseContext,
int buffer, __GLXdrawable * pixmap);
};
struct __GLXcontext {
void (*destroy) (__GLXcontext * context);
int (*makeCurrent) (__GLXcontext * context);
@ -50,7 +42,11 @@ struct __GLXcontext {
int (*copy) (__GLXcontext * dst, __GLXcontext * src, unsigned long mask);
Bool (*wait) (__GLXcontext * context, __GLXclientState * cl, int *error);
__GLXtextureFromPixmap *textureFromPixmap;
/* EXT_texture_from_pixmap */
int (*bindTexImage) (__GLXcontext * baseContext,
int buffer, __GLXdrawable * pixmap);
int (*releaseTexImage) (__GLXcontext * baseContext,
int buffer, __GLXdrawable * pixmap);
/*
** list of context structs

View File

@ -335,11 +335,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
return Success;
}
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIbindTexImage,
__glXDRIreleaseTexImage
};
static Bool
dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
const uint32_t *attribs,
@ -561,7 +556,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->base.bindTexImage = __glXDRIbindTexImage;
context->base.releaseTexImage = __glXDRIreleaseTexImage;
context->base.wait = __glXDRIcontextWait;
create_driver_context(context, screen, config, driShare, num_attribs,

View File

@ -208,11 +208,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
return Success;
}
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIbindTexImage,
__glXDRIreleaseTexImage
};
static __GLXcontext *
__glXDRIscreenCreateContext(__GLXscreen * baseScreen,
__GLXconfig * glxConfig,
@ -248,7 +243,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
context->base.copy = __glXDRIcontextCopy;
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
context->base.bindTexImage = __glXDRIbindTexImage;
context->base.releaseTexImage = __glXDRIreleaseTexImage;
context->driContext =
(*core->createNewContext) (screen->driScreen,

View File

@ -1522,11 +1522,6 @@ glxWinCreateContext(__GLXscreen * screen,
__GLXWinContext *context;
__GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext;
static __GLXtextureFromPixmap glxWinTextureFromPixmap = {
glxWinBindTexImage,
glxWinReleaseTexImage
};
context = calloc(1, sizeof(__GLXWinContext));
if (!context)
@ -1537,7 +1532,8 @@ glxWinCreateContext(__GLXscreen * screen,
context->base.makeCurrent = glxWinContextMakeCurrent;
context->base.loseCurrent = glxWinContextLoseCurrent;
context->base.copy = glxWinContextCopy;
context->base.textureFromPixmap = &glxWinTextureFromPixmap;
context->base.bindTexImage = glxWinBindTexImage;
context->base.releaseTexImage = glxWinReleaseTexImage;
context->base.config = modes;
context->base.pGlxScreen = screen;