… | |
… | |
26 | #include "../config.h" /* NECESSARY */ |
26 | #include "../config.h" /* NECESSARY */ |
27 | #include "rxvt.h" /* NECESSARY */ |
27 | #include "rxvt.h" /* NECESSARY */ |
28 | |
28 | |
29 | #if XRENDER |
29 | #if XRENDER |
30 | # include <X11/extensions/Xrender.h> |
30 | # include <X11/extensions/Xrender.h> |
|
|
31 | #endif |
|
|
32 | |
|
|
33 | #ifndef FilterConvolution |
|
|
34 | #define FilterConvolution "convolution" |
31 | #endif |
35 | #endif |
32 | |
36 | |
33 | #define DO_TIMING_TEST 0 |
37 | #define DO_TIMING_TEST 0 |
34 | |
38 | |
35 | #if DO_TIMING_TEST |
39 | #if DO_TIMING_TEST |
… | |
… | |
172 | return true; |
176 | return true; |
173 | } |
177 | } |
174 | # endif |
178 | # endif |
175 | |
179 | |
176 | return false; |
180 | return false; |
177 | }; |
181 | } |
178 | |
182 | |
179 | bool bgPixmap_t::need_client_side_rendering () |
183 | bool bgPixmap_t::need_client_side_rendering () |
180 | { |
184 | { |
181 | # ifdef HAVE_AFTERIMAGE |
185 | # ifdef HAVE_AFTERIMAGE |
182 | if (original_asim) |
186 | if (original_asim) |
… | |
… | |
666 | if (result) |
670 | if (result) |
667 | { |
671 | { |
668 | XGCValues gcv; |
672 | XGCValues gcv; |
669 | GC gc; |
673 | GC gc; |
670 | |
674 | |
671 | if (pixmap) |
|
|
672 | { |
|
|
673 | if (pmap_width != new_pmap_width |
|
|
674 | || pmap_height != new_pmap_height |
|
|
675 | || pmap_depth != target->depth) |
|
|
676 | { |
|
|
677 | XFreePixmap (target->dpy, pixmap); |
|
|
678 | pixmap = None; |
|
|
679 | } |
|
|
680 | } |
|
|
681 | |
|
|
682 | /* create Pixmap */ |
675 | /* create Pixmap */ |
683 | if (pixmap == None) |
676 | if (pixmap == None |
|
|
677 | || pmap_width != new_pmap_width |
|
|
678 | || pmap_height != new_pmap_height |
|
|
679 | || pmap_depth != target->depth) |
684 | { |
680 | { |
|
|
681 | if (pixmap) |
|
|
682 | XFreePixmap (target->dpy, pixmap); |
685 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
683 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
686 | pmap_width = new_pmap_width; |
684 | pmap_width = new_pmap_width; |
687 | pmap_height = new_pmap_height; |
685 | pmap_height = new_pmap_height; |
688 | pmap_depth = target->depth; |
686 | pmap_depth = target->depth; |
689 | } |
687 | } |
… | |
… | |
797 | new_pmap_width = min (image_width, target_width); |
795 | new_pmap_width = min (image_width, target_width); |
798 | new_pmap_height = min (image_height, target_height); |
796 | new_pmap_height = min (image_height, target_height); |
799 | } |
797 | } |
800 | } |
798 | } |
801 | |
799 | |
802 | if (pixmap) |
|
|
803 | { |
|
|
804 | if (pmap_width != new_pmap_width |
|
|
805 | || pmap_height != new_pmap_height |
|
|
806 | || pmap_depth != target->depth) |
|
|
807 | { |
|
|
808 | XFreePixmap (target->dpy, pixmap); |
|
|
809 | pixmap = None; |
|
|
810 | } |
|
|
811 | } |
|
|
812 | |
|
|
813 | if (pixmap == None) |
800 | if (pixmap == None |
|
|
801 | || pmap_width != new_pmap_width |
|
|
802 | || pmap_height != new_pmap_height |
|
|
803 | || pmap_depth != target->depth) |
814 | { |
804 | { |
|
|
805 | if (pixmap) |
|
|
806 | XFreePixmap (target->dpy, pixmap); |
815 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
807 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
816 | pmap_width = new_pmap_width; |
808 | pmap_width = new_pmap_width; |
817 | pmap_height = new_pmap_height; |
809 | pmap_height = new_pmap_height; |
818 | pmap_depth = target->depth; |
810 | pmap_depth = target->depth; |
819 | } |
811 | } |
… | |
… | |
1239 | |
1231 | |
1240 | if (mask_pic && overlay_pic && back_pic) |
1232 | if (mask_pic && overlay_pic && back_pic) |
1241 | { |
1233 | { |
1242 | XRenderColor mask_c; |
1234 | XRenderColor mask_c; |
1243 | |
1235 | |
1244 | memset (&mask_c, (shade > 100) ? 0xFF : 0x0, sizeof (mask_c)); |
1236 | mask_c.red = mask_c.green = mask_c.blue = shade > 100 ? 0xffff : 0; |
1245 | mask_c.alpha = 0xffff; |
1237 | mask_c.alpha = 0xffff; |
1246 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1238 | XRenderFillRectangle (dpy, PictOpSrc, overlay_pic, &mask_c, 0, 0, 1, 1); |
1247 | |
1239 | |
1248 | mask_c.alpha = 0; |
1240 | mask_c.alpha = 0; |
1249 | mask_c.red = 0xffff - c.r; |
1241 | mask_c.red = 0xffff - c.r; |
… | |
… | |
1367 | if (gc) |
1359 | if (gc) |
1368 | { |
1360 | { |
1369 | XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); |
1361 | XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); |
1370 | result |= transpPmapTiled; |
1362 | result |= transpPmapTiled; |
1371 | XFreeGC (dpy, gc); |
1363 | XFreeGC (dpy, gc); |
1372 | } |
|
|
1373 | |
1364 | |
1374 | if (tiled_root_pmap != None) |
|
|
1375 | { |
|
|
1376 | if (!need_client_side_rendering ()) |
1365 | if (!need_client_side_rendering ()) |
1377 | { |
1366 | { |
1378 | if ((flags & blurNeeded) |
1367 | if ((flags & blurNeeded) |
1379 | && (flags & HAS_RENDER_CONV)) |
1368 | && (flags & HAS_RENDER_CONV)) |
1380 | { |
1369 | { |
… | |
… | |
1395 | pixmap = tiled_root_pmap; |
1384 | pixmap = tiled_root_pmap; |
1396 | pmap_width = window_width; |
1385 | pmap_width = window_width; |
1397 | pmap_height = window_height; |
1386 | pmap_height = window_height; |
1398 | pmap_depth = target->depth; |
1387 | pmap_depth = target->depth; |
1399 | } |
1388 | } |
|
|
1389 | else |
|
|
1390 | XFreePixmap (dpy, tiled_root_pmap); |
1400 | |
1391 | |
1401 | if (recoded_root_pmap != root_pixmap) |
1392 | if (recoded_root_pmap != root_pixmap) |
1402 | XFreePixmap (dpy, recoded_root_pmap); |
1393 | XFreePixmap (dpy, recoded_root_pmap); |
1403 | |
1394 | |
1404 | return result; |
1395 | return result; |