--- rxvt-unicode/src/rxvtimg.C 2012/06/07 09:25:23 1.37 +++ rxvt-unicode/src/rxvtimg.C 2012/06/07 11:27:08 1.40 @@ -399,11 +399,15 @@ if (x == 0 && y == 0 && w == ref->w && h == ref->h) return clone (); - rxvt_img *img = new rxvt_img (s, format, 0, 0, w, h); - img->alloc (); - Display *dpy = s->display->dpy; + bool alpha = !format->direct.alphaMask + && (x || y) + && repeat == RepeatNone; + + rxvt_img *img = new rxvt_img (s, alpha ? XRenderFindStandardFormat (dpy, PictStandardARGB32) : format, 0, 0, w, h); + img->alloc (); + Picture src = src_picture (); Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0); @@ -428,7 +432,9 @@ img->w = width; img->h = height; - img->reify (); + rxvt_img *img2 = img->reify (); + delete img; + img = img2; } return img; @@ -529,7 +535,7 @@ { rxvt_img *img2 = clone (); Display *dpy = s->display->dpy; - Picture src = src_picture (); + Picture src = img->src_picture (); Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); Picture mask = create_xrender_mask (dpy, img->pm, False);