repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 5e9317f46b2af115287ba3d9314ee5e84be1c24c:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 5e9317f46b2af115287ba3d9314ee5e84be1c24c
Author: Marc Lehmann 
Date:   Wed May 11 18:41:33 2011 +0000

    *** empty log message ***

diff --git a/Changes b/Changes
index 37e8250c5f1be45e178ccc49c870c1e6cf8a4af1..
index ..885ce01efa8ad676440021b09d9b62d7bd1705ad 100644
--- a/Changes
+++ b/Changes
@@ -20,10 +20,13 @@ TODO: decrqm http://ue.tst.eu/71d7dbd1fcfeaa7d2a4b96eb957d570c.txt
 TODO: perl-shell-window? perl-unix-socket?
 TODO: command line editing when icanon?

+        - fix rendering of double width chars in certain circumstances, more
+          likely to happen if urxvt is compiled with 256 colors support as
+          urxvt runs out of fonts much earlier then.  Fixes gentoo bug #358151
+          (Emanuele Giaquinta).
         - restore support for 'list' syntax in keysym resources (requested by Sung Pae).
-        - fix rendering of double width chars in certain circumstances,
-          more likely to happen if urxvt is compiled with 256 colors
-          support. Fixes gentoo bug #358151 (Emanuele Giaquinta).
+	- always premultiply colour values - while this increases differences between
+          core fonts and xft, it is "more correct" in practical situations.

 9.11 Mon May  2 10:34:46 CEST 2011
         - fix compilation on GNU/Hurd, debian bug #624736.
diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C
index f3bb67ca73f92a9c6d4a20c2f0dfae59c1df270d..
index ..dff3a1e41c95f14a22706445805c40dabd5b1d0d 100644
--- a/src/rxvttoolkit.C
+++ b/src/rxvttoolkit.C
@@ -705,13 +705,11 @@ rxvt_color::alloc (rxvt_screen *screen, const rgba &color)
       c.color.blue  = color.b;
       c.color.alpha = alpha;

-      // ARGB visuals use premultiplied alpha
-      if (format->direct.alphaMask)
-        {
-          c.color.red   = c.color.red   * alpha / 0xffff;
-          c.color.green = c.color.green * alpha / 0xffff;
-          c.color.blue  = c.color.blue  * alpha / 0xffff;
-        }
+      // Xft wants premultiplied alpha, but abuses the alpha channel
+      // as blend factor, and doesn't allow us to set the alpha channel
+      c.color.red   = c.color.red   * alpha / 0xffff;
+      c.color.green = c.color.green * alpha / 0xffff;
+      c.color.blue  = c.color.blue  * alpha / 0xffff;

       c.pixel = insert_component (c.color.red  , format->direct.redMask  , format->direct.red  )
               | insert_component (c.color.green, format->direct.greenMask, format->direct.green)

-----END OF PAGE-----