xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 7 17:09:50 UTC 2018


 dix/cursor.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 6ef025a8728282db6a233bde55789b114f916abb
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Tue Nov 6 11:33:19 2018 +0100

    Revert "dix: Work around non-premultiplied ARGB cursor data harder"
    
    This reverts commit b45c74f0f2868689e7ed695b33e8c60cd378df0b.
    
    It broke the cursor in other games. Apparently those use cursor data
    with premultiplied alpha, but with some pixels having r/g/b values
    larger than the alpha value (which corresponds to original r/g/b
    values > 1.0), triggering the workaround.
    
    Seems the cure turned out worse than the disease, so revert.
    
    Bugzilla: https://bugs.freedesktop.org/108650

diff --git a/dix/cursor.c b/dix/cursor.c
index 9a088f043..25d676779 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -293,13 +293,12 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits,
         size_t i, size = bits->width * bits->height;
 
         for (i = 0; i < size; i++) {
-            CARD32 a = argb[i] >> 24;
-
-            if (argb[i] > (a << 24 | a << 16 | a << 8 | a)) {
+            if ((argb[i] & 0xff000000) == 0 && (argb[i] & 0xffffff) != 0) {
                 /* ARGB data doesn't seem pre-multiplied, fix it */
                 for (i = 0; i < size; i++) {
-                    CARD32 ar, ag, ab;
+                    CARD32 a, ar, ag, ab;
 
+                    a = argb[i] >> 24;
                     ar = a * ((argb[i] >> 16) & 0xff) / 0xff;
                     ag = a * ((argb[i] >> 8) & 0xff) / 0xff;
                     ab = a * (argb[i] & 0xff) / 0xff;


More information about the xorg-commit mailing list