summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-19 14:03:19 -0700
committerJamey Sharp <jamey@minilop.net>2010-09-13 15:58:08 -0700
commit0f48e362c5baee2bc281a4b88cfb68de24172d15 (patch)
tree961db51c2279158663a1076fb38c9d768d4fce6f /glx
parentaf2a94e12fe4e426dfca461a0d14526193c01cef (diff)
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>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxdriswrast.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 54f4440a3..dc12f5705 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -99,8 +99,8 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
(*core->destroyDrawable)(private->driDrawable);
- FreeScratchGC(private->gc);
- FreeScratchGC(private->swapgc);
+ FreeGC(private->gc, (GContext)0);
+ FreeGC(private->swapgc, (GContext)0);
__glXDrawableRelease(drawable);
@@ -301,13 +301,12 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
XID glxDrawId,
__GLXconfig *glxConfig)
{
- ChangeGCVal gcvals[2];
+ XID gcvals[2];
+ int status;
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
- ScreenPtr pScreen = driScreen->base.pScreen;
-
private = calloc(1, sizeof *private);
if (private == NULL)
return NULL;
@@ -323,13 +322,10 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
- private->gc = CreateScratchGC(pScreen, pDraw->depth);
- private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
-
- gcvals[0].val = GXcopy;
- ChangeGC(NullClient, private->gc, GCFunction, gcvals);
- gcvals[1].val = FALSE;
- ChangeGC(NullClient, private->swapgc, GCFunction | GCGraphicsExposures, gcvals);
+ 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,