… | |
… | |
758 | params[i+2] = XDoubleToFixed (kernel[i] / sum); |
758 | params[i+2] = XDoubleToFixed (kernel[i] / sum); |
759 | } |
759 | } |
760 | #endif |
760 | #endif |
761 | |
761 | |
762 | bool |
762 | bool |
763 | rxvt_term::blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height, int depth) |
763 | rxvt_term::blur_pixmap (Pixmap pixmap, int width, int height) |
764 | { |
764 | { |
765 | bool ret = false; |
765 | bool ret = false; |
766 | #if XRENDER |
766 | #if XRENDER |
767 | if (!(bg_flags & BG_HAS_RENDER_CONV)) |
767 | if (!(bg_flags & BG_HAS_RENDER_CONV)) |
768 | return false; |
768 | return false; |
… | |
… | |
823 | #endif |
823 | #endif |
824 | return ret; |
824 | return ret; |
825 | } |
825 | } |
826 | |
826 | |
827 | bool |
827 | bool |
828 | rxvt_term::tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height) |
828 | rxvt_term::tint_pixmap (Pixmap pixmap, int width, int height) |
829 | { |
829 | { |
830 | bool ret = false; |
830 | bool ret = false; |
831 | |
831 | |
832 | if (shade == 100 && (bg_flags & BG_TINT_BITAND)) |
832 | if (shade == 100 && (bg_flags & BG_TINT_BITAND)) |
833 | { |
833 | { |
… | |
… | |
1020 | |
1020 | |
1021 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1021 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1022 | { |
1022 | { |
1023 | if (need_blur) |
1023 | if (need_blur) |
1024 | { |
1024 | { |
1025 | if (blur_pixmap (bg_pixmap, visual, window_width, window_height, depth)) |
1025 | if (blur_pixmap (bg_pixmap, window_width, window_height)) |
1026 | need_blur = false; |
1026 | need_blur = false; |
1027 | } |
1027 | } |
1028 | if (need_tint) |
1028 | if (need_tint) |
1029 | { |
1029 | { |
1030 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1030 | if (tint_pixmap (bg_pixmap, window_width, window_height)) |
1031 | need_tint = false; |
1031 | need_tint = false; |
1032 | } |
1032 | } |
1033 | if (need_tint) |
1033 | if (need_tint) |
1034 | { |
1034 | { |
1035 | XImage *ximage = XGetImage (dpy, bg_pixmap, 0, 0, bg_pmap_width, bg_pmap_height, AllPlanes, ZPixmap); |
1035 | XImage *ximage = XGetImage (dpy, bg_pixmap, 0, 0, bg_pmap_width, bg_pmap_height, AllPlanes, ZPixmap); |
1036 | if (ximage) |
1036 | if (ximage) |
1037 | { |
1037 | { |
1038 | /* our own client-side tinting */ |
1038 | /* our own client-side tinting */ |
1039 | tint_ximage (DefaultVisual (dpy, display->screen), ximage); |
1039 | tint_ximage (ximage); |
1040 | |
1040 | |
1041 | XPutImage (dpy, bg_pixmap, gc, ximage, 0, 0, 0, 0, ximage->width, ximage->height); |
1041 | XPutImage (dpy, bg_pixmap, gc, ximage, 0, 0, 0, 0, ximage->width, ximage->height); |
1042 | XDestroyImage (ximage); |
1042 | XDestroyImage (ximage); |
1043 | } |
1043 | } |
1044 | } |
1044 | } |
… | |
… | |
1145 | lookup[i] = (tmp / 0xffff) << sh; |
1145 | lookup[i] = (tmp / 0xffff) << sh; |
1146 | } |
1146 | } |
1147 | } |
1147 | } |
1148 | |
1148 | |
1149 | void |
1149 | void |
1150 | rxvt_term::tint_ximage (Visual *visual, XImage *ximage) |
1150 | rxvt_term::tint_ximage (XImage *ximage) |
1151 | { |
1151 | { |
1152 | unsigned int size_r, size_g, size_b; |
1152 | unsigned int size_r, size_g, size_b; |
1153 | int sh_r, sh_g, sh_b; |
1153 | int sh_r, sh_g, sh_b; |
1154 | uint32_t mask_r, mask_g, mask_b; |
1154 | uint32_t mask_r, mask_g, mask_b; |
1155 | uint32_t *lookup, *lookup_r, *lookup_g, *lookup_b; |
1155 | uint32_t *lookup, *lookup_r, *lookup_g, *lookup_b; |