… | |
… | |
530 | XRenderComposite (dpy, op, src, mask_p, dst, x - img->x, y - img->y, 0, 0, 0, 0, w, h); |
530 | XRenderComposite (dpy, op, src, mask_p, dst, x - img->x, y - img->y, 0, 0, 0, 0, w, h); |
531 | |
531 | |
532 | XRenderFreePicture (dpy, src); |
532 | XRenderFreePicture (dpy, src); |
533 | XRenderFreePicture (dpy, dst); |
533 | XRenderFreePicture (dpy, dst); |
534 | |
534 | |
535 | if (mask) |
535 | if (mask_p) |
536 | XRenderFreePicture (dpy, mask_p); |
536 | XRenderFreePicture (dpy, mask_p); |
537 | } |
537 | } |
538 | |
538 | |
539 | rxvt_img * |
539 | rxvt_img * |
540 | rxvt_img::clone () |
540 | rxvt_img::clone () |
… | |
… | |
563 | |
563 | |
564 | if (alpha) |
564 | if (alpha) |
565 | { |
565 | { |
566 | XRenderColor rc = { 0, 0, 0, 0 }; |
566 | XRenderColor rc = { 0, 0, 0, 0 }; |
567 | XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, w, h);//TODO: split into four fillrectangles |
567 | XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, w, h);//TODO: split into four fillrectangles |
568 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, -x, -y, ref->w, ref->h); |
568 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, x, y, ref->w, ref->h); |
569 | } |
569 | } |
570 | else |
570 | else |
571 | XRenderComposite (dpy, PictOpSrc, src, None, dst, x, y, 0, 0, 0, 0, w, h); |
571 | XRenderComposite (dpy, PictOpSrc, src, None, dst, -x, -y, 0, 0, 0, 0, w, h); |
572 | |
572 | |
573 | XRenderFreePicture (dpy, src); |
573 | XRenderFreePicture (dpy, src); |
574 | XRenderFreePicture (dpy, dst); |
574 | XRenderFreePicture (dpy, dst); |
575 | |
575 | |
576 | return img; |
576 | return img; |
… | |
… | |
579 | rxvt_img * |
579 | rxvt_img * |
580 | rxvt_img::sub_rect (int x, int y, int width, int height) |
580 | rxvt_img::sub_rect (int x, int y, int width, int height) |
581 | { |
581 | { |
582 | rxvt_img *img = clone (); |
582 | rxvt_img *img = clone (); |
583 | |
583 | |
584 | img->x += x; |
584 | img->x -= x; |
585 | img->y += y; |
585 | img->y -= y; |
586 | |
586 | |
587 | if (w != width || h != height) |
587 | if (w != width || h != height) |
588 | { |
588 | { |
589 | img->w = width; |
589 | img->w = width; |
590 | img->h = height; |
590 | img->h = height; |
… | |
… | |
630 | |
630 | |
631 | rxvt_img * |
631 | rxvt_img * |
632 | rxvt_img::transform (nv matrix[3][3]) |
632 | rxvt_img::transform (nv matrix[3][3]) |
633 | { |
633 | { |
634 | // find new offset |
634 | // find new offset |
635 | int ox = mat_apply (matrix, 0, x, y); |
635 | int ox = mat_apply (matrix, 0, -x, -y); |
636 | int oy = mat_apply (matrix, 1, x, y); |
636 | int oy = mat_apply (matrix, 1, -x, -y); |
637 | |
637 | |
638 | // calculate new pixel bounding box coordinates |
638 | // calculate new pixel bounding box coordinates |
639 | nv d [2], rmin[2], rmax[2]; |
639 | nv d [2], rmin[2], rmax[2]; |
640 | |
640 | |
641 | for (int i = 0; i < 2; ++i) |
641 | for (int i = 0; i < 2; ++i) |