[X2Go-Commits] [nx-libs] 23/53: Fix alpha premultiplication in XRenderParseColor.

git-admin at x2go.org git-admin at x2go.org
Tue Sep 22 15:10:41 CEST 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit ffc87da60b2262432d56f15332b3edd15b7e00b2
Author: Emanuele Giaquinta <emanuele.giaquinta at gmail.com>
Date:   Tue Jun 23 16:09:50 2015 +0200

    Fix alpha premultiplication in XRenderParseColor.
    
     Due to C arithmetic conversion rules we must use an unsigned constant (or a
     cast) to perform the multiplication using unsigned arithmetic.
    
     Fixes ArcticaProject/nx-libs#55.
    
     Author: Emanuele Giaquinta <emanuele.giaquinta at gmail.com>
     Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
     Rebased against NX: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
---
 nx-X11/lib/Xrender/Color.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nx-X11/lib/Xrender/Color.c b/nx-X11/lib/Xrender/Color.c
index 4f934f0..6875204 100644
--- a/nx-X11/lib/Xrender/Color.c
+++ b/nx-X11/lib/Xrender/Color.c
@@ -85,8 +85,8 @@ XRenderParseColor(Display *dpy, char *spec, XRenderColor *def)
 	def->blue = coreColor.blue;
 	def->alpha = 0xffff;
     }
-    def->red = (def->red * def->alpha) / 65535;
-    def->green = (def->green * def->alpha) / 65535;
-    def->blue = (def->blue * def->alpha) / 65535;
+    def->red = (def->red * def->alpha) / 0xffffU;
+    def->green = (def->green * def->alpha) / 0xffffU;
+    def->blue = (def->blue * def->alpha) / 0xffffU;
     return 1;
 }

--
Alioth's /srv/git/code.x2go.org/nx-libs.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list