--- rxvt-unicode/src/rxvtimg.C 2012/06/07 08:36:09 1.34 +++ rxvt-unicode/src/rxvtimg.C 2012/06/07 08:45:34 1.36 @@ -116,9 +116,6 @@ pa.repeat = repeat; Picture pic = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa); - XRectangle clip = { -x, -y, min (w, ref->w), min (h, ref->h) }; - XRenderSetPictureClipRectangles (dpy, pic, 0, 0, &clip, 1); - return pic; } @@ -399,12 +396,12 @@ rxvt_img * rxvt_img::reify () { + 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 (); - // todo, if x==0 and y==0 and w==real width we could clone - // but that involves an rtt to find pixmap width. - Display *dpy = s->display->dpy; Picture src = src_picture (); @@ -421,15 +418,18 @@ rxvt_img * rxvt_img::sub_rect (int x, int y, int width, int height) { - rxvt_img *img = clone (); + bool need_reify = w < width || h < height; - //TODO: width > w, must reify + rxvt_img *img = clone (); img->x += x; img->y += y; img->w = width; img->h = height; + if (need_reify) + img->reify (); + return img; }