… | |
… | |
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 | |
125 | void |
122 | void |
… | |
… | |
421 | rxvt_img * |
418 | rxvt_img * |
422 | rxvt_img::sub_rect (int x, int y, int width, int height) |
419 | rxvt_img::sub_rect (int x, int y, int width, int height) |
423 | { |
420 | { |
424 | rxvt_img *img = clone (); |
421 | rxvt_img *img = clone (); |
425 | |
422 | |
426 | //TODO: width > w, must reify |
|
|
427 | |
|
|
428 | img->x += x; |
423 | img->x += x; |
429 | img->y += y; |
424 | img->y += y; |
|
|
425 | |
|
|
426 | if (w != width || h != height) |
|
|
427 | { |
430 | img->w = width; |
428 | img->w = width; |
431 | img->h = height; |
429 | img->h = height; |
|
|
430 | |
|
|
431 | img->reify (); |
|
|
432 | } |
432 | |
433 | |
433 | return img; |
434 | return img; |
434 | } |
435 | } |
435 | |
436 | |
436 | rxvt_img * |
437 | rxvt_img * |
… | |
… | |
526 | rxvt_img * |
527 | rxvt_img * |
527 | rxvt_img::blend (rxvt_img *img, double factor) |
528 | rxvt_img::blend (rxvt_img *img, double factor) |
528 | { |
529 | { |
529 | rxvt_img *img2 = clone (); |
530 | rxvt_img *img2 = clone (); |
530 | Display *dpy = s->display->dpy; |
531 | Display *dpy = s->display->dpy; |
531 | Picture src = src_picture (); |
532 | Picture src = img->src_picture (); |
532 | Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); |
533 | Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); |
533 | Picture mask = create_xrender_mask (dpy, img->pm, False); |
534 | Picture mask = create_xrender_mask (dpy, img->pm, False); |
534 | |
535 | |
535 | XRenderColor mask_c; |
536 | XRenderColor mask_c; |
536 | |
537 | |