aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx/drisw_glx.c
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2019-09-26 14:42:16 -0400
committerAdam Jackson <[email protected]>2019-09-27 11:18:10 -0400
commit3c0eb762e27f9028a8f59e2fa31603292e02d9ef (patch)
tree412d6eb6226960714e197cb0fdda26e5fc1ffdc9 /src/glx/drisw_glx.c
parente4a52bd653b2e94ebbee75c541f9db99351defe2 (diff)
drisw: Simplify GC setup
There's no reason to have two GCs here. The only difference between them is that swapgc would generate graphics exposures, except we only ever use this GC for PutImage, and PutImage doesn't generate graphics exposures. We also don't need to explicitly ChangeGC to GXCopy, because that's the default. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glx/drisw_glx.c')
-rw-r--r--src/glx/drisw_glx.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index f38dbbca2df..b3e00f9a4e0 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -32,23 +32,14 @@
#include <assert.h>
static Bool
-XCreateGCs(struct drisw_drawable * pdp,
- Display * dpy, XID drawable, int visualid)
+driswCreateGCs(struct drisw_drawable * pdp,
+ Display * dpy, XID drawable, int visualid)
{
- XGCValues gcvalues;
long visMask;
XVisualInfo visTemp;
int num_visuals;
- /* create GC's */
pdp->gc = XCreateGC(dpy, drawable, 0, NULL);
- pdp->swapgc = XCreateGC(dpy, drawable, 0, NULL);
-
- gcvalues.function = GXcopy;
- gcvalues.graphics_exposures = False;
- XChangeGC(dpy, pdp->gc, GCFunction, &gcvalues);
- XChangeGC(dpy, pdp->swapgc, GCFunction, &gcvalues);
- XChangeGC(dpy, pdp->swapgc, GCGraphicsExposures, &gcvalues);
/* visual */
visTemp.visualid = visualid;
@@ -152,7 +143,6 @@ XDestroyDrawable(struct drisw_drawable * pdp, Display * dpy, XID drawable)
free(pdp->visinfo);
XFreeGC(dpy, pdp->gc);
- XFreeGC(dpy, pdp->swapgc);
}
/**
@@ -212,24 +202,13 @@ swrastXPutImage(__DRIdrawable * draw, int op,
Display *dpy = pdraw->psc->dpy;
Drawable drawable;
XImage *ximage;
- GC gc;
+ GC gc = pdp->gc;
if (!pdp->ximage || shmid != pdp->shminfo.shmid) {
if (!XCreateDrawable(pdp, shmid, dpy))
return;
}
- switch (op) {
- case __DRI_SWRAST_IMAGE_OP_DRAW:
- gc = pdp->gc;
- break;
- case __DRI_SWRAST_IMAGE_OP_SWAP:
- gc = pdp->swapgc;
- break;
- default:
- return;
- }
-
drawable = pdraw->xDrawable;
ximage = pdp->ximage;
ximage->bytes_per_line = stride ? stride : bytes_per_line(w * ximage->bits_per_pixel, 32);
@@ -699,7 +678,7 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
pdp->base.drawable = drawable;
pdp->base.psc = &psc->base;
- ret = XCreateGCs(pdp, psc->base.dpy, xDrawable, modes->visualID);
+ ret = driswCreateGCs(pdp, psc->base.dpy, xDrawable, modes->visualID);
if (!ret) {
free(pdp);
return NULL;