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

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.72 by ayin, Mon Aug 27 18:31:00 2007 UTC vs.
Revision 1.73 by ayin, Wed Oct 31 09:55:24 2007 UTC

666static unsigned int 666static unsigned int
667insert_component (unsigned int value, unsigned int mask, unsigned int shift) 667insert_component (unsigned int value, unsigned int mask, unsigned int shift)
668{ 668{
669 return (value * (mask + 1) >> 16) << shift; 669 return (value * (mask + 1) >> 16) << shift;
670} 670}
671 671
672bool 672bool
673rxvt_color::alloc (rxvt_screen *screen, const rgba &color) 673rxvt_color::alloc (rxvt_screen *screen, const rgba &color)
674{ 674{
675#if XFT 675#if XFT
676 XRenderPictFormat *format; 676 XRenderPictFormat *format;
795 { 795 {
796 XColor *colors = new XColor [screen->visual->map_entries]; 796 XColor *colors = new XColor [screen->visual->map_entries];
797 797
798 for (int i = 0; i < cmap_size; i++) 798 for (int i = 0; i < cmap_size; i++)
799 colors [i].pixel = i; 799 colors [i].pixel = i;
800 800
801 // many kilobytes transfer per colour, but pseudocolor isn't worth 801 // many kilobytes transfer per colour, but pseudocolor isn't worth
802 // many extra optimisations. 802 // many extra optimisations.
803 XQueryColors (screen->dpy, screen->cmap, colors, cmap_size); 803 XQueryColors (screen->dpy, screen->cmap, colors, cmap_size);
804 804
805 int diff = 0x7fffffffUL; 805 int diff = 0x7fffffffUL;
818 } 818 }
819 } 819 }
820 820
821 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", 821 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n",
822 // color.r, color.g, color.b, best->red, best->green, best->blue, diff); 822 // color.r, color.g, color.b, best->red, best->green, best->blue, diff);
823 823
824 got = alloc (screen, rgba (best->red, best->green, best->blue)); 824 got = alloc (screen, rgba (best->red, best->green, best->blue));
825 825
826 delete [] colors; 826 delete [] colors;
827 } 827 }
828#endif 828#endif
856 color.green = c.g; 856 color.green = c.g;
857 color.blue = c.b; 857 color.blue = c.b;
858 color.pixel = (Pixel)*this; 858 color.pixel = (Pixel)*this;
859} 859}
860 860
861void 861void
862rxvt_color::free (rxvt_screen *screen) 862rxvt_color::free (rxvt_screen *screen)
863{ 863{
864 if (screen->visual->c_class == TrueColor) 864 if (screen->visual->c_class == TrueColor)
865 return; // nothing to do 865 return; // nothing to do
866 866

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines