kwin/plugins
David Edmundson d1cfcf4c97 Avoid texture bleed rendering X11 window
Summary:
We currently see a gap on transformed windows between the window and the
top decoration.

This is partly the atlas bleed on the decoration, and partly a bleed on
the window content itself.

On X11, the window we composite is the frame window - which is a larger
texture containing a transparent border where the frame normally would
be. When we sample with a linear filter we include these texels. Hence
GL_CLAMP_TO_EDGE doesn't work.

Vlad's patch to composite the correct window, not the frame was my
preferred approach, but we had to revert it as it caused an issue with
xwayland :(

Half pixel correction nearly worked, but caused blurry fonts.

This patch resolves it in the fragment shader used by effects doing
transforms. We pass the real texture geometry of the window to the
client with a half pixel correction. Any samples outside the outer half
pixel are then clamped within bounds.

Arguably a hack, but solves the problem in a comparatively
non-invasive way.

BUG: 360549
BUG: 257566

Test Plan:
X11:
Using Vlad's atlas padding for decoration
Slowed animations, wobbled a dark window over a light background
No artifacts

Wayland:
This isn't needed. Now tested that everything still renders the same.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, jgrulich, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25737
2020-01-09 13:03:48 +00:00
..
idletime Use nullptr everywhere 2019-09-19 17:48:21 +03:00
kdecorations Remove deprecated method 2019-12-23 14:09:02 +01:00
kglobalaccel Use nullptr everywhere 2019-09-19 17:48:21 +03:00
kpackage SVN_SILENT made messages (.desktop file) - always resolve ours 2020-01-04 06:12:32 +01:00
platforms [platforms/drm] Allow running without outputs 2020-01-08 10:12:39 +01:00
qpa Don't use MESA_EGL_NO_X11_HEADERS 2019-10-24 18:57:30 +03:00
scenes Avoid texture bleed rendering X11 window 2020-01-09 13:03:48 +00:00
windowsystem fix compilation with no-deprecated build of kwindowsystem 2019-11-24 22:43:54 +01:00
CMakeLists.txt Cleanup style in CMakeLists.txt files 2019-09-17 16:03:05 +03:00