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.82 by root, Thu Jun 14 17:06:57 2012 UTC vs.
Revision 1.91 by root, Fri Jun 15 13:21:59 2012 UTC

1#include <math.h> 1#include <math.h>
2#include "../config.h" 2#include "../config.h"
3#include "rxvt.h" 3#include "rxvt.h"
4 4
5#if HAVE_IMG 5#if HAVE_IMG
6
7#if 0
8struct pict
9{
10 Display *dpy;
11 Picture pic;
12
13 operator Picture () const
14 {
15 return pic;
16 }
17
18 pict ()
19 : pic (0)
20 {
21 }
22
23 pict (rxvt_img *img, XRenderPictFormat *format = 0)
24 : dpy (img->s->display->dpy)
25 {
26 XRenderPictureAttributes pa;
27 pa.repeat = img->repeat;
28 pic = XRenderCreatePicture (dpy, img->pm, format ? format : img->format, CPRepeat, &pa);
29 }
30
31 ~pict ()
32 {
33 if (pic)
34 XRenderFreePicture (dpy, pic);
35 }
36};
37#endif
38
39static XRenderPictFormat *
40find_alpha_format_for (Display *dpy, XRenderPictFormat *format)
41{
42 if (format->direct.alphaMask)
43 return format; // already has alpha
44
45 // try to find a suitable alpha format, one bit alpha is enough for our purposes
46 if (format->type == PictTypeDirect)
47 for (int n = 0; XRenderPictFormat *f = XRenderFindFormat (dpy, 0, 0, n); ++n)
48 if (f->direct.alphaMask
49 && f->type == PictTypeDirect
50 && ecb_popcount32 (f->direct.redMask ) >= ecb_popcount32 (format->direct.redMask )
51 && ecb_popcount32 (f->direct.greenMask) >= ecb_popcount32 (format->direct.greenMask)
52 && ecb_popcount32 (f->direct.blueMask ) >= ecb_popcount32 (format->direct.blueMask ))
53 return f;
54
55 // should be a very good fallback
56 return XRenderFindStandardFormat (dpy, PictStandardARGB32);
57}
6 58
7rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int x, int y, int width, int height, int repeat) 59rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int x, int y, int width, int height, int repeat)
8: s(screen), x(x), y(y), w(width), h(height), format(format), repeat(repeat), 60: s(screen), x(x), y(y), w(width), h(height), format(format), repeat(repeat),
9 pm(0), ref(0) 61 pm(0), ref(0)
10{ 62{
195 pm = XCreatePixmap (s->display->dpy, s->display->root, w, h, format->depth); 247 pm = XCreatePixmap (s->display->dpy, s->display->root, w, h, format->depth);
196 ref = new pixref (w, h); 248 ref = new pixref (w, h);
197} 249}
198 250
199Picture 251Picture
200rxvt_img::src_picture () 252rxvt_img::picture ()
201{ 253{
202 Display *dpy = s->display->dpy; 254 Display *dpy = s->display->dpy;
203 255
204 XRenderPictureAttributes pa; 256 XRenderPictureAttributes pa;
205 pa.repeat = repeat; 257 pa.repeat = repeat;
229rxvt_img::fill (const rgba &c) 281rxvt_img::fill (const rgba &c)
230{ 282{
231 XRenderColor rc = { c.r, c.g, c.b, c.a }; 283 XRenderColor rc = { c.r, c.g, c.b, c.a };
232 284
233 Display *dpy = s->display->dpy; 285 Display *dpy = s->display->dpy;
234 Picture src = src_picture (); 286 Picture src = picture ();
235 XRenderFillRectangle (dpy, PictOpSrc, src, &rc, 0, 0, w, h); 287 XRenderFillRectangle (dpy, PictOpSrc, src, &rc, 0, 0, w, h);
236 XRenderFreePicture (dpy, src); 288 XRenderFreePicture (dpy, src);
237} 289}
238 290
291void
292rxvt_img::add_alpha ()
293{
294 if (format->direct.alphaMask)
295 return;
296
297 Display *dpy = s->display->dpy;
298
299 rxvt_img *img = new rxvt_img (s, find_alpha_format_for (dpy, format), x, y, w, h, repeat);
300 img->alloc ();
301
302 Picture src = picture ();
303 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0);
304
305 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h);
306
307 XRenderFreePicture (dpy, src);
308 XRenderFreePicture (dpy, dst);
309
310 ::swap (img->ref, ref);
311 ::swap (img->pm , pm );
312
313 delete img;
314}
315
239static void 316static void
240get_gaussian_kernel (int radius, int width, double *kernel, XFixed *params) 317get_gaussian_kernel (int radius, int width, rxvt_img::nv *kernel, XFixed *params)
241{ 318{
242 double sigma = radius / 2.0; 319 rxvt_img::nv sigma = radius / 2.0;
243 double scale = sqrt (2.0 * M_PI) * sigma; 320 rxvt_img::nv scale = sqrt (2.0 * M_PI) * sigma;
244 double sum = 0.0; 321 rxvt_img::nv sum = 0.0;
245 322
246 for (int i = 0; i < width; i++) 323 for (int i = 0; i < width; i++)
247 { 324 {
248 double x = i - width / 2; 325 rxvt_img::nv x = i - width / 2;
249 kernel[i] = exp (-(x * x) / (2.0 * sigma * sigma)) / scale; 326 kernel[i] = exp (-(x * x) / (2.0 * sigma * sigma)) / scale;
250 sum += kernel[i]; 327 sum += kernel[i];
251 } 328 }
252 329
253 params[0] = XDoubleToFixed (width); 330 params[0] = XDoubleToFixed (width);
263 if (!(s->display->flags & DISPLAY_HAS_RENDER_CONV)) 340 if (!(s->display->flags & DISPLAY_HAS_RENDER_CONV))
264 return clone (); 341 return clone ();
265 342
266 Display *dpy = s->display->dpy; 343 Display *dpy = s->display->dpy;
267 int size = max (rh, rv) * 2 + 1; 344 int size = max (rh, rv) * 2 + 1;
268 double *kernel = (double *)malloc (size * sizeof (double)); 345 nv *kernel = (nv *)malloc (size * sizeof (nv));
269 XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); 346 XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed));
270 rxvt_img *img = new rxvt_img (s, format, x, y, w, h, repeat); 347 rxvt_img *img = new rxvt_img (s, format, x, y, w, h, repeat);
271 img->alloc (); 348 img->alloc ();
272 349
273 XRenderPictureAttributes pa; 350 XRenderPictureAttributes pa;
404 g = (g * (a >> 8)) >> 8; 481 g = (g * (a >> 8)) >> 8;
405 b = (b * (a >> 8)) >> 8; 482 b = (b * (a >> 8)) >> 8;
406 483
407 Display *dpy = s->display->dpy; 484 Display *dpy = s->display->dpy;
408 485
409 Picture src = src_picture (); 486 Picture src = picture ();
410 Picture dst = XRenderCreatePicture (dpy, img->pm, format, 0, 0); 487 Picture dst = XRenderCreatePicture (dpy, img->pm, format, 0, 0);
411 Picture mul = create_xrender_mask (dpy, pm, True, True); 488 Picture mul = create_xrender_mask (dpy, pm, True, True);
412 489
413 //TODO: this operator does not yet implement some useful contrast 490 //TODO: this operator does not yet implement some useful contrast
414 while (r | g | b | a) 491 while (r | g | b | a)
431 ::swap (img->pm , pm ); 508 ::swap (img->pm , pm );
432 509
433 delete img; 510 delete img;
434} 511}
435 512
513void
514rxvt_img::draw (rxvt_img *img, int op, nv mask)
515{
516 unshare ();
517
518 Display *dpy = s->display->dpy;
519 Picture src = img->picture ();
520 Picture dst = picture ();
521 Picture mask_p = 0;
522
523 if (mask != 1.)
524 {
525 mask_p = create_xrender_mask (dpy, img->pm, False, False);
526 XRenderColor mask_c = { 0, 0, 0, float_to_component (mask) };
527 XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1);
528 }
529
530 XRenderComposite (dpy, op, src, mask_p, dst, x - img->x, y - img->y, 0, 0, 0, 0, w, h);
531
532 XRenderFreePicture (dpy, src);
533 XRenderFreePicture (dpy, dst);
534
535 if (mask_p)
536 XRenderFreePicture (dpy, mask_p);
537}
538
436rxvt_img * 539rxvt_img *
437rxvt_img::clone () 540rxvt_img::clone ()
438{ 541{
439 return new rxvt_img (*this); 542 return new rxvt_img (*this);
440}
441
442static XRenderPictFormat *
443find_alpha_format_for (Display *dpy, XRenderPictFormat *format)
444{
445 if (format->direct.alphaMask)
446 return format; // already has alpha
447
448 // try to find a suitable alpha format, one bit alpha is enough for our purposes
449 if (format->type == PictTypeDirect)
450 for (int n = 0; XRenderPictFormat *f = XRenderFindFormat (dpy, 0, 0, n); ++n)
451 if (f->direct.alphaMask
452 && f->type == PictTypeDirect
453 && ecb_popcount32 (f->direct.redMask ) >= ecb_popcount32 (format->direct.redMask )
454 && ecb_popcount32 (f->direct.greenMask) >= ecb_popcount32 (format->direct.greenMask)
455 && ecb_popcount32 (f->direct.blueMask ) >= ecb_popcount32 (format->direct.blueMask ))
456 return f;
457
458 // should be a very good fallback
459 return XRenderFindStandardFormat (dpy, PictStandardARGB32);
460} 543}
461 544
462rxvt_img * 545rxvt_img *
463rxvt_img::reify () 546rxvt_img::reify ()
464{ 547{
473 && repeat == RepeatNone; // and we have no good pixels to fill with 556 && repeat == RepeatNone; // and we have no good pixels to fill with
474 557
475 rxvt_img *img = new rxvt_img (s, alpha ? find_alpha_format_for (dpy, format) : format, 0, 0, w, h, repeat); 558 rxvt_img *img = new rxvt_img (s, alpha ? find_alpha_format_for (dpy, format) : format, 0, 0, w, h, repeat);
476 img->alloc (); 559 img->alloc ();
477 560
478 Picture src = src_picture (); 561 Picture src = picture ();
479 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0); 562 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0);
480 563
481 if (alpha) 564 if (alpha)
482 { 565 {
483 XRenderColor rc = { 0, 0, 0, 0 }; 566 XRenderColor rc = { 0, 0, 0, 0 };
484 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
485 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);
486 } 569 }
487 else 570 else
488 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);
489 572
490 XRenderFreePicture (dpy, src); 573 XRenderFreePicture (dpy, src);
491 XRenderFreePicture (dpy, dst); 574 XRenderFreePicture (dpy, dst);
492 575
493 return img; 576 return img;
496rxvt_img * 579rxvt_img *
497rxvt_img::sub_rect (int x, int y, int width, int height) 580rxvt_img::sub_rect (int x, int y, int width, int height)
498{ 581{
499 rxvt_img *img = clone (); 582 rxvt_img *img = clone ();
500 583
501 img->x += x; 584 img->x -= x;
502 img->y += y; 585 img->y -= y;
503 586
504 if (w != width || h != height) 587 if (w != width || h != height)
505 { 588 {
506 img->w = width; 589 img->w = width;
507 img->h = height; 590 img->h = height;
512 } 595 }
513 596
514 return img; 597 return img;
515} 598}
516 599
600typedef rxvt_img::nv matrix[3][3];
601
517static void 602static void
518mat_invert (double mat[3][3], double (&inv)[3][3]) 603mat_invert (matrix mat, rxvt_img::nv (&inv)[3][3])
519{ 604{
520 double s0 = mat [2][2] * mat [1][1] - mat [2][1] * mat [1][2]; 605 rxvt_img::nv s0 = mat [2][2] * mat [1][1] - mat [2][1] * mat [1][2];
521 double s1 = mat [2][1] * mat [0][2] - mat [2][2] * mat [0][1]; 606 rxvt_img::nv s1 = mat [2][1] * mat [0][2] - mat [2][2] * mat [0][1];
522 double s2 = mat [1][2] * mat [0][1] - mat [1][1] * mat [0][2]; 607 rxvt_img::nv s2 = mat [1][2] * mat [0][1] - mat [1][1] * mat [0][2];
523 608
524 double invdet = 1. / (mat [0][0] * s0 + mat [1][0] * s1 + mat [2][0] * s2); 609 rxvt_img::nv invdet = 1. / (mat [0][0] * s0 + mat [1][0] * s1 + mat [2][0] * s2);
525 610
526 inv [0][0] = invdet * s0; 611 inv [0][0] = invdet * s0;
527 inv [0][1] = invdet * s1; 612 inv [0][1] = invdet * s1;
528 inv [0][2] = invdet * s2; 613 inv [0][2] = invdet * s2;
529 614
534 inv [2][0] = invdet * (mat [2][1] * mat [1][0] - mat [2][0] * mat [1][1]); 619 inv [2][0] = invdet * (mat [2][1] * mat [1][0] - mat [2][0] * mat [1][1]);
535 inv [2][1] = invdet * (mat [2][0] * mat [0][1] - mat [2][1] * mat [0][0]); 620 inv [2][1] = invdet * (mat [2][0] * mat [0][1] - mat [2][1] * mat [0][0]);
536 inv [2][2] = invdet * (mat [1][1] * mat [0][0] - mat [1][0] * mat [0][1]); 621 inv [2][2] = invdet * (mat [1][1] * mat [0][0] - mat [1][0] * mat [0][1]);
537} 622}
538 623
539static double 624static rxvt_img::nv
540mat_apply (double mat[3][3], int i, double x, double y) 625mat_apply (matrix mat, int i, rxvt_img::nv x, rxvt_img::nv y)
541{ 626{
542 double v = mat [i][0] * x + mat [i][1] * y + mat [i][2]; 627 rxvt_img::nv v = mat [i][0] * x + mat [i][1] * y + mat [i][2];
543 double w = mat [2][0] * x + mat [2][1] * y + mat [2][2]; 628 rxvt_img::nv w = mat [2][0] * x + mat [2][1] * y + mat [2][2];
544 629
545 return v * (1. / w); 630 return v * (1. / w);
546} 631}
547 632
633static void
634mat_mult (matrix a, matrix b, matrix r)
635{
636 for (int i = 0; i < 3; ++i)
637 for (int j = 0; j < 3; ++j)
638 r [i][j] = a [i][0] * b [0][j]
639 + a [i][1] * b [1][j]
640 + a [i][2] * b [2][j];
641}
642
643static void
644mat_trans (rxvt_img::nv x, rxvt_img::nv y, matrix mat)
645{
646 mat [0][0] = 1; mat [0][1] = 0; mat [0][2] = x;
647 mat [1][0] = 0; mat [1][1] = 1; mat [1][2] = y;
648 mat [2][0] = 0; mat [2][1] = 0; mat [2][2] = 1;
649}
650
548rxvt_img * 651rxvt_img *
549rxvt_img::transform (double matrix[3][3]) 652rxvt_img::transform (nv matrix[3][3])
550{ 653{
551 // find new offset
552 int ox = mat_apply (matrix, 0, x, y);
553 int oy = mat_apply (matrix, 1, x, y);
554
555 // calculate new pixel bounding box coordinates 654 // calculate new pixel bounding box coordinates
556 double d [2], rmin[2], rmax[2]; 655 nv r[2], rmin[2], rmax[2];
557 656
558 for (int i = 0; i < 2; ++i) 657 for (int i = 0; i < 2; ++i)
559 { 658 {
560 double v; 659 nv v;
660
561 v = mat_apply (matrix, i, 0, 0); rmin [i] = rmax [i] = v; d [i] = v; 661 v = mat_apply (matrix, i, 0+x, 0+y); rmin [i] = rmax [i] = v; r [i] = v;
562 v = mat_apply (matrix, i, w, 0); min_it (rmin [i], v); max_it (rmax [i], v); 662 v = mat_apply (matrix, i, w+x, 0+y); min_it (rmin [i], v); max_it (rmax [i], v);
563 v = mat_apply (matrix, i, 0, h); min_it (rmin [i], v); max_it (rmax [i], v); 663 v = mat_apply (matrix, i, 0+x, h+y); min_it (rmin [i], v); max_it (rmax [i], v);
564 v = mat_apply (matrix, i, w, h); min_it (rmin [i], v); max_it (rmax [i], v); 664 v = mat_apply (matrix, i, w+x, h+y); min_it (rmin [i], v); max_it (rmax [i], v);
565 } 665 }
566 666
667 float sx = rmin [0] - x;
668 float sy = rmin [1] - y;
669
670 // TODO: adjust matrix for subpixel accuracy
567 int dx = floor (rmin [0]); 671 int nx = floor (rmin [0]);
568 int dy = floor (rmin [1]); 672 int ny = floor (rmin [1]);
569 673
570 int new_width = ceil (rmax [0] - dx); 674 int new_width = ceil (rmax [0] - rmin [0]);
571 int new_height = ceil (rmax [1] - dy); 675 int new_height = ceil (rmax [1] - rmin [1]);
572 676
573 double inv[3][3]; 677 ::matrix tr, tmp;
678 mat_trans (x, y, tr);
679 mat_mult (matrix, tr, tmp);
680 mat_trans (-x, -y, tr);
681 mat_mult (tr, tmp, matrix);
682
683 ::matrix inv;
574 mat_invert (matrix, inv); 684 mat_invert (matrix, inv);
575 685
576 rxvt_img *img = new rxvt_img (s, format, ox - dx - d [0], oy - dy - d [1], new_width, new_height, repeat); 686 rxvt_img *img = new rxvt_img (s, format, nx, ny, new_width, new_height, repeat);
577 img->alloc (); 687 img->alloc ();
578 688
579 Display *dpy = s->display->dpy; 689 Display *dpy = s->display->dpy;
580 Picture src = src_picture (); 690 Picture src = picture ();
581 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0); 691 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0);
582 692
583 XTransform xfrm; 693 XTransform xfrm;
584 694
585 for (int i = 0; i < 3; ++i) 695 for (int i = 0; i < 3; ++i)
586 for (int j = 0; j < 3; ++j) 696 for (int j = 0; j < 3; ++j)
587 xfrm.matrix [i][j] = XDoubleToFixed (inv [i][j]); 697 xfrm.matrix [i][j] = XDoubleToFixed (inv [i][j]);
588 698
589 XRenderSetPictureFilter (dpy, src, "good", 0, 0); 699 XRenderSetPictureFilter (dpy, src, "good", 0, 0);
590 XRenderSetPictureTransform (dpy, src, &xfrm); 700 XRenderSetPictureTransform (dpy, src, &xfrm);
591 XRenderComposite (dpy, PictOpSrc, src, None, dst, dx, dy, 0, 0, 0, 0, new_width, new_height); 701 XRenderComposite (dpy, PictOpSrc, src, None, dst, sx, sy, 0, 0, 0, 0, new_width, new_height);
702#if 1
703 {
704 XRenderColor rc = { 65535,0,0,65535 };
705 XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, new_width, new_height);
706 }{
707 XRenderColor rc = { 0,0,0,65535 };
708 XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 1, 1, new_width - 2, new_height - 2);
709 }
710 XRenderComposite (dpy, PictOpOver, src, None, dst, sx, sy, 0, 0, 0, 0, new_width, new_height);
711#endif
592 712
593 XRenderFreePicture (dpy, src); 713 XRenderFreePicture (dpy, src);
594 XRenderFreePicture (dpy, dst); 714 XRenderFreePicture (dpy, dst);
595 715
596 return img; 716 return img;
600rxvt_img::scale (int new_width, int new_height) 720rxvt_img::scale (int new_width, int new_height)
601{ 721{
602 if (w == new_width && h == new_height) 722 if (w == new_width && h == new_height)
603 return clone (); 723 return clone ();
604 724
605 double matrix[3][3] = { 725 nv matrix[3][3] = {
606 { new_width / (double)w, 0, 0 }, 726 { new_width / (nv)w, 0, 0 },
607 { 0, new_height / (double)h, 0 }, 727 { 0, new_height / (nv)h, 0 },
608 { 0, 0, 1 } 728 { 0, 0, 1 }
609 }; 729 };
610 730
611 int old_repeat_mode = repeat; 731 int old_repeat_mode = repeat;
612 repeat = RepeatPad; // not right, but xrender can't properly scale it seems 732 repeat = RepeatPad; // not right, but xrender can't properly scale it seems
613 733
618 738
619 return img; 739 return img;
620} 740}
621 741
622rxvt_img * 742rxvt_img *
623rxvt_img::rotate (int cx, int cy, double phi) 743rxvt_img::rotate (int cx, int cy, nv phi)
624{ 744{
625 double s = sin (phi); 745 nv s = sin (phi);
626 double c = cos (phi); 746 nv c = cos (phi);
627 747
628 double matrix[3][3] = { 748 nv matrix[3][3] = {
749#if 0
629 { c, -s, cx - c * cx + s * cy }, 750 { c, -s, cx - c * cx + s * cy },
630 { s, c, cy - s * cx - c * cy }, 751 { s, c, cy - s * cx - c * cy },
631 { 0, 0, 1 } 752 { 0, 0, 1 }
753#else
632 //{ c, -s, 0 }, 754 { c, -s, 0 },
633 //{ s, c, 0 }, 755 { s, c, 0 },
634 //{ 0, 0, 1 } 756 { 0, 0, 1 }
757#endif
635 }; 758 };
636 759
637 //move (-cx, -cy); 760 move (-cx, -cy);
638 rxvt_img *img = transform (matrix); 761 rxvt_img *img = transform (matrix);
639 //move ( cx, cy); 762 move ( cx, cy);
640 //img->move (cx, cy); 763 img->move (cx, cy);
641 764
642 return img; 765 return img;
643} 766}
644 767
645rxvt_img * 768rxvt_img *
650 773
651 rxvt_img *img = new rxvt_img (s, new_format, x, y, w, h, repeat); 774 rxvt_img *img = new rxvt_img (s, new_format, x, y, w, h, repeat);
652 img->alloc (); 775 img->alloc ();
653 776
654 Display *dpy = s->display->dpy; 777 Display *dpy = s->display->dpy;
655 Picture src = src_picture (); 778 Picture src = picture ();
656 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0); 779 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0);
657 int op = PictOpSrc; 780 int op = PictOpSrc;
658 781
659 if (format->direct.alphaMask && !new_format->direct.alphaMask) 782 if (format->direct.alphaMask && !new_format->direct.alphaMask)
660 { 783 {
672 795
673 return img; 796 return img;
674} 797}
675 798
676rxvt_img * 799rxvt_img *
677rxvt_img::blend (rxvt_img *img, double factor) 800rxvt_img::blend (rxvt_img *img, nv factor)
678{ 801{
679 rxvt_img *img2 = clone (); 802 rxvt_img *img2 = clone ();
680 Display *dpy = s->display->dpy; 803 Display *dpy = s->display->dpy;
681 Picture src = img->src_picture (); 804 Picture src = img->picture ();
682 Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); 805 Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0);
683 Picture mask = create_xrender_mask (dpy, img->pm, False, False); 806 Picture mask = create_xrender_mask (dpy, img->pm, False, False);
684 807
685 XRenderColor mask_c; 808 XRenderColor mask_c;
686 809

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines