… | |
… | |
84 | } |
84 | } |
85 | # endif |
85 | # endif |
86 | # ifdef ENABLE_TRANSPARENCY |
86 | # ifdef ENABLE_TRANSPARENCY |
87 | if (flags & isTransparent) |
87 | if (flags & isTransparent) |
88 | return true; |
88 | return true; |
|
|
89 | # endif |
|
|
90 | return false; |
|
|
91 | } |
|
|
92 | |
|
|
93 | bool bgPixmap_t::need_client_side_rendering () |
|
|
94 | { |
|
|
95 | # ifdef HAVE_AFTERIMAGE |
|
|
96 | if (original_asim != NULL) |
|
|
97 | return true; |
|
|
98 | #endif |
|
|
99 | # ifdef ENABLE_TRANSPARENCY |
|
|
100 | if (flags & isTransparent) |
|
|
101 | { |
|
|
102 | if ((flags & blurNeeded) |
|
|
103 | || ((flags & tintNeeded) && !(flags & tintServerSide))) |
|
|
104 | return true; |
|
|
105 | } |
89 | # endif |
106 | # endif |
90 | return false; |
107 | return false; |
91 | } |
108 | } |
92 | |
109 | |
93 | # ifdef XPM_BACKGROUND |
110 | # ifdef XPM_BACKGROUND |
… | |
… | |
597 | if (v_blurRadius != vr) |
614 | if (v_blurRadius != vr) |
598 | { |
615 | { |
599 | ++changed; |
616 | ++changed; |
600 | v_blurRadius = vr; |
617 | v_blurRadius = vr; |
601 | } |
618 | } |
|
|
619 | if (v_blurRadius == 0 && h_blurRadius == 0) |
|
|
620 | flags &= ~blurNeeded; |
|
|
621 | else |
|
|
622 | flags |= blurNeeded; |
602 | return (changed>0); |
623 | return (changed>0); |
603 | } |
624 | } |
604 | |
625 | |
605 | static inline unsigned long |
626 | static inline unsigned long |
606 | compute_tint_shade_flags (rxvt_color *tint, int shade) |
627 | compute_tint_shade_flags (rxvt_color *tint, int shade) |
… | |
… | |
899 | as_shade.tintColor.green = c.g; |
920 | as_shade.tintColor.green = c.g; |
900 | as_shade.tintColor.blue = c.b; |
921 | as_shade.tintColor.blue = c.b; |
901 | |
922 | |
902 | as_tint = shading2tint32 (&as_shade); |
923 | as_tint = shading2tint32 (&as_shade); |
903 | } |
924 | } |
|
|
925 | |
|
|
926 | if (!(background_flags & transpPmapBlured) && (flags & blurNeeded) && background != NULL) |
|
|
927 | { |
|
|
928 | ASImage* tmp = blur_asimage_gauss (target->asv, background, h_blurRadius, v_blurRadius, 0xFFFFFFFF, |
|
|
929 | (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage, |
|
|
930 | 100, ASIMAGE_QUALITY_DEFAULT); |
|
|
931 | if (tmp) |
|
|
932 | { |
|
|
933 | destroy_asimage (&background); |
|
|
934 | background = tmp; |
|
|
935 | } |
|
|
936 | } |
|
|
937 | |
904 | if (render_asim (background, as_tint)) |
938 | if (render_asim (background, as_tint)) |
905 | flags = flags & ~isInvalid; |
939 | flags = flags & ~isInvalid; |
906 | if (background) |
940 | if (background) |
907 | destroy_asimage (&background); |
941 | destroy_asimage (&background); |
908 | } |
942 | } |
… | |
… | |
1043 | void |
1077 | void |
1044 | rxvt_term::get_window_origin (int &x, int &y) |
1078 | rxvt_term::get_window_origin (int &x, int &y) |
1045 | { |
1079 | { |
1046 | Window cr; |
1080 | Window cr; |
1047 | XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr); |
1081 | XTranslateCoordinates (dpy, parent[0], display->root, 0, 0, &x, &y, &cr); |
|
|
1082 | /* fprintf( stderr, "origin is %+d%+d\n", x, y);*/ |
1048 | } |
1083 | } |
1049 | |
1084 | |
1050 | Pixmap |
1085 | Pixmap |
1051 | rxvt_term::get_pixmap_property (int prop_id) |
1086 | rxvt_term::get_pixmap_property (int prop_id) |
1052 | { |
1087 | { |
… | |
… | |
1308 | /* |
1343 | /* |
1309 | * Check our parents are still who we think they are. |
1344 | * Check our parents are still who we think they are. |
1310 | * Do transparency updates if required |
1345 | * Do transparency updates if required |
1311 | */ |
1346 | */ |
1312 | int |
1347 | int |
1313 | rxvt_term::check_our_parents () |
1348 | rxvt_term::update_background () |
1314 | { |
1349 | { |
1315 | check_our_parents_ev.stop (); |
1350 | bgPixmap.invalidate(); |
1316 | check_our_parents_ev.start (NOW + .1); |
1351 | /* no chance of real time refresh if we are blurring ! */ |
|
|
1352 | if (bgPixmap.invalid_since + 0.5 < NOW && !(bgPixmap.flags & bgPixmap_t::blurNeeded)) |
|
|
1353 | bgPixmap.render(); |
|
|
1354 | else |
|
|
1355 | { |
|
|
1356 | update_background_ev.stop (); |
|
|
1357 | if (!bgPixmap.need_client_side_rendering()) |
|
|
1358 | update_background_ev.start (NOW + .05); |
|
|
1359 | else if (bgPixmap.flags & bgPixmap_t::blurNeeded) |
|
|
1360 | update_background_ev.start (NOW + .2); /* very slow !!! */ |
|
|
1361 | else |
|
|
1362 | update_background_ev.start (NOW + .07); |
|
|
1363 | } |
1317 | return 0; |
1364 | return 0; |
1318 | } |
1365 | } |
1319 | |
1366 | |
|
|
1367 | void |
|
|
1368 | rxvt_term::update_background_cb (time_watcher &w) |
|
|
1369 | { |
|
|
1370 | bgPixmap.render (); |
|
|
1371 | } |
|
|
1372 | #endif /* HAVE_BG_PIXMAP */ |
|
|
1373 | |
|
|
1374 | |
|
|
1375 | #if 0 /* replaced by a bgPixmap_t::render() - leve here temporarily for reference */ |
1320 | void |
1376 | void |
1321 | rxvt_term::check_our_parents_cb (time_watcher &w) |
1377 | rxvt_term::check_our_parents_cb (time_watcher &w) |
1322 | { |
1378 | { |
1323 | #if 0 /* replaced by a bgPixmap_t::render() - leve here temporarily for reference */ |
|
|
1324 | |
1379 | |
1325 | int i, aformat, rootdepth; |
1380 | int i, aformat, rootdepth; |
1326 | unsigned long nitems, bytes_after; |
1381 | unsigned long nitems, bytes_after; |
1327 | Atom atype; |
1382 | Atom atype; |
1328 | unsigned char *prop = NULL; |
1383 | unsigned char *prop = NULL; |
… | |
… | |
1526 | want_refresh = want_full_refresh = 1; |
1581 | want_refresh = want_full_refresh = 1; |
1527 | if (am_pixmap_trans) |
1582 | if (am_pixmap_trans) |
1528 | flush (); |
1583 | flush (); |
1529 | } |
1584 | } |
1530 | } |
1585 | } |
|
|
1586 | } |
1531 | #endif |
1587 | #endif |
1532 | } |
|
|
1533 | #endif |
|
|