… | |
… | |
397 | rxvt_img::reify () |
397 | rxvt_img::reify () |
398 | { |
398 | { |
399 | if (x == 0 && y == 0 && w == ref->w && h == ref->h) |
399 | if (x == 0 && y == 0 && w == ref->w && h == ref->h) |
400 | return clone (); |
400 | return clone (); |
401 | |
401 | |
402 | rxvt_img *img = new rxvt_img (s, format, 0, 0, w, h); |
402 | Display *dpy = s->display->dpy; |
|
|
403 | |
|
|
404 | bool alpha = !format->direct.alphaMask |
|
|
405 | && (x || y) |
|
|
406 | && repeat == RepeatNone; |
|
|
407 | |
|
|
408 | rxvt_img *img = new rxvt_img (s, alpha ? XRenderFindStandardFormat (dpy, PictStandardARGB32) : format, 0, 0, w, h); |
403 | img->alloc (); |
409 | img->alloc (); |
404 | |
|
|
405 | Display *dpy = s->display->dpy; |
|
|
406 | |
410 | |
407 | Picture src = src_picture (); |
411 | Picture src = src_picture (); |
408 | Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0); |
412 | Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0); |
409 | |
413 | |
410 | XRenderComposite (dpy, PictOpSrc, src, None, dst, x, y, 0, 0, 0, 0, w, h); |
414 | XRenderComposite (dpy, PictOpSrc, src, None, dst, x, y, 0, 0, 0, 0, w, h); |
… | |
… | |
426 | if (w != width || h != height) |
430 | if (w != width || h != height) |
427 | { |
431 | { |
428 | img->w = width; |
432 | img->w = width; |
429 | img->h = height; |
433 | img->h = height; |
430 | |
434 | |
431 | img->reify (); |
435 | rxvt_img *img2 = img->reify (); |
|
|
436 | delete img; |
|
|
437 | img = img2; |
432 | } |
438 | } |
433 | |
439 | |
434 | return img; |
440 | return img; |
435 | } |
441 | } |
436 | |
442 | |
… | |
… | |
527 | rxvt_img * |
533 | rxvt_img * |
528 | rxvt_img::blend (rxvt_img *img, double factor) |
534 | rxvt_img::blend (rxvt_img *img, double factor) |
529 | { |
535 | { |
530 | rxvt_img *img2 = clone (); |
536 | rxvt_img *img2 = clone (); |
531 | Display *dpy = s->display->dpy; |
537 | Display *dpy = s->display->dpy; |
532 | Picture src = src_picture (); |
538 | Picture src = img->src_picture (); |
533 | Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); |
539 | Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); |
534 | Picture mask = create_xrender_mask (dpy, img->pm, False); |
540 | Picture mask = create_xrender_mask (dpy, img->pm, False); |
535 | |
541 | |
536 | XRenderColor mask_c; |
542 | XRenderColor mask_c; |
537 | |
543 | |