… | |
… | |
260 | |
260 | |
261 | for (int i = 0; arr[i]; i++) |
261 | for (int i = 0; arr[i]; i++) |
262 | { |
262 | { |
263 | if (!strcasecmp (arr[i], "tile")) |
263 | if (!strcasecmp (arr[i], "tile")) |
264 | { |
264 | { |
|
|
265 | new_flags |= BG_TILE; |
265 | w = h = noScale; |
266 | w = h = noScale; |
266 | geom_flags |= WidthValue|HeightValue; |
267 | geom_flags |= WidthValue|HeightValue; |
267 | } |
268 | } |
268 | else if (!strcasecmp (arr[i], "propscale")) |
269 | else if (!strcasecmp (arr[i], "propscale")) |
269 | { |
270 | { |
… | |
… | |
296 | x = y = centerAlign; |
297 | x = y = centerAlign; |
297 | geom_flags |= WidthValue|HeightValue|XValue|YValue; |
298 | geom_flags |= WidthValue|HeightValue|XValue|YValue; |
298 | } |
299 | } |
299 | else if (!strcasecmp (arr[i], "root")) |
300 | else if (!strcasecmp (arr[i], "root")) |
300 | { |
301 | { |
301 | new_flags |= BG_ROOT_ALIGN; |
302 | new_flags |= BG_TILE|BG_ROOT_ALIGN; |
302 | w = h = noScale; |
303 | w = h = noScale; |
303 | geom_flags |= WidthValue|HeightValue; |
304 | geom_flags |= WidthValue|HeightValue; |
304 | } |
305 | } |
305 | } /* done parsing ops */ |
306 | } /* done parsing ops */ |
306 | |
307 | |
… | |
… | |
353 | x = make_align_position (h_align, target_width, w); |
354 | x = make_align_position (h_align, target_width, w); |
354 | y = make_align_position (v_align, target_height, h); |
355 | y = make_align_position (v_align, target_height, h); |
355 | } |
356 | } |
356 | |
357 | |
357 | bg_flags &= ~BG_IS_SIZE_SENSITIVE; |
358 | bg_flags &= ~BG_IS_SIZE_SENSITIVE; |
|
|
359 | if (!(bg_flags & BG_TILE) |
358 | if ((bg_flags & BG_PROP_SCALE) || h_scale || v_scale |
360 | || (bg_flags & BG_PROP_SCALE) || h_scale || v_scale |
359 | || (!(bg_flags & BG_ROOT_ALIGN) && (h_align || v_align)) |
361 | || (!(bg_flags & BG_ROOT_ALIGN) && (h_align || v_align)) |
360 | || w > target_width || h > target_height) |
362 | || w > target_width || h > target_height) |
361 | bg_flags |= BG_IS_SIZE_SENSITIVE; |
363 | bg_flags |= BG_IS_SIZE_SENSITIVE; |
362 | } |
364 | } |
363 | |
365 | |
… | |
… | |
455 | 100, ASIMAGE_QUALITY_DEFAULT); |
457 | 100, ASIMAGE_QUALITY_DEFAULT); |
456 | } |
458 | } |
457 | |
459 | |
458 | if (background == NULL) |
460 | if (background == NULL) |
459 | { |
461 | { |
460 | if (h_scale == 0 || v_scale == 0) |
462 | if (bg_flags & BG_TILE) |
461 | { |
463 | { |
462 | /* if tiling - pixmap has to be sized exactly as the image, |
464 | /* if tiling - pixmap has to be sized exactly as the image, |
463 | but there is no need to make it bigger than the window! */ |
465 | but there is no need to make it bigger than the window! */ |
464 | new_pmap_width = min (result->width, target_width); |
466 | new_pmap_width = min (result->width, target_width); |
465 | new_pmap_height = min (result->height, target_height); |
467 | new_pmap_height = min (result->height, target_height); |
… | |
… | |
490 | layers[0].clip_width = target_width; |
492 | layers[0].clip_width = target_width; |
491 | layers[0].clip_height = target_height; |
493 | layers[0].clip_height = target_height; |
492 | layers[0].tint = background_tint; |
494 | layers[0].tint = background_tint; |
493 | layers[1].im = result; |
495 | layers[1].im = result; |
494 | |
496 | |
495 | if (h_scale == 0 || v_scale == 0) |
497 | if (bg_flags & BG_TILE) |
496 | { |
498 | { |
497 | /* tile horizontally */ |
499 | /* tile horizontally */ |
498 | while (x > 0) x -= (int)result->width; |
500 | while (x > 0) x -= (int)result->width; |
499 | layers[1].dst_x = x; |
501 | layers[1].dst_x = x; |
500 | layers[1].clip_width = result->width+target_width; |
502 | layers[1].clip_width = result->width+target_width; |
… | |
… | |
504 | /* clip horizontally */ |
506 | /* clip horizontally */ |
505 | layers[1].dst_x = x; |
507 | layers[1].dst_x = x; |
506 | layers[1].clip_width = result->width; |
508 | layers[1].clip_width = result->width; |
507 | } |
509 | } |
508 | |
510 | |
509 | if (h_scale == 0 || v_scale == 0) |
511 | if (bg_flags & BG_TILE) |
510 | { |
512 | { |
511 | while (y > 0) y -= (int)result->height; |
513 | while (y > 0) y -= (int)result->height; |
512 | layers[1].dst_y = y; |
514 | layers[1].dst_y = y; |
513 | layers[1].clip_height = result->height + target_height; |
515 | layers[1].clip_height = result->height + target_height; |
514 | } |
516 | } |
… | |
… | |
564 | |
566 | |
565 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
567 | int src_x = 0, src_y = 0, dst_x = 0, dst_y = 0; |
566 | int dst_width = result->width, dst_height = result->height; |
568 | int dst_width = result->width, dst_height = result->height; |
567 | if (background == NULL) |
569 | if (background == NULL) |
568 | { |
570 | { |
569 | if (!(h_scale == 0 || v_scale == 0)) |
571 | if (!(bg_flags & BG_TILE)) |
570 | { |
572 | { |
571 | src_x = make_clip_rectangle (x, result->width , new_pmap_width , dst_x, dst_width ); |
573 | src_x = make_clip_rectangle (x, result->width , new_pmap_width , dst_x, dst_width ); |
572 | src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height); |
574 | src_y = make_clip_rectangle (y, result->height, new_pmap_height, dst_y, dst_height); |
573 | } |
575 | } |
574 | |
576 | |
… | |
… | |
620 | else if (depth == 15 || depth == 16) |
622 | else if (depth == 15 || depth == 16) |
621 | bytes_per_pixel = 2; |
623 | bytes_per_pixel = 2; |
622 | else |
624 | else |
623 | return false; |
625 | return false; |
624 | |
626 | |
625 | width_r = rxvt_popcount (visual->red_mask); |
627 | width_r = ecb_popcount32 (visual->red_mask); |
626 | width_g = rxvt_popcount (visual->green_mask); |
628 | width_g = ecb_popcount32 (visual->green_mask); |
627 | width_b = rxvt_popcount (visual->blue_mask); |
629 | width_b = ecb_popcount32 (visual->blue_mask); |
628 | |
630 | |
629 | if (width_r > 8 || width_g > 8 || width_b > 8) |
631 | if (width_r > 8 || width_g > 8 || width_b > 8) |
630 | return false; |
632 | return false; |
631 | |
633 | |
632 | sh_r = rxvt_ctz (visual->red_mask); |
634 | sh_r = ecb_ctz32 (visual->red_mask); |
633 | sh_g = rxvt_ctz (visual->green_mask); |
635 | sh_g = ecb_ctz32 (visual->green_mask); |
634 | sh_b = rxvt_ctz (visual->blue_mask); |
636 | sh_b = ecb_ctz32 (visual->blue_mask); |
635 | |
637 | |
636 | if (width > INT_MAX / height / bytes_per_pixel) |
638 | if (width > INT_MAX / height / bytes_per_pixel) |
637 | return false; |
639 | return false; |
638 | |
640 | |
639 | data = (char *)malloc (width * height * bytes_per_pixel); |
641 | data = (char *)malloc (width * height * bytes_per_pixel); |
… | |
… | |
646 | { |
648 | { |
647 | free (data); |
649 | free (data); |
648 | return false; |
650 | return false; |
649 | } |
651 | } |
650 | |
652 | |
651 | ximage->byte_order = byteorder::big_endian () ? MSBFirst : LSBFirst; |
653 | ximage->byte_order = ecb_big_endian () ? MSBFirst : LSBFirst; |
652 | |
654 | |
653 | rowstride = gdk_pixbuf_get_rowstride (pixbuf); |
655 | rowstride = gdk_pixbuf_get_rowstride (pixbuf); |
654 | channels = gdk_pixbuf_get_n_channels (pixbuf); |
656 | channels = gdk_pixbuf_get_n_channels (pixbuf); |
655 | row = gdk_pixbuf_get_pixels (pixbuf) + src_y * rowstride + src_x * channels; |
657 | row = gdk_pixbuf_get_pixels (pixbuf) + src_y * rowstride + src_x * channels; |
656 | line = data; |
658 | line = data; |
… | |
… | |
728 | if (!result) |
730 | if (!result) |
729 | return false; |
731 | return false; |
730 | |
732 | |
731 | bool ret = false; |
733 | bool ret = false; |
732 | |
734 | |
733 | XGCValues gcv; |
735 | XGCValues gcv; |
734 | GC gc; |
736 | GC gc; |
735 | Pixmap root_pmap; |
737 | Pixmap root_pmap; |
736 | |
738 | |
737 | image_width = gdk_pixbuf_get_width (result); |
739 | image_width = gdk_pixbuf_get_width (result); |
738 | image_height = gdk_pixbuf_get_height (result); |
740 | image_height = gdk_pixbuf_get_height (result); |
739 | |
741 | |
740 | if (tr_flags) |
742 | if (tr_flags) |
741 | { |
743 | { |
742 | root_pmap = bg_pixmap; |
744 | root_pmap = bg_pixmap; |
743 | bg_pixmap = None; |
745 | bg_pixmap = None; |
|
|
746 | } |
|
|
747 | else |
|
|
748 | { |
|
|
749 | if (bg_flags & BG_TILE) |
744 | } |
750 | { |
745 | else |
|
|
746 | { |
|
|
747 | if (h_scale == 0 || v_scale == 0) |
|
|
748 | { |
|
|
749 | new_pmap_width = min (image_width, target_width); |
751 | new_pmap_width = min (image_width, target_width); |
750 | new_pmap_height = min (image_height, target_height); |
752 | new_pmap_height = min (image_height, target_height); |
751 | } |
753 | } |
752 | } |
754 | } |
753 | |
755 | |
754 | if (bg_pixmap == None |
756 | if (bg_pixmap == None |
755 | || bg_pmap_width != new_pmap_width |
757 | || bg_pmap_width != new_pmap_width |
756 | || bg_pmap_height != new_pmap_height) |
758 | || bg_pmap_height != new_pmap_height) |
757 | { |
759 | { |
758 | if (bg_pixmap) |
760 | if (bg_pixmap) |
759 | XFreePixmap (dpy, bg_pixmap); |
761 | XFreePixmap (dpy, bg_pixmap); |
760 | bg_pixmap = XCreatePixmap (dpy, vt, new_pmap_width, new_pmap_height, depth); |
762 | bg_pixmap = XCreatePixmap (dpy, vt, new_pmap_width, new_pmap_height, depth); |
761 | bg_pmap_width = new_pmap_width; |
763 | bg_pmap_width = new_pmap_width; |
762 | bg_pmap_height = new_pmap_height; |
764 | bg_pmap_height = new_pmap_height; |
763 | } |
765 | } |
764 | |
766 | |
765 | gcv.foreground = pix_colors[Color_bg]; |
767 | gcv.foreground = pix_colors[Color_bg]; |
766 | gc = XCreateGC (dpy, vt, GCForeground, &gcv); |
768 | gc = XCreateGC (dpy, vt, GCForeground, &gcv); |
767 | |
769 | |
768 | if (h_scale == 0 || v_scale == 0) |
770 | if (gc) |
|
|
771 | { |
|
|
772 | if (bg_flags & BG_TILE) |
769 | { |
773 | { |
770 | Pixmap tile = XCreatePixmap (dpy, vt, image_width, image_height, depth); |
774 | Pixmap tile = XCreatePixmap (dpy, vt, image_width, image_height, depth); |
771 | pixbuf_to_pixmap (result, tile, gc, |
775 | pixbuf_to_pixmap (result, tile, gc, |
772 | 0, 0, |
776 | 0, 0, |
773 | 0, 0, |
777 | 0, 0, |
… | |
… | |
817 | Pixmap mask_pmap = XCreatePixmap (dpy, vt, 1, 1, 8); |
821 | Pixmap mask_pmap = XCreatePixmap (dpy, vt, 1, 1, 8); |
818 | XRenderPictFormat *mask_format = XRenderFindStandardFormat (dpy, PictStandardA8); |
822 | XRenderPictFormat *mask_format = XRenderFindStandardFormat (dpy, PictStandardA8); |
819 | Picture mask = XRenderCreatePicture (dpy, mask_pmap, mask_format, CPRepeat, &pa); |
823 | Picture mask = XRenderCreatePicture (dpy, mask_pmap, mask_format, CPRepeat, &pa); |
820 | XFreePixmap (dpy, mask_pmap); |
824 | XFreePixmap (dpy, mask_pmap); |
821 | |
825 | |
822 | if (src && dst && mask) |
|
|
823 | { |
|
|
824 | XRenderColor mask_c; |
826 | XRenderColor mask_c; |
825 | |
827 | |
826 | mask_c.alpha = 0x8000; |
828 | mask_c.alpha = 0x8000; |
827 | mask_c.red = 0; |
829 | mask_c.red = 0; |
828 | mask_c.green = 0; |
830 | mask_c.green = 0; |
829 | mask_c.blue = 0; |
831 | mask_c.blue = 0; |
830 | XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1); |
832 | XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1); |
831 | XRenderComposite (dpy, PictOpOver, src, mask, dst, 0, 0, 0, 0, 0, 0, target_width, target_height); |
833 | XRenderComposite (dpy, PictOpOver, src, mask, dst, 0, 0, 0, 0, 0, 0, target_width, target_height); |
832 | } |
|
|
833 | |
834 | |
834 | XRenderFreePicture (dpy, src); |
835 | XRenderFreePicture (dpy, src); |
835 | XRenderFreePicture (dpy, dst); |
836 | XRenderFreePicture (dpy, dst); |
836 | XRenderFreePicture (dpy, mask); |
837 | XRenderFreePicture (dpy, mask); |
837 | |
|
|
838 | XFreePixmap (dpy, root_pmap); |
|
|
839 | } |
838 | } |
840 | #endif |
839 | #endif |
841 | |
840 | |
842 | if (result != pixbuf) |
|
|
843 | g_object_unref (result); |
|
|
844 | |
|
|
845 | XFreeGC (dpy, gc); |
841 | XFreeGC (dpy, gc); |
846 | |
842 | |
847 | ret = true; |
843 | ret = true; |
|
|
844 | } |
|
|
845 | |
|
|
846 | if (result != pixbuf) |
|
|
847 | g_object_unref (result); |
|
|
848 | |
|
|
849 | if (tr_flags) |
|
|
850 | XFreePixmap (dpy, root_pmap); |
848 | |
851 | |
849 | return ret; |
852 | return ret; |
850 | } |
853 | } |
851 | # endif /* HAVE_PIXBUF */ |
854 | # endif /* HAVE_PIXBUF */ |
852 | |
855 | |
… | |
… | |
1036 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1039 | XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual); |
1037 | |
1040 | |
1038 | Picture src = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1041 | Picture src = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1039 | Picture dst = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1042 | Picture dst = XRenderCreatePicture (dpy, pixmap, format, 0, &pa); |
1040 | |
1043 | |
1041 | if (kernel && params && src && dst) |
1044 | if (kernel && params) |
1042 | { |
1045 | { |
1043 | if (h_blurRadius) |
1046 | if (h_blurRadius) |
1044 | { |
1047 | { |
1045 | size = h_blurRadius * 2 + 1; |
1048 | size = h_blurRadius * 2 + 1; |
1046 | get_gaussian_kernel (h_blurRadius, size, kernel, params); |
1049 | get_gaussian_kernel (h_blurRadius, size, kernel, params); |
… | |
… | |
1146 | pa.component_alpha = True; |
1149 | pa.component_alpha = True; |
1147 | Pixmap mask_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); |
1150 | Pixmap mask_pmap = XCreatePixmap (dpy, pixmap, 1, 1, 32); |
1148 | Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat | CPComponentAlpha, &pa); |
1151 | Picture mask_pic = XRenderCreatePicture (dpy, mask_pmap, solid_format, CPRepeat | CPComponentAlpha, &pa); |
1149 | XFreePixmap (dpy, mask_pmap); |
1152 | XFreePixmap (dpy, mask_pmap); |
1150 | |
1153 | |
1151 | if (mask_pic && overlay_pic && back_pic) |
|
|
1152 | { |
|
|
1153 | XRenderColor mask_c; |
1154 | XRenderColor mask_c; |
1154 | |
1155 | |
1155 | mask_c.alpha = 0xffff; |
1156 | mask_c.alpha = 0xffff; |
1156 | mask_c.red = |
1157 | mask_c.red = |
1157 | mask_c.green = |
1158 | mask_c.green = |
1158 | mask_c.blue = 0; |
1159 | mask_c.blue = 0; |
|
|
1160 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
|
|
1161 | |
|
|
1162 | mask_c.alpha = 0; |
|
|
1163 | mask_c.red = 0xffff - c.r; |
|
|
1164 | mask_c.green = 0xffff - c.g; |
|
|
1165 | mask_c.blue = 0xffff - c.b; |
|
|
1166 | XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1); |
|
|
1167 | XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
|
|
1168 | |
|
|
1169 | if (shade > 100) |
|
|
1170 | { |
|
|
1171 | mask_c.red = mask_c.green = mask_c.blue = 0xffff * (shade - 100) / 100; |
|
|
1172 | mask_c.alpha = 0; |
1159 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1173 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1160 | |
1174 | |
1161 | mask_c.alpha = 0; |
|
|
1162 | mask_c.red = 0xffff - c.r; |
|
|
1163 | mask_c.green = 0xffff - c.g; |
|
|
1164 | mask_c.blue = 0xffff - c.b; |
|
|
1165 | XRenderFillRectangle (dpy, PictOpSrc, mask_pic, &mask_c, 0, 0, 1, 1); |
|
|
1166 | XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
|
|
1167 | |
|
|
1168 | if (shade > 100) |
|
|
1169 | { |
|
|
1170 | mask_c.red = mask_c.green = mask_c.blue = 0xffff * (shade - 100) / 100; |
|
|
1171 | mask_c.alpha = 0; |
|
|
1172 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
|
|
1173 | |
|
|
1174 | XRenderComposite (dpy, PictOpOver, overlay_pic, None, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1175 | XRenderComposite (dpy, PictOpOver, overlay_pic, None, back_pic, 0, 0, 0, 0, 0, 0, width, height); |
1175 | } |
1176 | } |
1176 | |
1177 | |
1177 | ret = true; |
1178 | ret = true; |
1178 | } |
|
|
1179 | |
1179 | |
1180 | XRenderFreePicture (dpy, mask_pic); |
1180 | XRenderFreePicture (dpy, mask_pic); |
1181 | XRenderFreePicture (dpy, overlay_pic); |
1181 | XRenderFreePicture (dpy, overlay_pic); |
1182 | XRenderFreePicture (dpy, back_pic); |
1182 | XRenderFreePicture (dpy, back_pic); |
1183 | # endif |
1183 | # endif |
… | |
… | |
1238 | if (root_pixmap != None && root_depth != depth) |
1238 | if (root_pixmap != None && root_depth != depth) |
1239 | { |
1239 | { |
1240 | #if XRENDER |
1240 | #if XRENDER |
1241 | if (bg_flags & BG_HAS_RENDER) |
1241 | if (bg_flags & BG_HAS_RENDER) |
1242 | { |
1242 | { |
|
|
1243 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
|
|
1244 | |
1243 | XRenderPictureAttributes pa; |
1245 | XRenderPictureAttributes pa; |
1244 | |
1246 | |
1245 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1247 | XRenderPictFormat *src_format = XRenderFindVisualFormat (dpy, DefaultVisual (dpy, screen)); |
1246 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, &pa); |
1248 | Picture src = XRenderCreatePicture (dpy, root_pixmap, src_format, 0, &pa); |
1247 | |
1249 | |
1248 | recoded_root_pmap = XCreatePixmap (dpy, vt, root_pmap_width, root_pmap_height, depth); |
|
|
1249 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
1250 | XRenderPictFormat *dst_format = XRenderFindVisualFormat (dpy, visual); |
1250 | Picture dst = XRenderCreatePicture (dpy, recoded_root_pmap, dst_format, 0, &pa); |
1251 | Picture dst = XRenderCreatePicture (dpy, recoded_root_pmap, dst_format, 0, &pa); |
1251 | |
1252 | |
1252 | if (src && dst) |
|
|
1253 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height); |
1253 | XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height); |
1254 | else |
|
|
1255 | { |
|
|
1256 | XFreePixmap (dpy, recoded_root_pmap); |
|
|
1257 | recoded_root_pmap = None; |
|
|
1258 | } |
|
|
1259 | |
1254 | |
1260 | XRenderFreePicture (dpy, src); |
1255 | XRenderFreePicture (dpy, src); |
1261 | XRenderFreePicture (dpy, dst); |
1256 | XRenderFreePicture (dpy, dst); |
1262 | } |
1257 | } |
1263 | else |
1258 | else |
… | |
… | |
1277 | bg_pixmap = XCreatePixmap (dpy, vt, window_width, window_height, depth); |
1272 | bg_pixmap = XCreatePixmap (dpy, vt, window_width, window_height, depth); |
1278 | bg_pmap_width = window_width; |
1273 | bg_pmap_width = window_width; |
1279 | bg_pmap_height = window_height; |
1274 | bg_pmap_height = window_height; |
1280 | } |
1275 | } |
1281 | |
1276 | |
1282 | if (bg_pixmap != None) |
|
|
1283 | { |
|
|
1284 | /* straightforward pixmap copy */ |
1277 | /* straightforward pixmap copy */ |
1285 | while (sx < 0) sx += (int)root_width; |
1278 | while (sx < 0) sx += root_width; |
1286 | while (sy < 0) sy += (int)root_height; |
1279 | while (sy < 0) sy += root_height; |
1287 | |
1280 | |
1288 | gcv.tile = recoded_root_pmap; |
1281 | gcv.tile = recoded_root_pmap; |
1289 | gcv.fill_style = FillTiled; |
1282 | gcv.fill_style = FillTiled; |
1290 | gcv.ts_x_origin = -sx; |
1283 | gcv.ts_x_origin = -sx; |
1291 | gcv.ts_y_origin = -sy; |
1284 | gcv.ts_y_origin = -sy; |
1292 | gc = XCreateGC (dpy, vt, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); |
1285 | gc = XCreateGC (dpy, vt, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); |
1293 | |
1286 | |
1294 | if (gc) |
1287 | if (gc) |
1295 | { |
1288 | { |
1296 | XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); |
1289 | XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); |
1297 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1290 | result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); |
1298 | XFreeGC (dpy, gc); |
1291 | XFreeGC (dpy, gc); |
1299 | |
1292 | |
1300 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1293 | if (!(bg_flags & BG_CLIENT_RENDER)) |
1301 | { |
1294 | { |
1302 | if ((bg_flags & BG_NEEDS_BLUR) |
1295 | if ((bg_flags & BG_NEEDS_BLUR) |
1303 | && (bg_flags & BG_HAS_RENDER_CONV)) |
1296 | && (bg_flags & BG_HAS_RENDER_CONV)) |
1304 | { |
1297 | { |
1305 | if (blur_pixmap (bg_pixmap, visual, window_width, window_height)) |
1298 | if (blur_pixmap (bg_pixmap, visual, window_width, window_height)) |
1306 | result &= ~BG_NEEDS_BLUR; |
1299 | result &= ~BG_NEEDS_BLUR; |
1307 | } |
1300 | } |
1308 | if ((bg_flags & BG_NEEDS_TINT) |
1301 | if ((bg_flags & BG_NEEDS_TINT) |
1309 | && (bg_flags & (BG_TINT_BITAND | BG_HAS_RENDER))) |
1302 | && (bg_flags & (BG_TINT_BITAND | BG_HAS_RENDER))) |
1310 | { |
1303 | { |
1311 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1304 | if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) |
1312 | result &= ~BG_NEEDS_TINT; |
1305 | result &= ~BG_NEEDS_TINT; |
1313 | } |
1306 | } |
1314 | } /* server side rendering completed */ |
1307 | } /* server side rendering completed */ |
1315 | } |
|
|
1316 | } |
1308 | } |
1317 | |
1309 | |
1318 | if (recoded_root_pmap != root_pixmap) |
1310 | if (recoded_root_pmap != root_pixmap) |
1319 | XFreePixmap (dpy, recoded_root_pmap); |
1311 | XFreePixmap (dpy, recoded_root_pmap); |
1320 | |
1312 | |
… | |
… | |
1449 | uint32_t mask_r, mask_g, mask_b; |
1441 | uint32_t mask_r, mask_g, mask_b; |
1450 | uint32_t *lookup, *lookup_r, *lookup_g, *lookup_b; |
1442 | uint32_t *lookup, *lookup_r, *lookup_g, *lookup_b; |
1451 | rgba low; |
1443 | rgba low; |
1452 | rgba high; |
1444 | rgba high; |
1453 | int i; |
1445 | int i; |
1454 | int host_byte_order = byteorder::big_endian () ? MSBFirst : LSBFirst; |
1446 | int host_byte_order = ecb_big_endian () ? MSBFirst : LSBFirst; |
1455 | |
1447 | |
1456 | if (visual->c_class != TrueColor || ximage->format != ZPixmap) return; |
1448 | if (visual->c_class != TrueColor || ximage->format != ZPixmap) return; |
1457 | |
1449 | |
1458 | /* for convenience */ |
1450 | /* for convenience */ |
1459 | mask_r = visual->red_mask; |
1451 | mask_r = visual->red_mask; |