X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Ftwang.c;h=ae589ad662c75a8e24fbccaf33039ecc2fafb144;hp=7d52a411156bda8047298f13ba6ea15d3acf6514;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c diff --git a/hacks/twang.c b/hacks/twang.c index 7d52a411..ae589ad6 100644 --- a/hacks/twang.c +++ b/hacks/twang.c @@ -15,10 +15,7 @@ #include #include "screenhack.h" - -#ifdef HAVE_XSHM_EXTENSION #include "xshm.h" -#endif #define FLOAT double @@ -80,10 +77,7 @@ struct state { async_load_state *img_loader; Pixmap pm; - Bool useShm; /* whether or not to use xshm */ -#ifdef HAVE_XSHM_EXTENSION XShmSegmentInfo shmInfo; -#endif }; @@ -131,28 +125,12 @@ grabImage_done (struct state *st) st->windowWidth, st->windowHeight, ~0L, ZPixmap); - if (st->workImage) XDestroyImage (st->workImage); - st->workImage = NULL; - -#ifdef HAVE_XSHM_EXTENSION - if (st->useShm) - { - st->workImage = create_xshm_image (st->dpy, xwa.visual, xwa.depth, - ZPixmap, 0, &st->shmInfo, - st->windowWidth, st->windowHeight); - if (!st->workImage) - { - st->useShm = False; - fprintf (stderr, "create_xshm_image failed\n"); - } - } - - if (st->workImage == NULL) -#endif /* HAVE_XSHM_EXTENSION */ + if (st->workImage) destroy_xshm_image (st->dpy, st->workImage, + &st->shmInfo); - /* just use XSubImage to acquire the right visual, depth, etc; - * easier than the other alternatives */ - st->workImage = XSubImage (st->sourceImage, 0, 0, st->windowWidth, st->windowHeight); + st->workImage = create_xshm_image (st->dpy, xwa.visual, xwa.depth, + ZPixmap, &st->shmInfo, + st->windowWidth, st->windowHeight); } /* set up the system */ @@ -537,14 +515,8 @@ static void renderFrame (struct state *st) renderTile (st, st->sortedTiles[n]); } -#ifdef HAVE_XSHM_EXTENSION - if (st->useShm) - XShmPutImage (st->dpy, st->window, st->backgroundGC, st->workImage, 0, 0, 0, 0, - st->windowWidth, st->windowHeight, False); - else -#endif /* HAVE_XSHM_EXTENSION */ - XPutImage (st->dpy, st->window, st->backgroundGC, st->workImage, - 0, 0, 0, 0, st->windowWidth, st->windowHeight); + put_xshm_image (st->dpy, st->window, st->backgroundGC, st->workImage, 0, 0, 0, 0, + st->windowWidth, st->windowHeight, &st->shmInfo); } /* set up the model */ @@ -734,10 +706,6 @@ static void initParams (struct state *st) problems = 1; } -#ifdef HAVE_XSHM_EXTENSION - st->useShm = get_boolean_resource (st->dpy, "useSHM", "Boolean"); -#endif - if (problems) { exit (1);