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.202 by sf-exg, Sat Feb 25 22:20:47 2012 UTC vs.
Revision 1.203 by sf-exg, Tue Apr 10 15:08:47 2012 UTC

686} 686}
687 687
688void 688void
689rxvt_term::set_tint_shade_flags () 689rxvt_term::set_tint_shade_flags ()
690{ 690{
691 if (shade != 100 || (bg_flags & BG_TINT_SET))
692 bg_flags |= BG_NEEDS_TINT;
693 else
694 bg_flags &= ~BG_NEEDS_TINT;
695}
696
697bool
698rxvt_term::bg_set_tint (rxvt_color &new_tint)
699{
700 if (!(bg_flags & BG_TINT_SET) || tint != new_tint)
701 {
702 tint = new_tint;
703 bg_flags |= BG_TINT_SET;
704
691 rgba c; 705 rgba c;
692 bool has_shade = shade != 100;
693
694 bg_flags &= ~BG_TINT_FLAGS;
695
696 if (bg_flags & BG_TINT_SET)
697 {
698 tint.get (c); 706 tint.get (c);
699 if (!has_shade
700 && (c.r <= 0x00ff || c.r >= 0xff00) 707 if ((c.r <= 0x00ff || c.r >= 0xff00)
701 && (c.g <= 0x00ff || c.g >= 0xff00) 708 && (c.g <= 0x00ff || c.g >= 0xff00)
702 && (c.b <= 0x00ff || c.b >= 0xff00)) 709 && (c.b <= 0x00ff || c.b >= 0xff00))
703 bg_flags |= BG_TINT_BITAND; 710 bg_flags |= BG_TINT_BITAND;
704 } 711 else
705
706 if (has_shade || (bg_flags & BG_TINT_SET))
707 bg_flags |= BG_NEEDS_TINT;
708}
709
710bool
711rxvt_term::bg_set_tint (rxvt_color &new_tint)
712{
713 if (!(bg_flags & BG_TINT_SET) || tint != new_tint)
714 {
715 tint = new_tint;
716 bg_flags |= BG_TINT_SET; 712 bg_flags &= ~BG_TINT_BITAND;
713
717 set_tint_shade_flags (); 714 set_tint_shade_flags ();
718 return true; 715 return true;
719 } 716 }
720 717
721 return false; 718 return false;
831bool 828bool
832rxvt_term::tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height) 829rxvt_term::tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height)
833{ 830{
834 bool ret = false; 831 bool ret = false;
835 832
836 if (bg_flags & BG_TINT_BITAND) 833 if (shade == 100 && (bg_flags & BG_TINT_BITAND))
837 { 834 {
838 XGCValues gcv; 835 XGCValues gcv;
839 GC gc; 836 GC gc;
840 837
841 /* In this case we can tint image server-side getting significant 838 /* In this case we can tint image server-side getting significant

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines