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.57 by root, Mon Feb 20 22:42:01 2006 UTC vs.
Revision 1.58 by root, Wed Jul 5 19:22:15 2006 UTC

649 649
650template class refcache<rxvt_display>; 650template class refcache<rxvt_display>;
651refcache<rxvt_display> displays; 651refcache<rxvt_display> displays;
652 652
653///////////////////////////////////////////////////////////////////////////// 653/////////////////////////////////////////////////////////////////////////////
654//
655
656static unsigned int
657insert_component (unsigned int value, unsigned int mask, unsigned int shift)
658{
659 return (value * (mask + 1) >> 16) << shift;
660}
654 661
655bool 662bool
656rxvt_color::alloc (rxvt_screen *screen, const rgba &color) 663rxvt_color::alloc (rxvt_screen *screen, const rgba &color)
657{ 664{
658#if XFT 665#if XFT
668 c.color.red = color.r; 675 c.color.red = color.r;
669 c.color.green = color.g; 676 c.color.green = color.g;
670 c.color.blue = color.b; 677 c.color.blue = color.b;
671 c.color.alpha = color.a; 678 c.color.alpha = color.a;
672 679
673 c.pixel = ((color.r * format->direct.redMask / rgba::MAX_CC) << format->direct.red ) 680 c.pixel = insert_component (color.r, format->direct.redMask , format->direct.red )
674 | ((color.g * format->direct.greenMask / rgba::MAX_CC) << format->direct.green) 681 | insert_component (color.g, format->direct.greenMask, format->direct.green)
675 | ((color.b * format->direct.blueMask / rgba::MAX_CC) << format->direct.blue ) 682 | insert_component (color.b, format->direct.blueMask , format->direct.blue )
676 | ((color.a * format->direct.alphaMask / rgba::MAX_CC) << format->direct.alpha); 683 | insert_component (color.a, format->direct.alphaMask, format->direct.alpha);
677 684
678 return true; 685 return true;
679 } 686 }
680 else 687 else
681 { 688 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines