ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
(Generate patch)

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.211 by sf-exg, Sun May 13 15:28:44 2012 UTC vs.
Revision 1.212 by sf-exg, Sun May 13 15:50:18 2012 UTC

690 { 690 {
691 changed = true; 691 changed = true;
692 v_blurRadius = vr; 692 v_blurRadius = vr;
693 } 693 }
694 694
695 if (h_blurRadius && v_blurRadius)
696 bg_flags |= BG_NEEDS_BLUR;
697 else
698 bg_flags &= ~BG_NEEDS_BLUR;
699
700 return changed; 695 return changed;
701}
702
703void
704rxvt_term::set_tint_shade_flags ()
705{
706 if (shade != 100 || (bg_flags & BG_TINT_SET))
707 bg_flags |= BG_NEEDS_TINT;
708 else
709 bg_flags &= ~BG_NEEDS_TINT;
710} 696}
711 697
712bool 698bool
713rxvt_term::bg_set_tint (rxvt_color &new_tint) 699rxvt_term::bg_set_tint (rxvt_color &new_tint)
714{ 700{
724 && (c.b <= 0x00ff || c.b >= 0xff00)) 710 && (c.b <= 0x00ff || c.b >= 0xff00))
725 bg_flags |= BG_TINT_BITAND; 711 bg_flags |= BG_TINT_BITAND;
726 else 712 else
727 bg_flags &= ~BG_TINT_BITAND; 713 bg_flags &= ~BG_TINT_BITAND;
728 714
729 set_tint_shade_flags ();
730 return true; 715 return true;
731 } 716 }
732 717
733 return false; 718 return false;
734} 719}
743 new_shade = 200 - (100 + new_shade); 728 new_shade = 200 - (100 + new_shade);
744 729
745 if (new_shade != shade) 730 if (new_shade != shade)
746 { 731 {
747 shade = new_shade; 732 shade = new_shade;
748 set_tint_shade_flags ();
749 return true; 733 return true;
750 } 734 }
751 735
752 return false; 736 return false;
753} 737}
1029 1013
1030 if (gc) 1014 if (gc)
1031 { 1015 {
1032 XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); 1016 XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height);
1033 ret = true; 1017 ret = true;
1034 unsigned long tr_flags = bg_flags & BG_EFFECTS_FLAGS; 1018 bool need_blur = h_blurRadius && v_blurRadius;
1019 bool need_tint = shade != 100 || (bg_flags & BG_TINT_SET);
1035 1020
1036 if (!(bg_flags & BG_CLIENT_RENDER)) 1021 if (!(bg_flags & BG_CLIENT_RENDER))
1037 { 1022 {
1038 if (bg_flags & BG_NEEDS_BLUR) 1023 if (need_blur)
1039 { 1024 {
1040 if (blur_pixmap (bg_pixmap, visual, window_width, window_height, depth)) 1025 if (blur_pixmap (bg_pixmap, visual, window_width, window_height, depth))
1041 tr_flags &= ~BG_NEEDS_BLUR; 1026 need_blur = false;
1042 } 1027 }
1043 if (bg_flags & BG_NEEDS_TINT) 1028 if (need_tint)
1044 { 1029 {
1045 if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) 1030 if (tint_pixmap (bg_pixmap, visual, window_width, window_height))
1046 tr_flags &= ~BG_NEEDS_TINT; 1031 need_tint = false;
1047 } 1032 }
1048 if (tr_flags & BG_NEEDS_TINT) 1033 if (need_tint)
1049 { 1034 {
1050 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);
1051 if (ximage) 1036 if (ximage)
1052 { 1037 {
1053 /* our own client-side tinting */ 1038 /* our own client-side tinting */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines