mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
Relax detection of non-premultiplied alpha cursor data
The stricter detection broke the cursor in some 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. Relax the detection to match what's in the X server since 1.18.4, but keep the workaround for older versions. Bugzilla: https://bugs.freedesktop.org/108650 Acked-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
a9da219e13
commit
426f9a4965
@@ -1509,8 +1509,8 @@ drmmode_cursor_pixel(xf86CrtcPtr crtc, uint32_t *argb, Bool premultiplied,
|
||||
int i;
|
||||
|
||||
if (premultiplied) {
|
||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 20, 99, 0, 0)
|
||||
if (*argb > (alpha | alpha << 8 | alpha << 16 | alpha << 24))
|
||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 18, 4, 0, 0)
|
||||
if (alpha == 0 && (*argb & 0xffffff) != 0)
|
||||
/* Doesn't look like premultiplied alpha */
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user