ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
(Generate patch)

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.187 by sf-exg, Wed Dec 28 13:13:33 2011 UTC vs.
Revision 1.188 by sf-exg, Thu Dec 29 12:25:50 2011 UTC

33#ifndef FilterConvolution 33#ifndef FilterConvolution
34#define FilterConvolution "convolution" 34#define FilterConvolution "convolution"
35#endif 35#endif
36 36
37#ifdef HAVE_BG_PIXMAP 37#ifdef HAVE_BG_PIXMAP
38# if XRENDER
39static Picture
40create_xrender_mask (Display *dpy, Drawable drawable, Bool argb, Bool component_alpha)
41{
42 Pixmap pixmap = XCreatePixmap (dpy, drawable, 1, 1, argb ? 32 : 8);
43
44 XRenderPictFormat *format = XRenderFindStandardFormat (dpy, argb ? PictStandardARGB32 : PictStandardA8);
45 XRenderPictureAttributes pa;
46 pa.repeat = True;
47 pa.component_alpha = component_alpha;
48 Picture mask = XRenderCreatePicture (dpy, pixmap, format, CPRepeat | CPComponentAlpha, &pa);
49
50 XFreePixmap (dpy, pixmap);
51
52 return mask;
53}
54# endif
55
38void 56void
39rxvt_term::bg_destroy () 57rxvt_term::bg_destroy ()
40{ 58{
41#ifdef HAVE_AFTERIMAGE 59#ifdef HAVE_AFTERIMAGE
42 if (original_asim) 60 if (original_asim)
809 Picture src = XRenderCreatePicture (dpy, root_pmap, src_format, 0, &pa); 827 Picture src = XRenderCreatePicture (dpy, root_pmap, src_format, 0, &pa);
810 828
811 XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); 829 XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual);
812 Picture dst = XRenderCreatePicture (dpy, bg_pixmap, dst_format, 0, &pa); 830 Picture dst = XRenderCreatePicture (dpy, bg_pixmap, dst_format, 0, &pa);
813 831
814 pa.repeat = True; 832 Picture mask = create_xrender_mask (dpy, vt, False, False);
815 Pixmap mask_pmap = XCreatePixmap (dpy, vt, 1, 1, 8);
816 XRenderPictFormat *mask_format = XRenderFindStandardFormat (dpy, PictStandardA8);
817 Picture mask = XRenderCreatePicture (dpy, mask_pmap, mask_format, CPRepeat, &pa);
818 XFreePixmap (dpy, mask_pmap);
819 833
820 XRenderColor mask_c; 834 XRenderColor mask_c;
821 835
822 mask_c.alpha = 0x8000; 836 mask_c.alpha = 0x8000;
823 mask_c.red = 0; 837 mask_c.red = 0;
1139 c.r = c.r * (200 - shade) / 100; 1153 c.r = c.r * (200 - shade) / 100;
1140 c.g = c.g * (200 - shade) / 100; 1154 c.g = c.g * (200 - shade) / 100;
1141 c.b = c.b * (200 - shade) / 100; 1155 c.b = c.b * (200 - shade) / 100;
1142 } 1156 }
1143 1157
1144 XRenderPictFormat *solid_format = XRenderFindStandardFormat (dpy, PictStandardARGB32);
1145 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); 1158 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual);
1146 XRenderPictureAttributes pa; 1159 XRenderPictureAttributes pa;
1147 1160
1148 Picture back_pic = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); 1161 Picture back_pic = XRenderCreatePicture (dpy, pixmap, format, 0, &pa);
1149 1162
1150 pa.repeat = True; 1163 Picture overlay_pic = create_xrender_mask (dpy, pixmap, True, False);
1151 1164
1152 Pixmap overlay_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); 1165 Picture mask_pic = create_xrender_mask (dpy, pixmap, True, True);
1153 Picture overlay_pic = XRenderCreatePicture (dpy, overlay_pmap, solid_format, CPRepeat, &pa);
1154 XFreePixmap (dpy, overlay_pmap);
1155
1156 pa.component_alpha = True;
1157 Pixmap mask_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32);
1158 Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat | CPComponentAlpha, &pa);
1159 XFreePixmap (dpy, mask_pmap);
1160 1166
1161 XRenderColor mask_c; 1167 XRenderColor mask_c;
1162 1168
1163 mask_c.alpha = 0xffff; 1169 mask_c.alpha = 0xffff;
1164 mask_c.red = 1170 mask_c.red =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines