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