forked from old/legacy-imlib2
parent
1896e7b45e
commit
ec7148bb2b
10
src/rend.c
10
src/rend.c
|
@ -35,6 +35,7 @@ __imlib_RenderImage(Display *d, ImlibImage *im,
|
|||
Context *ct;
|
||||
DATA32 *buf = NULL, *pointer = NULL, *back = NULL;
|
||||
int y, h, hh, jump;
|
||||
static Display *disp = NULL;
|
||||
static GC gc = 0;
|
||||
static GC gcm = 0;
|
||||
XGCValues gcv;
|
||||
|
@ -238,9 +239,18 @@ __imlib_RenderImage(Display *d, ImlibImage *im,
|
|||
if (buf) free(buf);
|
||||
if (scaleinfo) __imlib_FreeScaleInfo(scaleinfo);
|
||||
if (back) free(back);
|
||||
/* if we changed diplays since last time... free old gc's */
|
||||
if (disp != d)
|
||||
{
|
||||
if (gc) XFreeGC(disp, gc);
|
||||
if (gcm) XFreeGC(disp, gcm);
|
||||
gc = 0;
|
||||
gcm = 0;
|
||||
}
|
||||
/* if we didnt have a gc... create it */
|
||||
if (!gc)
|
||||
{
|
||||
disp = d;
|
||||
gcv.graphics_exposures = False;
|
||||
gc = XCreateGC(d, w, GCGraphicsExposures, &gcv);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue