diff options
Diffstat (limited to 'xserver/glx/glxdriswrast.c')
-rw-r--r-- | xserver/glx/glxdriswrast.c | 55 |
1 files changed, 14 insertions, 41 deletions
diff --git a/xserver/glx/glxdriswrast.c b/xserver/glx/glxdriswrast.c index e310fda75..2858312de 100644 --- a/xserver/glx/glxdriswrast.c +++ b/xserver/glx/glxdriswrast.c @@ -71,8 +71,6 @@ struct __GLXDRIscreen { const __DRIcopySubBufferExtension *copySubBuffer; const __DRItexBufferExtension *texBuffer; const __DRIconfig **driConfigs; - - unsigned char glx_enable_bits[__GLX_EXT_BYTES]; }; struct __GLXDRIcontext { @@ -84,9 +82,6 @@ struct __GLXDRIdrawable { __GLXdrawable base; __DRIdrawable *driDrawable; __GLXDRIscreen *screen; - - GCPtr gc; /* scratch GC for span drawing */ - GCPtr swapgc; /* GC for swapping the color buffers */ }; /* white lie */ @@ -100,9 +95,6 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable) (*core->destroyDrawable) (private->driDrawable); - FreeGC(private->gc, (GContext) 0); - FreeGC(private->swapgc, (GContext) 0); - __glXDrawableRelease(drawable); free(private); @@ -208,11 +200,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext, return Success; } -static __GLXtextureFromPixmap __glXDRItextureFromPixmap = { - __glXDRIbindTexImage, - __glXDRIreleaseTexImage -}; - static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, @@ -224,6 +211,7 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; __GLXDRIcontext *context, *shareContext; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; + const __DRIconfig *driConfig = config ? config->driConfig : NULL; const __DRIcoreExtension *core = screen->core; __DRIcontext *driShare; @@ -249,11 +237,12 @@ __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, - config->driConfig, driShare, context); + (*core->createNewContext) (screen->driScreen, driConfig, driShare, + context); return &context->base; } @@ -265,8 +254,6 @@ __glXDRIscreenCreateDrawable(ClientPtr client, XID drawId, int type, XID glxDrawId, __GLXconfig * glxConfig) { - XID gcvals[2]; - int status; __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __GLXDRIdrawable *private; @@ -286,14 +273,6 @@ __glXDRIscreenCreateDrawable(ClientPtr client, private->base.swapBuffers = __glXDRIdrawableSwapBuffers; private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer; - gcvals[0] = GXcopy; - private->gc = - CreateGC(pDraw, GCFunction, gcvals, &status, (XID) 0, serverClient); - gcvals[1] = FALSE; - private->swapgc = - CreateGC(pDraw, GCFunction | GCGraphicsExposures, gcvals, &status, - (XID) 0, serverClient); - private->driDrawable = (*driScreen->swrast->createNewDrawable) (driScreen->driScreen, config->driConfig, private); @@ -323,20 +302,13 @@ swrastPutImage(__DRIdrawable * draw, int op, GCPtr gc; __GLXcontext *cx = lastGLContext; - switch (op) { - case __DRI_SWRAST_IMAGE_OP_DRAW: - gc = drawable->gc; - break; - case __DRI_SWRAST_IMAGE_OP_SWAP: - gc = drawable->swapgc; - break; - default: - return; + if ((gc = GetScratchGC(pDraw->depth, pDraw->pScreen))) { + ValidateGC(pDraw, gc); + gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap, + data); + FreeScratchGC(gc); } - ValidateGC(pDraw, gc); - - gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap, data); if (cx != lastGLContext) { lastGLContext = cx; cx->makeCurrent(cx); @@ -367,7 +339,6 @@ static const __DRIswrastLoaderExtension swrastLoaderExtension = { }; static const __DRIextension *loader_extensions[] = { - &systemTimeExtension.base, &swrastLoaderExtension.base, NULL }; @@ -380,12 +351,14 @@ initializeExtensions(__GLXscreen * screen) int i; __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); - LogMessage(X_INFO, "IGLX: enabled GLX_MESA_copy_sub_buffer\n"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_no_config_context"); if (dri->swrast->base.version >= 3) { __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context_no_error"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_create_context_es_profile"); @@ -507,7 +480,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) return NULL; } -_X_EXPORT __GLXprovider __glXDRISWRastProvider = { +__GLXprovider __glXDRISWRastProvider = { __glXDRIscreenProbe, "DRISWRAST", NULL |