… | |
… | |
484 | return false; |
484 | return false; |
485 | |
485 | |
486 | bool need_blend = bg_flags & BG_IS_VALID; |
486 | bool need_blend = bg_flags & BG_IS_VALID; |
487 | |
487 | |
488 | if (need_blend |
488 | if (need_blend |
489 | && !(bg_flags & BG_HAS_RENDER)) |
489 | && !(display->flags & DISPLAY_HAS_RENDER)) |
490 | return false; |
490 | return false; |
491 | |
491 | |
492 | GdkPixbuf *result; |
492 | GdkPixbuf *result; |
493 | |
493 | |
494 | int image_width = gdk_pixbuf_get_width (pixbuf); |
494 | int image_width = gdk_pixbuf_get_width (pixbuf); |
… | |
… | |
837 | bool |
837 | bool |
838 | rxvt_term::blur_pixmap (Pixmap pixmap, int width, int height, bool argb, int h_blurRadius, int v_blurRadius) |
838 | rxvt_term::blur_pixmap (Pixmap pixmap, int width, int height, bool argb, int h_blurRadius, int v_blurRadius) |
839 | { |
839 | { |
840 | bool ret = false; |
840 | bool ret = false; |
841 | #if XRENDER |
841 | #if XRENDER |
842 | if (!(bg_flags & BG_HAS_RENDER_CONV)) |
842 | if (!(display->flags & DISPLAY_HAS_RENDER_CONV)) |
843 | return false; |
843 | return false; |
844 | |
844 | |
845 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
845 | int size = max (h_blurRadius, v_blurRadius) * 2 + 1; |
846 | double *kernel = (double *)malloc (size * sizeof (double)); |
846 | double *kernel = (double *)malloc (size * sizeof (double)); |
847 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
847 | XFixed *params = (XFixed *)malloc ((size + 2) * sizeof (XFixed)); |
… | |
… | |
931 | ret = true; |
931 | ret = true; |
932 | XFreeGC (dpy, gc); |
932 | XFreeGC (dpy, gc); |
933 | } |
933 | } |
934 | } |
934 | } |
935 | # if XRENDER |
935 | # if XRENDER |
936 | else if (bg_flags & BG_HAS_RENDER) |
936 | else if (display->flags & DISPLAY_HAS_RENDER) |
937 | { |
937 | { |
938 | if (shade <= 100) |
938 | if (shade <= 100) |
939 | { |
939 | { |
940 | c.r = c.r * shade / 100; |
940 | c.r = c.r * shade / 100; |
941 | c.g = c.g * shade / 100; |
941 | c.g = c.g * shade / 100; |
… | |
… | |
1046 | Pixmap recoded_root_pmap = root_pixmap; |
1046 | Pixmap recoded_root_pmap = root_pixmap; |
1047 | |
1047 | |
1048 | if (root_pixmap != None && root_depth != depth) |
1048 | if (root_pixmap != None && root_depth != depth) |
1049 | { |
1049 | { |
1050 | #if XRENDER |
1050 | #if XRENDER |
1051 | if (bg_flags & BG_HAS_RENDER) |
1051 | if (display->flags & DISPLAY_HAS_RENDER) |
1052 | { |
1052 | { |
1053 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
1053 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
1054 | |
1054 | |
1055 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1055 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1056 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, 0); |
1056 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, 0); |
… | |
… | |
1183 | } |
1183 | } |
1184 | |
1184 | |
1185 | void |
1185 | void |
1186 | rxvt_term::bg_init () |
1186 | rxvt_term::bg_init () |
1187 | { |
1187 | { |
1188 | bg_flags &= ~(BG_HAS_RENDER | BG_HAS_RENDER_CONV); |
|
|
1189 | #if XRENDER |
|
|
1190 | int major, minor; |
|
|
1191 | if (XRenderQueryVersion (dpy, &major, &minor)) |
|
|
1192 | bg_flags |= BG_HAS_RENDER; |
|
|
1193 | XFilters *filters = XRenderQueryFilters (dpy, vt); |
|
|
1194 | if (filters) |
|
|
1195 | { |
|
|
1196 | for (int i = 0; i < filters->nfilter; i++) |
|
|
1197 | if (!strcmp (filters->filter[i], FilterConvolution)) |
|
|
1198 | bg_flags |= BG_HAS_RENDER_CONV; |
|
|
1199 | |
|
|
1200 | XFree (filters); |
|
|
1201 | } |
|
|
1202 | #endif |
|
|
1203 | |
|
|
1204 | #ifdef BG_IMAGE_FROM_FILE |
1188 | #ifdef BG_IMAGE_FROM_FILE |
1205 | if (rs[Rs_backgroundPixmap]) |
1189 | if (rs[Rs_backgroundPixmap]) |
1206 | { |
1190 | { |
1207 | rxvt_image *image = new_image (); |
1191 | rxvt_image *image = new_image (); |
1208 | if (!image->set_file_geometry (rs[Rs_backgroundPixmap])) |
1192 | if (!image->set_file_geometry (rs[Rs_backgroundPixmap])) |