… | |
… | |
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) |
… | |
… | |
181 | { |
199 | { |
182 | bool changed = false; |
200 | bool changed = false; |
183 | int geom_flags = 0; |
201 | int geom_flags = 0; |
184 | int x = 0, y = 0; |
202 | int x = 0, y = 0; |
185 | unsigned int w = 0, h = 0; |
203 | unsigned int w = 0, h = 0; |
186 | unsigned long new_flags = bg_flags & ~BG_GEOMETRY_FLAGS; |
204 | unsigned long new_flags = 0; |
187 | |
205 | |
188 | if (geom == NULL) |
206 | if (geom == NULL) |
189 | return false; |
207 | return false; |
190 | |
208 | |
191 | if (geom[0]) |
209 | if (geom[0]) |
… | |
… | |
284 | } /* done parsing ops */ |
302 | } /* done parsing ops */ |
285 | |
303 | |
286 | rxvt_free_strsplit (arr); |
304 | rxvt_free_strsplit (arr); |
287 | } |
305 | } |
288 | |
306 | |
|
|
307 | new_flags |= bg_flags & ~BG_GEOMETRY_FLAGS; |
|
|
308 | |
289 | if (!update) |
309 | if (!update) |
290 | { |
310 | { |
291 | if (!(geom_flags & XValue)) |
311 | if (!(geom_flags & XValue)) |
292 | x = y = defaultAlign; |
312 | x = y = defaultAlign; |
293 | else if (!(geom_flags & YValue)) |
313 | else if (!(geom_flags & YValue)) |
… | |
… | |
372 | if (tr_flags & BG_NEEDS_TINT) |
392 | if (tr_flags & BG_NEEDS_TINT) |
373 | { |
393 | { |
374 | ShadingInfo as_shade; |
394 | ShadingInfo as_shade; |
375 | as_shade.shading = shade; |
395 | as_shade.shading = shade; |
376 | |
396 | |
377 | rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC); |
397 | rgba c; |
378 | if (bg_flags & BG_TINT_SET) |
|
|
379 | tint.get (c); |
398 | tint.get (c); |
380 | as_shade.tintColor.red = c.r; |
399 | as_shade.tintColor.red = c.r; |
381 | as_shade.tintColor.green = c.g; |
400 | as_shade.tintColor.green = c.g; |
382 | as_shade.tintColor.blue = c.b; |
401 | as_shade.tintColor.blue = c.b; |
383 | |
402 | |
384 | background_tint = shading2tint32 (&as_shade); |
403 | background_tint = shading2tint32 (&as_shade); |
… | |
… | |
800 | } |
819 | } |
801 | |
820 | |
802 | #if XRENDER |
821 | #if XRENDER |
803 | if (tr_flags) |
822 | if (tr_flags) |
804 | { |
823 | { |
805 | XRenderPictureAttributes pa; |
|
|
806 | |
|
|
807 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, visual); |
824 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
|
|
825 | |
808 | Picture src = XRenderCreatePicture (dpy, root_pmap, src_format, 0, &pa); |
826 | Picture src = XRenderCreatePicture (dpy, root_pmap, format, 0, 0); |
809 | |
827 | |
810 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
|
|
811 | Picture dst = XRenderCreatePicture (dpy, bg_pixmap, dst_format, 0, &pa); |
828 | Picture dst = XRenderCreatePicture (dpy, bg_pixmap, format, 0, 0); |
812 | |
829 | |
813 | pa.repeat = True; |
830 | Picture mask = create_xrender_mask (dpy, vt, False, False); |
814 | Pixmap mask_pmap = XCreatePixmap (dpy, vt, 1, 1, 8); |
|
|
815 | XRenderPictFormat *mask_format = XRenderFindStandardFormat (dpy, PictStandardA8); |
|
|
816 | Picture mask = XRenderCreatePicture (dpy, mask_pmap, mask_format, CPRepeat, &pa); |
|
|
817 | XFreePixmap (dpy, mask_pmap); |
|
|
818 | |
831 | |
819 | XRenderColor mask_c; |
832 | XRenderColor mask_c; |
820 | |
833 | |
821 | mask_c.alpha = 0x8000; |
834 | mask_c.alpha = 0x8000; |
822 | mask_c.red = 0; |
835 | mask_c.red = |
823 | mask_c.green = 0; |
836 | mask_c.green = |
824 | mask_c.blue = 0; |
837 | mask_c.blue = 0; |
825 | XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1); |
838 | XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1); |
|
|
839 | |
826 | 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); |
827 | |
841 | |
828 | XRenderFreePicture (dpy, src); |
842 | XRenderFreePicture (dpy, src); |
829 | XRenderFreePicture (dpy, dst); |
843 | XRenderFreePicture (dpy, dst); |
830 | XRenderFreePicture (dpy, mask); |
844 | XRenderFreePicture (dpy, mask); |
… | |
… | |
958 | rgba c; |
972 | rgba c; |
959 | bool has_shade = shade != 100; |
973 | bool has_shade = shade != 100; |
960 | |
974 | |
961 | bg_flags &= ~BG_TINT_FLAGS; |
975 | bg_flags &= ~BG_TINT_FLAGS; |
962 | |
976 | |
963 | if (bg_flags & BG_TINT_SET) |
|
|
964 | { |
|
|
965 | tint.get (c); |
977 | tint.get (c); |
|
|
978 | |
966 | if (!has_shade |
979 | if (!has_shade |
967 | && (c.r <= 0x00ff || c.r >= 0xff00) |
980 | && (c.r <= 0x00ff || c.r >= 0xff00) |
968 | && (c.g <= 0x00ff || c.g >= 0xff00) |
981 | && (c.g <= 0x00ff || c.g >= 0xff00) |
969 | && (c.b <= 0x00ff || c.b >= 0xff00)) |
982 | && (c.b <= 0x00ff || c.b >= 0xff00)) |
970 | bg_flags |= BG_TINT_BITAND; |
983 | bg_flags |= BG_TINT_BITAND; |
971 | } |
|
|
972 | |
984 | |
973 | if (has_shade || (bg_flags & BG_TINT_SET)) |
985 | if (has_shade |
|
|
986 | || c.r < 0xff00 |
|
|
987 | || c.g < 0xff00 |
|
|
988 | || c.b < 0xff00) |
974 | bg_flags |= BG_NEEDS_TINT; |
989 | bg_flags |= BG_NEEDS_TINT; |
975 | } |
990 | } |
976 | |
991 | |
977 | bool |
992 | bool |
978 | rxvt_term::bg_set_tint (rxvt_color &new_tint) |
993 | rxvt_term::bg_set_tint (rxvt_color &new_tint) |
979 | { |
994 | { |
980 | if (!(bg_flags & BG_TINT_SET) || tint != new_tint) |
995 | if (tint != new_tint) |
981 | { |
996 | { |
982 | tint = new_tint; |
997 | tint = new_tint; |
983 | bg_flags |= BG_TINT_SET; |
|
|
984 | set_tint_shade_flags (); |
998 | set_tint_shade_flags (); |
985 | return true; |
999 | return true; |
986 | } |
1000 | } |
987 | |
1001 | |
988 | return false; |
1002 | return false; |
989 | } |
1003 | } |
990 | |
1004 | |
991 | bool |
1005 | bool |
992 | rxvt_term::bg_set_shade (const char *shade_str) |
1006 | rxvt_term::bg_set_shade (const char *shade_str) |
993 | { |
1007 | { |
994 | int new_shade = (shade_str) ? atoi (shade_str) : 100; |
1008 | int new_shade = atoi (shade_str); |
995 | |
1009 | |
996 | clamp_it (new_shade, -100, 200); |
1010 | clamp_it (new_shade, -100, 200); |
997 | if (new_shade < 0) |
1011 | if (new_shade < 0) |
998 | new_shade = 200 - (100 + new_shade); |
1012 | new_shade = 200 - (100 + new_shade); |
999 | |
1013 | |
… | |
… | |
1040 | |
1054 | |
1041 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
1055 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
1042 | double *kernel = (double *)malloc (size * sizeof (double)); |
1056 | double *kernel = (double *)malloc (size * sizeof (double)); |
1043 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
1057 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
1044 | |
1058 | |
1045 | XRenderPictureAttributes pa; |
|
|
1046 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1059 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1047 | |
1060 | |
1048 | Picture src = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1061 | Picture src = XRenderCreatePicture (dpy, pixmap, format, 0, 0); |
1049 | Picture dst = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1062 | Picture dst = XRenderCreatePicture (dpy, pixmap, format, 0, 0); |
1050 | |
1063 | |
1051 | if (kernel && params) |
1064 | if (kernel && params) |
1052 | { |
1065 | { |
1053 | if (h_blurRadius) |
1066 | if (h_blurRadius) |
1054 | { |
1067 | { |
… | |
… | |
1121 | } |
1134 | } |
1122 | } |
1135 | } |
1123 | # if XRENDER |
1136 | # if XRENDER |
1124 | else if (bg_flags & BG_HAS_RENDER) |
1137 | else if (bg_flags & BG_HAS_RENDER) |
1125 | { |
1138 | { |
1126 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
1139 | rgba c; |
1127 | |
1140 | |
1128 | if (bg_flags & BG_TINT_SET) |
|
|
1129 | tint.get (c); |
1141 | tint.get (c); |
1130 | |
1142 | |
1131 | if (shade <= 100) |
1143 | if (shade <= 100) |
1132 | { |
1144 | { |
1133 | c.r = c.r * shade / 100; |
1145 | c.r = c.r * shade / 100; |
1134 | c.g = c.g * shade / 100; |
1146 | c.g = c.g * shade / 100; |
… | |
… | |
1139 | c.r = c.r * (200 - shade) / 100; |
1151 | c.r = c.r * (200 - shade) / 100; |
1140 | c.g = c.g * (200 - shade) / 100; |
1152 | c.g = c.g * (200 - shade) / 100; |
1141 | c.b = c.b * (200 - shade) / 100; |
1153 | c.b = c.b * (200 - shade) / 100; |
1142 | } |
1154 | } |
1143 | |
1155 | |
1144 | XRenderPictFormat *solid_format = XRenderFindStandardFormat (dpy, PictStandardARGB32); |
|
|
1145 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1156 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1146 | XRenderPictureAttributes pa; |
|
|
1147 | |
1157 | |
1148 | Picture back_pic = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1158 | Picture back_pic = XRenderCreatePicture (dpy, pixmap, format, 0, 0); |
1149 | |
1159 | |
1150 | pa.repeat = True; |
1160 | Picture overlay_pic = create_xrender_mask (dpy, pixmap, True, False); |
1151 | |
1161 | |
1152 | Pixmap overlay_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); |
1162 | 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 | |
1163 | |
1161 | XRenderColor mask_c; |
1164 | XRenderColor mask_c; |
1162 | |
1165 | |
1163 | mask_c.alpha = 0xffff; |
1166 | mask_c.alpha = 0xffff; |
1164 | mask_c.red = |
1167 | mask_c.red = |
… | |
… | |
1169 | mask_c.alpha = 0; |
1172 | mask_c.alpha = 0; |
1170 | mask_c.red = 0xffff - c.r; |
1173 | mask_c.red = 0xffff - c.r; |
1171 | mask_c.green = 0xffff - c.g; |
1174 | mask_c.green = 0xffff - c.g; |
1172 | mask_c.blue = 0xffff - c.b; |
1175 | mask_c.blue = 0xffff - c.b; |
1173 | XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1); |
1176 | XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1); |
|
|
1177 | |
1174 | XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1178 | XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1175 | |
1179 | |
1176 | if (shade > 100) |
1180 | if (shade > 100) |
1177 | { |
1181 | { |
1178 | mask_c.red = mask_c.green = mask_c.blue = 0xffff * (shade - 100) / 100; |
|
|
1179 | mask_c.alpha = 0; |
1182 | mask_c.alpha = 0; |
|
|
1183 | mask_c.red = |
|
|
1184 | mask_c.green = |
|
|
1185 | mask_c.blue = 0xffff * (shade - 100) / 100; |
1180 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1186 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1181 | |
1187 | |
1182 | XRenderComposite (dpy, PictOpOver, overlay_pic, None, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1188 | XRenderComposite (dpy, PictOpOver, overlay_pic, None, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1183 | } |
1189 | } |
1184 | |
1190 | |
… | |
… | |
1247 | #if XRENDER |
1253 | #if XRENDER |
1248 | if (bg_flags & BG_HAS_RENDER) |
1254 | if (bg_flags & BG_HAS_RENDER) |
1249 | { |
1255 | { |
1250 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
1256 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
1251 | |
1257 | |
1252 | XRenderPictureAttributes pa; |
|
|
1253 | |
|
|
1254 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1258 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1255 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, &pa); |
1259 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, 0); |
1256 | |
1260 | |
1257 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
1261 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
1258 | Picture dst = XRenderCreatePicture (dpy, recoded_root_pmap, dst_format, 0, &pa); |
1262 | Picture dst = XRenderCreatePicture (dpy, recoded_root_pmap, dst_format, 0, 0); |
1259 | |
1263 | |
1260 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height); |
1264 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height); |
1261 | |
1265 | |
1262 | XRenderFreePicture (dpy, src); |
1266 | XRenderFreePicture (dpy, src); |
1263 | XRenderFreePicture (dpy, dst); |
1267 | XRenderFreePicture (dpy, dst); |
… | |
… | |
1293 | |
1297 | |
1294 | if (gc) |
1298 | if (gc) |
1295 | { |
1299 | { |
1296 | XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); |
1300 | XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); |
1297 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1301 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1298 | XFreeGC (dpy, gc); |
|
|
1299 | |
1302 | |
1300 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1303 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1301 | { |
1304 | { |
1302 | if (bg_flags & BG_NEEDS_BLUR) |
1305 | if (bg_flags & BG_NEEDS_BLUR) |
1303 | { |
1306 | { |
… | |
… | |
1307 | if (bg_flags & BG_NEEDS_TINT) |
1310 | if (bg_flags & BG_NEEDS_TINT) |
1308 | { |
1311 | { |
1309 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1312 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1310 | result &= ~BG_NEEDS_TINT; |
1313 | result &= ~BG_NEEDS_TINT; |
1311 | } |
1314 | } |
|
|
1315 | # ifndef HAVE_AFTERIMAGE |
|
|
1316 | if (result & BG_NEEDS_TINT) |
|
|
1317 | { |
|
|
1318 | XImage *ximage = XGetImage (dpy, bg_pixmap, 0, 0, bg_pmap_width, bg_pmap_height, AllPlanes, ZPixmap); |
|
|
1319 | if (ximage) |
|
|
1320 | { |
|
|
1321 | /* our own client-side tinting */ |
|
|
1322 | tint_ximage (DefaultVisual (dpy, display->screen), ximage); |
|
|
1323 | |
|
|
1324 | XPutImage (dpy, bg_pixmap, gc, ximage, 0, 0, 0, 0, ximage->width, ximage->height); |
|
|
1325 | XDestroyImage (ximage); |
|
|
1326 | } |
|
|
1327 | } |
|
|
1328 | # endif |
1312 | } /* server side rendering completed */ |
1329 | } /* server side rendering completed */ |
|
|
1330 | |
|
|
1331 | XFreeGC (dpy, gc); |
1313 | } |
1332 | } |
1314 | |
1333 | |
1315 | if (recoded_root_pmap != root_pixmap) |
1334 | if (recoded_root_pmap != root_pixmap) |
1316 | XFreePixmap (dpy, recoded_root_pmap); |
1335 | XFreePixmap (dpy, recoded_root_pmap); |
1317 | |
1336 | |
… | |
… | |
1353 | if (render_image (tr_flags)) |
1372 | if (render_image (tr_flags)) |
1354 | bg_flags |= BG_IS_VALID; |
1373 | bg_flags |= BG_IS_VALID; |
1355 | } |
1374 | } |
1356 | # endif |
1375 | # endif |
1357 | |
1376 | |
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)) |
1377 | if (!(bg_flags & BG_IS_VALID)) |
1387 | { |
1378 | { |
1388 | if (bg_pixmap != None) |
1379 | if (bg_pixmap != None) |
1389 | { |
1380 | { |
1390 | XFreePixmap (dpy, bg_pixmap); |
1381 | XFreePixmap (dpy, bg_pixmap); |
… | |
… | |
1402 | |
1393 | |
1403 | void |
1394 | void |
1404 | rxvt_term::bg_init () |
1395 | rxvt_term::bg_init () |
1405 | { |
1396 | { |
1406 | #ifdef ENABLE_TRANSPARENCY |
1397 | #ifdef ENABLE_TRANSPARENCY |
|
|
1398 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
|
|
1399 | tint.set (this, c); |
1407 | shade = 100; |
1400 | shade = 100; |
1408 | #endif |
1401 | #endif |
1409 | |
1402 | |
1410 | bg_flags &= ~(BG_HAS_RENDER | BG_HAS_RENDER_CONV); |
1403 | bg_flags &= ~(BG_HAS_RENDER | BG_HAS_RENDER_CONV); |
1411 | #if XRENDER |
1404 | #if XRENDER |
… | |
… | |
1514 | break; |
1507 | break; |
1515 | default: |
1508 | default: |
1516 | return; /* we do not support this color depth */ |
1509 | return; /* we do not support this color depth */ |
1517 | } |
1510 | } |
1518 | |
1511 | |
1519 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
1512 | rgba c; |
1520 | |
1513 | |
1521 | if (bg_flags & BG_TINT_SET) |
|
|
1522 | tint.get (c); |
1514 | tint.get (c); |
1523 | |
1515 | |
1524 | /* prepare limits for color transformation (each channel is handled separately) */ |
1516 | /* prepare limits for color transformation (each channel is handled separately) */ |
1525 | if (shade > 100) |
1517 | if (shade > 100) |
1526 | { |
1518 | { |
1527 | c.r = c.r * (200 - shade) / 100; |
1519 | c.r = c.r * (200 - shade) / 100; |