diff options
Diffstat (limited to 'xorg-server/glx/glxdriswrast.c')
-rw-r--r-- | xorg-server/glx/glxdriswrast.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c index f36dae739..f8c441e65 100644 --- a/xorg-server/glx/glxdriswrast.c +++ b/xorg-server/glx/glxdriswrast.c @@ -81,7 +81,6 @@ struct __GLXDRIdrawable { __GLXDRIscreen *screen; GCPtr gc; /* scratch GC for span drawing */ - GCPtr cleargc; /* GC for clearing the color buffer */ GCPtr swapgc; /* GC for swapping the color buffers */ }; @@ -94,19 +93,11 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable) (*core->destroyDrawable)(private->driDrawable); FreeScratchGC(private->gc); - FreeScratchGC(private->cleargc); FreeScratchGC(private->swapgc); - xfree(private); -} - -static GLboolean -__glXDRIdrawableResize(__GLXdrawable *drawable) -{ - /* Nothing to do here, the DRI driver asks the server for drawable - * geometry appropriately. */ + __glXDrawableRelease(drawable); - return GL_TRUE; + xfree(private); } static GLboolean @@ -276,11 +267,10 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, else driShare = NULL; - context = xalloc(sizeof *context); + context = xcalloc(1, sizeof *context); if (context == NULL) return NULL; - memset(context, 0, sizeof *context); context->base.destroy = __glXDRIcontextDestroy; context->base.makeCurrent = __glXDRIcontextMakeCurrent; context->base.loseCurrent = __glXDRIcontextLoseCurrent; @@ -316,12 +306,10 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen, ScreenPtr pScreen = driScreen->base.pScreen; - private = xalloc(sizeof *private); + private = xcalloc(1, sizeof *private); if (private == NULL) return NULL; - memset(private, 0, sizeof *private); - private->screen = driScreen; if (!__glXDrawableInit(&private->base, screen, pDraw, type, drawId, glxConfig)) { @@ -330,16 +318,13 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen, } private->base.destroy = __glXDRIdrawableDestroy; - private->base.resize = __glXDRIdrawableResize; private->base.swapBuffers = __glXDRIdrawableSwapBuffers; private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer; private->gc = CreateScratchGC(pScreen, pDraw->depth); - private->cleargc = CreateScratchGC(pScreen, pDraw->depth); private->swapgc = CreateScratchGC(pScreen, pDraw->depth); glxChangeGC(private->gc, GCFunction, GXcopy); - glxChangeGC(private->cleargc, GCFunction, GXcopy); glxChangeGC(private->swapgc, GCFunction, GXcopy); glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE); @@ -378,9 +363,6 @@ swrastPutImage(__DRIdrawable *draw, int op, case __DRI_SWRAST_IMAGE_OP_DRAW: gc = drawable->gc; break; - case __DRI_SWRAST_IMAGE_OP_CLEAR: - gc = drawable->cleargc; - break; case __DRI_SWRAST_IMAGE_OP_SWAP: gc = drawable->swapgc; break; @@ -459,10 +441,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) const __DRIconfig **driConfigs; int i; - screen = xalloc(sizeof *screen); + screen = xcalloc(1, sizeof *screen); if (screen == NULL) return NULL; - memset(screen, 0, sizeof *screen); screen->base.destroy = __glXDRIscreenDestroy; screen->base.createContext = __glXDRIscreenCreateContext; |