… | |
… | |
514 | as_shade.tintColor.blue = c.b; |
514 | as_shade.tintColor.blue = c.b; |
515 | |
515 | |
516 | background_tint = shading2tint32 (&as_shade); |
516 | background_tint = shading2tint32 (&as_shade); |
517 | } |
517 | } |
518 | |
518 | |
519 | if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL) |
519 | if (!(background_flags & transpPmapBlurred) && (flags & blurNeeded) && background != NULL) |
520 | { |
520 | { |
521 | ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF, |
521 | ASImage *tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF, |
522 | (original_asim == NULL || tint == TINT_LEAVE_SAME) ? ASA_XImage : ASA_ASImage, |
522 | (original_asim == NULL || tint == TINT_LEAVE_SAME) ? ASA_XImage : ASA_ASImage, |
523 | 100, ASIMAGE_QUALITY_DEFAULT); |
523 | 100, ASIMAGE_QUALITY_DEFAULT); |
524 | if (tmp) |
524 | if (tmp) |
… | |
… | |
1050 | |
1050 | |
1051 | return false; |
1051 | return false; |
1052 | } |
1052 | } |
1053 | |
1053 | |
1054 | bool |
1054 | bool |
1055 | bgPixmap_t::tint_pixmap (Pixmap pixmap, Window root, int width, int height) |
1055 | bgPixmap_t::tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height) |
1056 | { |
1056 | { |
1057 | Display *dpy = target->dpy; |
1057 | Display *dpy = target->dpy; |
1058 | bool ret = false; |
1058 | bool ret = false; |
1059 | |
1059 | |
1060 | if (flags & tintWholesome) |
1060 | if (flags & tintWholesome) |
… | |
… | |
1066 | * performance improvements, as we eliminate XImage transfer |
1066 | * performance improvements, as we eliminate XImage transfer |
1067 | */ |
1067 | */ |
1068 | gcv.foreground = Pixel (tint); |
1068 | gcv.foreground = Pixel (tint); |
1069 | gcv.function = GXand; |
1069 | gcv.function = GXand; |
1070 | gcv.fill_style = FillSolid; |
1070 | gcv.fill_style = FillSolid; |
1071 | gc = XCreateGC (dpy, root, GCFillStyle | GCForeground | GCFunction, &gcv); |
1071 | gc = XCreateGC (dpy, pixmap, GCFillStyle | GCForeground | GCFunction, &gcv); |
1072 | if (gc) |
1072 | if (gc) |
1073 | { |
1073 | { |
1074 | XFillRectangle (dpy, pixmap, gc, 0, 0, width, height); |
1074 | XFillRectangle (dpy, pixmap, gc, 0, 0, width, height); |
1075 | ret = true; |
1075 | ret = true; |
1076 | XFreeGC (dpy, gc); |
1076 | XFreeGC (dpy, gc); |
… | |
… | |
1096 | c.g = ((0xffff - c.g) * (200 - shade)) / 100; |
1096 | c.g = ((0xffff - c.g) * (200 - shade)) / 100; |
1097 | c.b = ((0xffff - c.b) * (200 - shade)) / 100; |
1097 | c.b = ((0xffff - c.b) * (200 - shade)) / 100; |
1098 | } |
1098 | } |
1099 | |
1099 | |
1100 | XRenderPictFormat *solid_format = XRenderFindStandardFormat (dpy, PictStandardARGB32); |
1100 | XRenderPictFormat *solid_format = XRenderFindStandardFormat (dpy, PictStandardARGB32); |
1101 | XRenderPictFormat *root_format = XRenderFindVisualFormat (dpy, DefaultVisualOfScreen (ScreenOfDisplay (dpy, target->display->screen))); |
1101 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1102 | XRenderPictureAttributes pa; |
1102 | XRenderPictureAttributes pa; |
1103 | |
1103 | |
1104 | Picture back_pic = XRenderCreatePicture (dpy, pixmap, root_format, 0, &pa); |
1104 | Picture back_pic = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1105 | |
1105 | |
1106 | pa.repeat = True; |
1106 | pa.repeat = True; |
1107 | |
1107 | |
1108 | Pixmap overlay_pmap = XCreatePixmap (dpy, root, 1, 1, 32); |
1108 | Pixmap overlay_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); |
1109 | Picture overlay_pic = XRenderCreatePicture (dpy, overlay_pmap, solid_format, CPRepeat, &pa); |
1109 | Picture overlay_pic = XRenderCreatePicture (dpy, overlay_pmap, solid_format, CPRepeat, &pa); |
1110 | XFreePixmap (dpy, overlay_pmap); |
1110 | XFreePixmap (dpy, overlay_pmap); |
1111 | |
1111 | |
1112 | pa.component_alpha = True; |
1112 | pa.component_alpha = True; |
1113 | Pixmap mask_pmap = XCreatePixmap (dpy, root, 1, 1, 32); |
1113 | Pixmap mask_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); |
1114 | Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat|CPComponentAlpha, &pa); |
1114 | Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat|CPComponentAlpha, &pa); |
1115 | XFreePixmap (dpy, mask_pmap); |
1115 | XFreePixmap (dpy, mask_pmap); |
1116 | |
1116 | |
1117 | if (mask_pic && overlay_pic && back_pic) |
1117 | if (mask_pic && overlay_pic && back_pic) |
1118 | { |
1118 | { |
… | |
… | |
1178 | || sx >= root_width || sy >= root_height) |
1178 | || sx >= root_width || sy >= root_height) |
1179 | return 0; |
1179 | return 0; |
1180 | |
1180 | |
1181 | if (root_pixmap != None) |
1181 | if (root_pixmap != None) |
1182 | { |
1182 | { |
1183 | /* we want to validate the pixmap and get it's size at the same time : */ |
1183 | /* we want to validate the pixmap and get its size at the same time : */ |
1184 | int junk; |
1184 | int junk; |
1185 | unsigned int ujunk; |
1185 | unsigned int ujunk; |
1186 | /* root pixmap may be bad - allow a error */ |
1186 | /* root pixmap may be bad - allow a error */ |
1187 | target->allowedxerror = -1; |
1187 | target->allowedxerror = -1; |
1188 | |
1188 | |
… | |
… | |
1278 | { |
1278 | { |
1279 | if (!need_client_side_rendering ()) |
1279 | if (!need_client_side_rendering ()) |
1280 | { |
1280 | { |
1281 | if ((flags & tintNeeded)) |
1281 | if ((flags & tintNeeded)) |
1282 | { |
1282 | { |
1283 | if (tint_pixmap (tiled_root_pmap, root, window_width, window_height)) |
1283 | if (tint_pixmap (tiled_root_pmap, DefaultVisual (dpy, target->display->screen), window_width, window_height)) |
1284 | result |= transpPmapTinted; |
1284 | result |= transpPmapTinted; |
1285 | } |
1285 | } |
1286 | } /* server side rendering completed */ |
1286 | } /* server side rendering completed */ |
1287 | |
1287 | |
1288 | if (pixmap) |
1288 | if (pixmap) |