… | |
… | |
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 |
|
|
39 | static Picture |
|
|
40 | create_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 | |
38 | void |
56 | void |
39 | rxvt_term::bg_destroy () |
57 | rxvt_term::bg_destroy () |
40 | { |
58 | { |
41 | #ifdef HAVE_AFTERIMAGE |
59 | #ifdef HAVE_AFTERIMAGE |
42 | if (original_asim) |
60 | if (original_asim) |
… | |
… | |
374 | if (tr_flags & BG_NEEDS_TINT) |
392 | if (tr_flags & BG_NEEDS_TINT) |
375 | { |
393 | { |
376 | ShadingInfo as_shade; |
394 | ShadingInfo as_shade; |
377 | as_shade.shading = shade; |
395 | as_shade.shading = shade; |
378 | |
396 | |
379 | rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC); |
397 | rgba c; |
380 | if (bg_flags & BG_TINT_SET) |
|
|
381 | tint.get (c); |
398 | tint.get (c); |
382 | as_shade.tintColor.red = c.r; |
399 | as_shade.tintColor.red = c.r; |
383 | as_shade.tintColor.green = c.g; |
400 | as_shade.tintColor.green = c.g; |
384 | as_shade.tintColor.blue = c.b; |
401 | as_shade.tintColor.blue = c.b; |
385 | |
402 | |
386 | background_tint = shading2tint32 (&as_shade); |
403 | background_tint = shading2tint32 (&as_shade); |
… | |
… | |
802 | } |
819 | } |
803 | |
820 | |
804 | #if XRENDER |
821 | #if XRENDER |
805 | if (tr_flags) |
822 | if (tr_flags) |
806 | { |
823 | { |
807 | XRenderPictureAttributes pa; |
|
|
808 | |
|
|
809 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, visual); |
824 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
|
|
825 | |
810 | Picture src = XRenderCreatePicture (dpy, root_pmap, src_format, 0, &pa); |
826 | Picture src = XRenderCreatePicture (dpy, root_pmap, format, 0, 0); |
811 | |
827 | |
812 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
|
|
813 | Picture dst = XRenderCreatePicture (dpy, bg_pixmap, dst_format, 0, &pa); |
828 | Picture dst = XRenderCreatePicture (dpy, bg_pixmap, format, 0, 0); |
814 | |
829 | |
815 | pa.repeat = True; |
830 | Picture mask = create_xrender_mask (dpy, vt, False, False); |
816 | Pixmap mask_pmap = XCreatePixmap (dpy, vt, 1, 1, 8); |
|
|
817 | XRenderPictFormat *mask_format = XRenderFindStandardFormat (dpy, PictStandardA8); |
|
|
818 | Picture mask = XRenderCreatePicture (dpy, mask_pmap, mask_format, CPRepeat, &pa); |
|
|
819 | XFreePixmap (dpy, mask_pmap); |
|
|
820 | |
831 | |
821 | XRenderColor mask_c; |
832 | XRenderColor mask_c; |
822 | |
833 | |
823 | mask_c.alpha = 0x8000; |
834 | mask_c.alpha = 0x8000; |
824 | mask_c.red = 0; |
835 | mask_c.red = |
825 | mask_c.green = 0; |
836 | mask_c.green = |
826 | mask_c.blue = 0; |
837 | mask_c.blue = 0; |
827 | XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1); |
838 | XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1); |
|
|
839 | |
828 | XRenderComposite (dpy, PictOpOver, src, mask, dst, 0, 0, 0, 0, 0, 0, target_width, target_height); |
840 | XRenderComposite (dpy, PictOpOver, src, mask, dst, 0, 0, 0, 0, 0, 0, target_width, target_height); |
829 | |
841 | |
830 | XRenderFreePicture (dpy, src); |
842 | XRenderFreePicture (dpy, src); |
831 | XRenderFreePicture (dpy, dst); |
843 | XRenderFreePicture (dpy, dst); |
832 | XRenderFreePicture (dpy, mask); |
844 | XRenderFreePicture (dpy, mask); |
… | |
… | |
944 | { |
956 | { |
945 | changed = true; |
957 | changed = true; |
946 | v_blurRadius = vr; |
958 | v_blurRadius = vr; |
947 | } |
959 | } |
948 | |
960 | |
949 | if (v_blurRadius == 0 && h_blurRadius == 0) |
961 | if (h_blurRadius == 0 || v_blurRadius == 0) |
950 | bg_flags &= ~BG_NEEDS_BLUR; |
962 | bg_flags &= ~BG_NEEDS_BLUR; |
951 | else |
963 | else |
952 | bg_flags |= BG_NEEDS_BLUR; |
964 | bg_flags |= BG_NEEDS_BLUR; |
953 | |
965 | |
954 | return changed; |
966 | return changed; |
… | |
… | |
960 | rgba c; |
972 | rgba c; |
961 | bool has_shade = shade != 100; |
973 | bool has_shade = shade != 100; |
962 | |
974 | |
963 | bg_flags &= ~BG_TINT_FLAGS; |
975 | bg_flags &= ~BG_TINT_FLAGS; |
964 | |
976 | |
965 | if (bg_flags & BG_TINT_SET) |
|
|
966 | { |
|
|
967 | tint.get (c); |
977 | tint.get (c); |
|
|
978 | |
968 | if (!has_shade |
979 | if (!has_shade |
969 | && (c.r <= 0x00ff || c.r >= 0xff00) |
980 | && (c.r <= 0x00ff || c.r >= 0xff00) |
970 | && (c.g <= 0x00ff || c.g >= 0xff00) |
981 | && (c.g <= 0x00ff || c.g >= 0xff00) |
971 | && (c.b <= 0x00ff || c.b >= 0xff00)) |
982 | && (c.b <= 0x00ff || c.b >= 0xff00)) |
972 | bg_flags |= BG_TINT_BITAND; |
983 | bg_flags |= BG_TINT_BITAND; |
973 | } |
|
|
974 | |
984 | |
975 | if (has_shade || (bg_flags & BG_TINT_SET)) |
985 | if (has_shade |
|
|
986 | || c.r < 0xff00 |
|
|
987 | || c.g < 0xff00 |
|
|
988 | || c.b < 0xff00) |
976 | bg_flags |= BG_NEEDS_TINT; |
989 | bg_flags |= BG_NEEDS_TINT; |
977 | } |
990 | } |
978 | |
991 | |
979 | bool |
992 | bool |
980 | rxvt_term::bg_set_tint (rxvt_color &new_tint) |
993 | rxvt_term::bg_set_tint (rxvt_color &new_tint) |
981 | { |
994 | { |
982 | if (!(bg_flags & BG_TINT_SET) || tint != new_tint) |
995 | if (tint != new_tint) |
983 | { |
996 | { |
984 | tint = new_tint; |
997 | tint = new_tint; |
985 | bg_flags |= BG_TINT_SET; |
|
|
986 | set_tint_shade_flags (); |
998 | set_tint_shade_flags (); |
987 | return true; |
999 | return true; |
988 | } |
1000 | } |
989 | |
1001 | |
990 | return false; |
1002 | return false; |
… | |
… | |
1042 | |
1054 | |
1043 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
1055 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
1044 | double *kernel = (double *)malloc (size * sizeof (double)); |
1056 | double *kernel = (double *)malloc (size * sizeof (double)); |
1045 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
1057 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
1046 | |
1058 | |
1047 | XRenderPictureAttributes pa; |
|
|
1048 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1059 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1049 | |
1060 | |
1050 | Picture src = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1061 | Picture src = XRenderCreatePicture (dpy, pixmap, format, 0, 0); |
1051 | Picture dst = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1062 | Picture dst = XRenderCreatePicture (dpy, pixmap, format, 0, 0); |
1052 | |
1063 | |
1053 | if (kernel && params) |
1064 | if (kernel && params) |
1054 | { |
1065 | { |
1055 | if (h_blurRadius) |
|
|
1056 | { |
|
|
1057 | size = h_blurRadius * 2 + 1; |
1066 | size = h_blurRadius * 2 + 1; |
1058 | get_gaussian_kernel (h_blurRadius, size, kernel, params); |
1067 | get_gaussian_kernel (h_blurRadius, size, kernel, params); |
1059 | |
1068 | |
1060 | XRenderSetPictureFilter (dpy, src, FilterConvolution, params, size+2); |
1069 | XRenderSetPictureFilter (dpy, src, FilterConvolution, params, size+2); |
1061 | XRenderComposite (dpy, |
1070 | XRenderComposite (dpy, |
1062 | PictOpSrc, |
1071 | PictOpSrc, |
1063 | src, |
1072 | src, |
1064 | None, |
1073 | None, |
1065 | dst, |
1074 | dst, |
1066 | 0, 0, |
1075 | 0, 0, |
1067 | 0, 0, |
1076 | 0, 0, |
1068 | 0, 0, |
1077 | 0, 0, |
1069 | width, height); |
1078 | width, height); |
1070 | } |
|
|
1071 | |
1079 | |
1072 | if (v_blurRadius) |
|
|
1073 | { |
|
|
1074 | size = v_blurRadius * 2 + 1; |
1080 | size = v_blurRadius * 2 + 1; |
1075 | get_gaussian_kernel (v_blurRadius, size, kernel, params); |
1081 | get_gaussian_kernel (v_blurRadius, size, kernel, params); |
1076 | ::swap (params[0], params[1]); |
1082 | ::swap (params[0], params[1]); |
1077 | |
1083 | |
1078 | XRenderSetPictureFilter (dpy, src, FilterConvolution, params, size+2); |
1084 | XRenderSetPictureFilter (dpy, src, FilterConvolution, params, size+2); |
1079 | XRenderComposite (dpy, |
1085 | XRenderComposite (dpy, |
1080 | PictOpSrc, |
1086 | PictOpSrc, |
1081 | src, |
1087 | src, |
1082 | None, |
1088 | None, |
1083 | dst, |
1089 | dst, |
1084 | 0, 0, |
1090 | 0, 0, |
1085 | 0, 0, |
1091 | 0, 0, |
1086 | 0, 0, |
1092 | 0, 0, |
1087 | width, height); |
1093 | width, height); |
1088 | } |
|
|
1089 | |
1094 | |
1090 | ret = true; |
1095 | ret = true; |
1091 | } |
1096 | } |
1092 | |
1097 | |
1093 | free (kernel); |
1098 | free (kernel); |
… | |
… | |
1123 | } |
1128 | } |
1124 | } |
1129 | } |
1125 | # if XRENDER |
1130 | # if XRENDER |
1126 | else if (bg_flags & BG_HAS_RENDER) |
1131 | else if (bg_flags & BG_HAS_RENDER) |
1127 | { |
1132 | { |
1128 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
1133 | rgba c; |
1129 | |
1134 | |
1130 | if (bg_flags & BG_TINT_SET) |
|
|
1131 | tint.get (c); |
1135 | tint.get (c); |
1132 | |
1136 | |
1133 | if (shade <= 100) |
1137 | if (shade <= 100) |
1134 | { |
1138 | { |
1135 | c.r = c.r * shade / 100; |
1139 | c.r = c.r * shade / 100; |
1136 | c.g = c.g * shade / 100; |
1140 | c.g = c.g * shade / 100; |
… | |
… | |
1141 | c.r = c.r * (200 - shade) / 100; |
1145 | c.r = c.r * (200 - shade) / 100; |
1142 | c.g = c.g * (200 - shade) / 100; |
1146 | c.g = c.g * (200 - shade) / 100; |
1143 | c.b = c.b * (200 - shade) / 100; |
1147 | c.b = c.b * (200 - shade) / 100; |
1144 | } |
1148 | } |
1145 | |
1149 | |
1146 | XRenderPictFormat *solid_format = XRenderFindStandardFormat (dpy, PictStandardARGB32); |
|
|
1147 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1150 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1148 | XRenderPictureAttributes pa; |
|
|
1149 | |
1151 | |
1150 | Picture back_pic = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1152 | Picture back_pic = XRenderCreatePicture (dpy, pixmap, format, 0, 0); |
1151 | |
1153 | |
1152 | pa.repeat = True; |
1154 | Picture overlay_pic = create_xrender_mask (dpy, pixmap, True, False); |
1153 | |
1155 | |
1154 | Pixmap overlay_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); |
1156 | Picture mask_pic = create_xrender_mask (dpy, pixmap, True, True); |
1155 | Picture overlay_pic = XRenderCreatePicture (dpy, overlay_pmap, solid_format, CPRepeat, &pa); |
|
|
1156 | XFreePixmap (dpy, overlay_pmap); |
|
|
1157 | |
|
|
1158 | pa.component_alpha = True; |
|
|
1159 | Pixmap mask_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); |
|
|
1160 | Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat | CPComponentAlpha, &pa); |
|
|
1161 | XFreePixmap (dpy, mask_pmap); |
|
|
1162 | |
1157 | |
1163 | XRenderColor mask_c; |
1158 | XRenderColor mask_c; |
1164 | |
1159 | |
1165 | mask_c.alpha = 0xffff; |
1160 | mask_c.alpha = 0xffff; |
1166 | mask_c.red = |
1161 | mask_c.red = |
… | |
… | |
1171 | mask_c.alpha = 0; |
1166 | mask_c.alpha = 0; |
1172 | mask_c.red = 0xffff - c.r; |
1167 | mask_c.red = 0xffff - c.r; |
1173 | mask_c.green = 0xffff - c.g; |
1168 | mask_c.green = 0xffff - c.g; |
1174 | mask_c.blue = 0xffff - c.b; |
1169 | mask_c.blue = 0xffff - c.b; |
1175 | XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1); |
1170 | XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1); |
|
|
1171 | |
1176 | XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1172 | XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1177 | |
1173 | |
1178 | if (shade > 100) |
1174 | if (shade > 100) |
1179 | { |
1175 | { |
1180 | mask_c.red = mask_c.green = mask_c.blue = 0xffff * (shade - 100) / 100; |
|
|
1181 | mask_c.alpha = 0; |
1176 | mask_c.alpha = 0; |
|
|
1177 | mask_c.red = |
|
|
1178 | mask_c.green = |
|
|
1179 | mask_c.blue = 0xffff * (shade - 100) / 100; |
1182 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1180 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1183 | |
1181 | |
1184 | XRenderComposite (dpy, PictOpOver, overlay_pic, None, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1182 | XRenderComposite (dpy, PictOpOver, overlay_pic, None, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1185 | } |
1183 | } |
1186 | |
1184 | |
… | |
… | |
1249 | #if XRENDER |
1247 | #if XRENDER |
1250 | if (bg_flags & BG_HAS_RENDER) |
1248 | if (bg_flags & BG_HAS_RENDER) |
1251 | { |
1249 | { |
1252 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
1250 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
1253 | |
1251 | |
1254 | XRenderPictureAttributes pa; |
|
|
1255 | |
|
|
1256 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1252 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1257 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, &pa); |
1253 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, 0); |
1258 | |
1254 | |
1259 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
1255 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
1260 | Picture dst = XRenderCreatePicture (dpy, recoded_root_pmap, dst_format, 0, &pa); |
1256 | Picture dst = XRenderCreatePicture (dpy, recoded_root_pmap, dst_format, 0, 0); |
1261 | |
1257 | |
1262 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height); |
1258 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height); |
1263 | |
1259 | |
1264 | XRenderFreePicture (dpy, src); |
1260 | XRenderFreePicture (dpy, src); |
1265 | XRenderFreePicture (dpy, dst); |
1261 | XRenderFreePicture (dpy, dst); |
… | |
… | |
1295 | |
1291 | |
1296 | if (gc) |
1292 | if (gc) |
1297 | { |
1293 | { |
1298 | XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); |
1294 | XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); |
1299 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1295 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1300 | XFreeGC (dpy, gc); |
|
|
1301 | |
1296 | |
1302 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1297 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1303 | { |
1298 | { |
1304 | if (bg_flags & BG_NEEDS_BLUR) |
1299 | if (bg_flags & BG_NEEDS_BLUR) |
1305 | { |
1300 | { |
… | |
… | |
1309 | if (bg_flags & BG_NEEDS_TINT) |
1304 | if (bg_flags & BG_NEEDS_TINT) |
1310 | { |
1305 | { |
1311 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1306 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1312 | result &= ~BG_NEEDS_TINT; |
1307 | result &= ~BG_NEEDS_TINT; |
1313 | } |
1308 | } |
|
|
1309 | # ifndef HAVE_AFTERIMAGE |
|
|
1310 | if (result & BG_NEEDS_TINT) |
|
|
1311 | { |
|
|
1312 | XImage *ximage = XGetImage (dpy, bg_pixmap, 0, 0, bg_pmap_width, bg_pmap_height, AllPlanes, ZPixmap); |
|
|
1313 | if (ximage) |
|
|
1314 | { |
|
|
1315 | /* our own client-side tinting */ |
|
|
1316 | tint_ximage (DefaultVisual (dpy, display->screen), ximage); |
|
|
1317 | |
|
|
1318 | XPutImage (dpy, bg_pixmap, gc, ximage, 0, 0, 0, 0, ximage->width, ximage->height); |
|
|
1319 | XDestroyImage (ximage); |
|
|
1320 | } |
|
|
1321 | } |
|
|
1322 | # endif |
1314 | } /* server side rendering completed */ |
1323 | } /* server side rendering completed */ |
|
|
1324 | |
|
|
1325 | XFreeGC (dpy, gc); |
1315 | } |
1326 | } |
1316 | |
1327 | |
1317 | if (recoded_root_pmap != root_pixmap) |
1328 | if (recoded_root_pmap != root_pixmap) |
1318 | XFreePixmap (dpy, recoded_root_pmap); |
1329 | XFreePixmap (dpy, recoded_root_pmap); |
1319 | |
1330 | |
… | |
… | |
1355 | if (render_image (tr_flags)) |
1366 | if (render_image (tr_flags)) |
1356 | bg_flags |= BG_IS_VALID; |
1367 | bg_flags |= BG_IS_VALID; |
1357 | } |
1368 | } |
1358 | # endif |
1369 | # endif |
1359 | |
1370 | |
1360 | # if defined(ENABLE_TRANSPARENCY) && !defined(HAVE_AFTERIMAGE) |
|
|
1361 | XImage *result = NULL; |
|
|
1362 | |
|
|
1363 | if (tr_flags & BG_NEEDS_TINT) |
|
|
1364 | { |
|
|
1365 | result = XGetImage (dpy, bg_pixmap, 0, 0, bg_pmap_width, bg_pmap_height, AllPlanes, ZPixmap); |
|
|
1366 | } |
|
|
1367 | |
|
|
1368 | if (result) |
|
|
1369 | { |
|
|
1370 | /* our own client-side tinting */ |
|
|
1371 | //if (tr_flags & BG_NEEDS_TINT) |
|
|
1372 | if (1) |
|
|
1373 | tint_ximage (DefaultVisual (dpy, display->screen), result); |
|
|
1374 | |
|
|
1375 | GC gc = XCreateGC (dpy, vt, 0UL, NULL); |
|
|
1376 | |
|
|
1377 | if (gc) |
|
|
1378 | { |
|
|
1379 | XPutImage (dpy, bg_pixmap, gc, result, 0, 0, 0, 0, result->width, result->height); |
|
|
1380 | |
|
|
1381 | XFreeGC (dpy, gc); |
|
|
1382 | } |
|
|
1383 | |
|
|
1384 | XDestroyImage (result); |
|
|
1385 | } |
|
|
1386 | # endif |
|
|
1387 | |
|
|
1388 | if (!(bg_flags & BG_IS_VALID)) |
1371 | if (!(bg_flags & BG_IS_VALID)) |
1389 | { |
1372 | { |
1390 | if (bg_pixmap != None) |
1373 | if (bg_pixmap != None) |
1391 | { |
1374 | { |
1392 | XFreePixmap (dpy, bg_pixmap); |
1375 | XFreePixmap (dpy, bg_pixmap); |
… | |
… | |
1404 | |
1387 | |
1405 | void |
1388 | void |
1406 | rxvt_term::bg_init () |
1389 | rxvt_term::bg_init () |
1407 | { |
1390 | { |
1408 | #ifdef ENABLE_TRANSPARENCY |
1391 | #ifdef ENABLE_TRANSPARENCY |
|
|
1392 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
|
|
1393 | tint.set (this, c); |
1409 | shade = 100; |
1394 | shade = 100; |
1410 | #endif |
1395 | #endif |
1411 | |
1396 | |
1412 | bg_flags &= ~(BG_HAS_RENDER | BG_HAS_RENDER_CONV); |
1397 | bg_flags &= ~(BG_HAS_RENDER | BG_HAS_RENDER_CONV); |
1413 | #if XRENDER |
1398 | #if XRENDER |
… | |
… | |
1516 | break; |
1501 | break; |
1517 | default: |
1502 | default: |
1518 | return; /* we do not support this color depth */ |
1503 | return; /* we do not support this color depth */ |
1519 | } |
1504 | } |
1520 | |
1505 | |
1521 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
1506 | rgba c; |
1522 | |
1507 | |
1523 | if (bg_flags & BG_TINT_SET) |
|
|
1524 | tint.get (c); |
1508 | tint.get (c); |
1525 | |
1509 | |
1526 | /* prepare limits for color transformation (each channel is handled separately) */ |
1510 | /* prepare limits for color transformation (each channel is handled separately) */ |
1527 | if (shade > 100) |
1511 | if (shade > 100) |
1528 | { |
1512 | { |
1529 | c.r = c.r * (200 - shade) / 100; |
1513 | c.r = c.r * (200 - shade) / 100; |