ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtimg.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtimg.C (file contents):
Revision 1.35 by root, Thu Jun 7 08:36:53 2012 UTC vs.
Revision 1.36 by root, Thu Jun 7 08:45:34 2012 UTC

113 Display *dpy = s->display->dpy; 113 Display *dpy = s->display->dpy;
114 114
115 XRenderPictureAttributes pa; 115 XRenderPictureAttributes pa;
116 pa.repeat = repeat; 116 pa.repeat = repeat;
117 Picture pic = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa); 117 Picture pic = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa);
118
119 XRectangle clip = { -x, -y, min (w, ref->w), min (h, ref->h) };
120 XRenderSetPictureClipRectangles (dpy, pic, 0, 0, &clip, 1);
121 118
122 return pic; 119 return pic;
123} 120}
124 121
125void 122void
419} 416}
420 417
421rxvt_img * 418rxvt_img *
422rxvt_img::sub_rect (int x, int y, int width, int height) 419rxvt_img::sub_rect (int x, int y, int width, int height)
423{ 420{
421 bool need_reify = w < width || h < height;
422
424 rxvt_img *img = clone (); 423 rxvt_img *img = clone ();
425
426 //TODO: width > w, must reify
427 424
428 img->x += x; 425 img->x += x;
429 img->y += y; 426 img->y += y;
430 img->w = width; 427 img->w = width;
431 img->h = height; 428 img->h = height;
429
430 if (need_reify)
431 img->reify ();
432 432
433 return img; 433 return img;
434} 434}
435 435
436rxvt_img * 436rxvt_img *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines