… | |
… | |
1033 | bool |
1033 | bool |
1034 | rxvt_term::blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height) |
1034 | rxvt_term::blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height) |
1035 | { |
1035 | { |
1036 | bool ret = false; |
1036 | bool ret = false; |
1037 | #if XRENDER |
1037 | #if XRENDER |
|
|
1038 | if (!(bg_flags & BG_HAS_RENDER_CONV)) |
|
|
1039 | return false; |
|
|
1040 | |
1038 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
1041 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
1039 | double *kernel = (double *)malloc (size * sizeof (double)); |
1042 | double *kernel = (double *)malloc (size * sizeof (double)); |
1040 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
1043 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
1041 | |
1044 | |
1042 | XRenderPictureAttributes pa; |
1045 | XRenderPictureAttributes pa; |
… | |
… | |
1115 | XFillRectangle (dpy, pixmap, gc, 0, 0, width, height); |
1118 | XFillRectangle (dpy, pixmap, gc, 0, 0, width, height); |
1116 | ret = true; |
1119 | ret = true; |
1117 | XFreeGC (dpy, gc); |
1120 | XFreeGC (dpy, gc); |
1118 | } |
1121 | } |
1119 | } |
1122 | } |
1120 | else |
|
|
1121 | { |
|
|
1122 | # if XRENDER |
1123 | # if XRENDER |
|
|
1124 | else if (bg_flags & BG_HAS_RENDER) |
|
|
1125 | { |
1123 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
1126 | rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC); |
1124 | |
1127 | |
1125 | if (bg_flags & BG_TINT_SET) |
1128 | if (bg_flags & BG_TINT_SET) |
1126 | tint.get (c); |
1129 | tint.get (c); |
1127 | |
1130 | |
… | |
… | |
1182 | ret = true; |
1185 | ret = true; |
1183 | |
1186 | |
1184 | XRenderFreePicture (dpy, mask_pic); |
1187 | XRenderFreePicture (dpy, mask_pic); |
1185 | XRenderFreePicture (dpy, overlay_pic); |
1188 | XRenderFreePicture (dpy, overlay_pic); |
1186 | XRenderFreePicture (dpy, back_pic); |
1189 | XRenderFreePicture (dpy, back_pic); |
|
|
1190 | } |
1187 | # endif |
1191 | # endif |
1188 | } |
|
|
1189 | |
1192 | |
1190 | return ret; |
1193 | return ret; |
1191 | } |
1194 | } |
1192 | |
1195 | |
1193 | /* |
1196 | /* |
… | |
… | |
1294 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1297 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1295 | XFreeGC (dpy, gc); |
1298 | XFreeGC (dpy, gc); |
1296 | |
1299 | |
1297 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1300 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1298 | { |
1301 | { |
1299 | if ((bg_flags & BG_NEEDS_BLUR) |
1302 | if (bg_flags & BG_NEEDS_BLUR) |
1300 | && (bg_flags & BG_HAS_RENDER_CONV)) |
|
|
1301 | { |
1303 | { |
1302 | if (blur_pixmap (bg_pixmap, visual, window_width, window_height)) |
1304 | if (blur_pixmap (bg_pixmap, visual, window_width, window_height)) |
1303 | result &= ~BG_NEEDS_BLUR; |
1305 | result &= ~BG_NEEDS_BLUR; |
1304 | } |
1306 | } |
1305 | if ((bg_flags & BG_NEEDS_TINT) |
1307 | if (bg_flags & BG_NEEDS_TINT) |
1306 | && (bg_flags & (BG_TINT_BITAND | BG_HAS_RENDER))) |
|
|
1307 | { |
1308 | { |
1308 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1309 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1309 | result &= ~BG_NEEDS_TINT; |
1310 | result &= ~BG_NEEDS_TINT; |
1310 | } |
1311 | } |
1311 | } /* server side rendering completed */ |
1312 | } /* server side rendering completed */ |