glxdriswrast: Use CreateGC, not CreateScratchGC.
Since this code was using CreateScratchGC and not GetScratchGC, FreeScratchGC would always call FreeGC, so just call it directly. As long as the drawable provided to CreateGC has the same screen and depth as were passed to CreateScratchGC, these functions are basically identical. There are two differences: - CreateGC gives you a non-null stipple. You probably don't care. - CreateGC passes the gcid and client to XACE. There are several internal GCs allocated in the server, and they all pass 0 and serverClient. I expect XACE will never reject that combination. The callers of createDrawable all verify that pDraw has the same screen that driScreen does. In short, this should have no behavioral change. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
af2a94e12f
commit
0f48e362c5
|
@ -99,8 +99,8 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
|
||||||
|
|
||||||
(*core->destroyDrawable)(private->driDrawable);
|
(*core->destroyDrawable)(private->driDrawable);
|
||||||
|
|
||||||
FreeScratchGC(private->gc);
|
FreeGC(private->gc, (GContext)0);
|
||||||
FreeScratchGC(private->swapgc);
|
FreeGC(private->swapgc, (GContext)0);
|
||||||
|
|
||||||
__glXDrawableRelease(drawable);
|
__glXDrawableRelease(drawable);
|
||||||
|
|
||||||
|
@ -301,13 +301,12 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
|
||||||
XID glxDrawId,
|
XID glxDrawId,
|
||||||
__GLXconfig *glxConfig)
|
__GLXconfig *glxConfig)
|
||||||
{
|
{
|
||||||
ChangeGCVal gcvals[2];
|
XID gcvals[2];
|
||||||
|
int status;
|
||||||
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
|
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
|
||||||
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
|
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
|
||||||
__GLXDRIdrawable *private;
|
__GLXDRIdrawable *private;
|
||||||
|
|
||||||
ScreenPtr pScreen = driScreen->base.pScreen;
|
|
||||||
|
|
||||||
private = calloc(1, sizeof *private);
|
private = calloc(1, sizeof *private);
|
||||||
if (private == NULL)
|
if (private == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -323,13 +322,10 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
|
||||||
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
|
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
|
||||||
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
|
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
|
||||||
|
|
||||||
private->gc = CreateScratchGC(pScreen, pDraw->depth);
|
gcvals[0] = GXcopy;
|
||||||
private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
|
private->gc = CreateGC(pDraw, GCFunction, gcvals, &status, (XID)0, serverClient);
|
||||||
|
gcvals[1] = FALSE;
|
||||||
gcvals[0].val = GXcopy;
|
private->swapgc = CreateGC(pDraw, GCFunction | GCGraphicsExposures, gcvals, &status, (XID)0, serverClient);
|
||||||
ChangeGC(NullClient, private->gc, GCFunction, gcvals);
|
|
||||||
gcvals[1].val = FALSE;
|
|
||||||
ChangeGC(NullClient, private->swapgc, GCFunction | GCGraphicsExposures, gcvals);
|
|
||||||
|
|
||||||
private->driDrawable =
|
private->driDrawable =
|
||||||
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
|
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user