Commit 6ef025a8 authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer

Revert "dix: Work around non-premultiplied ARGB cursor data harder"

This reverts commit b45c74f0.

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
parent c901adc3
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment