summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-11-06 11:33:19 +0100
committerMichel Dänzer <michel@daenzer.net>2018-11-06 11:33:19 +0100
commit6ef025a8728282db6a233bde55789b114f916abb (patch)
tree2cffa20c62f5faad080b2f74a065c1aead6e2c95
parentc901adc327bce4c0d19caf350cbcb0cd5254f306 (diff)
downloadxserver-6ef025a8728282db6a233bde55789b114f916abb.tar.gz
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
-rw-r--r--dix/cursor.c7
1 files changed, 3 insertions, 4 deletions
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;