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