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:
parent
c33541e59e
commit
0b1831d043
|
@ -1807,10 +1807,10 @@ __glXDisp_BindTexImageEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
DixReadAccess, &pGlxDraw, &error))
|
DixReadAccess, &pGlxDraw, &error))
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (!context->textureFromPixmap)
|
if (!context->bindTexImage)
|
||||||
return __glXError(GLXUnsupportedPrivateRequest);
|
return __glXError(GLXUnsupportedPrivateRequest);
|
||||||
|
|
||||||
return context->textureFromPixmap->bindTexImage(context, buffer, pGlxDraw);
|
return context->bindTexImage(context, buffer, pGlxDraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1839,11 +1839,10 @@ __glXDisp_ReleaseTexImageEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
DixReadAccess, &pGlxDraw, &error))
|
DixReadAccess, &pGlxDraw, &error))
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (!context->textureFromPixmap)
|
if (!context->releaseTexImage)
|
||||||
return __glXError(GLXUnsupportedPrivateRequest);
|
return __glXError(GLXUnsupportedPrivateRequest);
|
||||||
|
|
||||||
return context->textureFromPixmap->releaseTexImage(context,
|
return context->releaseTexImage(context, buffer, pGlxDraw);
|
||||||
buffer, pGlxDraw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -35,14 +35,6 @@
|
||||||
* Silicon Graphics, Inc.
|
* 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 {
|
struct __GLXcontext {
|
||||||
void (*destroy) (__GLXcontext * context);
|
void (*destroy) (__GLXcontext * context);
|
||||||
int (*makeCurrent) (__GLXcontext * context);
|
int (*makeCurrent) (__GLXcontext * context);
|
||||||
|
@ -50,7 +42,11 @@ struct __GLXcontext {
|
||||||
int (*copy) (__GLXcontext * dst, __GLXcontext * src, unsigned long mask);
|
int (*copy) (__GLXcontext * dst, __GLXcontext * src, unsigned long mask);
|
||||||
Bool (*wait) (__GLXcontext * context, __GLXclientState * cl, int *error);
|
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
|
** list of context structs
|
||||||
|
|
|
@ -335,11 +335,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
|
|
||||||
__glXDRIbindTexImage,
|
|
||||||
__glXDRIreleaseTexImage
|
|
||||||
};
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
|
dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
|
||||||
const uint32_t *attribs,
|
const uint32_t *attribs,
|
||||||
|
@ -561,7 +556,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
|
||||||
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
|
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
|
||||||
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
|
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
|
||||||
context->base.copy = __glXDRIcontextCopy;
|
context->base.copy = __glXDRIcontextCopy;
|
||||||
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
|
context->base.bindTexImage = __glXDRIbindTexImage;
|
||||||
|
context->base.releaseTexImage = __glXDRIreleaseTexImage;
|
||||||
context->base.wait = __glXDRIcontextWait;
|
context->base.wait = __glXDRIcontextWait;
|
||||||
|
|
||||||
create_driver_context(context, screen, config, driShare, num_attribs,
|
create_driver_context(context, screen, config, driShare, num_attribs,
|
||||||
|
|
|
@ -208,11 +208,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
|
|
||||||
__glXDRIbindTexImage,
|
|
||||||
__glXDRIreleaseTexImage
|
|
||||||
};
|
|
||||||
|
|
||||||
static __GLXcontext *
|
static __GLXcontext *
|
||||||
__glXDRIscreenCreateContext(__GLXscreen * baseScreen,
|
__glXDRIscreenCreateContext(__GLXscreen * baseScreen,
|
||||||
__GLXconfig * glxConfig,
|
__GLXconfig * glxConfig,
|
||||||
|
@ -248,7 +243,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
|
||||||
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
|
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
|
||||||
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
|
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
|
||||||
context->base.copy = __glXDRIcontextCopy;
|
context->base.copy = __glXDRIcontextCopy;
|
||||||
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
|
context->base.bindTexImage = __glXDRIbindTexImage;
|
||||||
|
context->base.releaseTexImage = __glXDRIreleaseTexImage;
|
||||||
|
|
||||||
context->driContext =
|
context->driContext =
|
||||||
(*core->createNewContext) (screen->driScreen,
|
(*core->createNewContext) (screen->driScreen,
|
||||||
|
|
|
@ -1522,11 +1522,6 @@ glxWinCreateContext(__GLXscreen * screen,
|
||||||
__GLXWinContext *context;
|
__GLXWinContext *context;
|
||||||
__GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext;
|
__GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext;
|
||||||
|
|
||||||
static __GLXtextureFromPixmap glxWinTextureFromPixmap = {
|
|
||||||
glxWinBindTexImage,
|
|
||||||
glxWinReleaseTexImage
|
|
||||||
};
|
|
||||||
|
|
||||||
context = calloc(1, sizeof(__GLXWinContext));
|
context = calloc(1, sizeof(__GLXWinContext));
|
||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
|
@ -1537,7 +1532,8 @@ glxWinCreateContext(__GLXscreen * screen,
|
||||||
context->base.makeCurrent = glxWinContextMakeCurrent;
|
context->base.makeCurrent = glxWinContextMakeCurrent;
|
||||||
context->base.loseCurrent = glxWinContextLoseCurrent;
|
context->base.loseCurrent = glxWinContextLoseCurrent;
|
||||||
context->base.copy = glxWinContextCopy;
|
context->base.copy = glxWinContextCopy;
|
||||||
context->base.textureFromPixmap = &glxWinTextureFromPixmap;
|
context->base.bindTexImage = glxWinBindTexImage;
|
||||||
|
context->base.releaseTexImage = glxWinReleaseTexImage;
|
||||||
context->base.config = modes;
|
context->base.config = modes;
|
||||||
context->base.pGlxScreen = screen;
|
context->base.pGlxScreen = screen;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue