kwin/decorations
Vlad Zahorodnii af71763be5 [scene] Fix decoration texture bleeding
Summary:
Quite long time ago, window decorations were painted on real X11 windows.
The nicest thing about that approach is that we get both contents of the
client and the frame window at the same time. However, somewhere around
KDE 4.2 - 4.3 times, decoration rendering architecture had been changed
to what we have now.

I've mentioned the previous decoration rendering design because it didn't
have a problem that the new design has, namely the texture bleeding issue.

In the name of better performance, opengl scene puts all decoration parts
to an atlas. This is totally reasonable, however we must be super cautious
about things such as the GL_LINEAR filter.

The GL_LINEAR filter may need to sample a couple of neighboring texels
in order to produce the final texel value. However, since all decoration
parts now live in a single texture, we have to make sure that we don't
sample texels that belong to another decoration part.

This patch fixes the texture bleeding problem by padding each individual
decoration part in the atlas. There is another solution for this problem
though. We could render a window into an offscreen texture and then map
that texture on the transformed window geometry. This would work well and
we definitely need an offscreen rendering path in the opengl scene,
however it's not feasible at the moment since we need to break the window
quads API. Also, it would be great to have as less as possible stuff going
on between invocation of Scene::Window::performPaint() and getting the
corresponding pixel data on the screen.

There is a good chance that the new padding stuff may make you vomit. If
it does so, I'm all ears for the suggestions how to make the code more
nicer.

BUG: 257566
BUG: 360549
CCBUG: 412573
FIXED-IN: 5.18.0

Reviewers: #kwin

Subscribers: fredrik, kwin, fvogt

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25611
2020-01-09 15:13:07 +02:00
..
decoratedclient.cpp Resurrect show tooltips option 2019-03-05 00:38:55 +02:00
decoratedclient.h Run clang-tidy with modernize-use-override check 2019-07-22 20:03:22 +03:00
decorationbridge.cpp [decorations] Let KDecoration plugins recommend a border size per default 2019-06-06 22:24:45 +02:00
decorationbridge.h Run clang-tidy with modernize-use-override check 2019-07-22 20:03:22 +03:00
decorationpalette.cpp Merge branch 'Plasma/5.16' 2019-07-10 11:05:50 +02:00
decorationpalette.h Adapt to KDecoration API changes 2015-03-31 15:26:55 +02:00
decorationrenderer.cpp [scene] Fix decoration texture bleeding 2020-01-09 15:13:07 +02:00
decorationrenderer.h [scene] Fix decoration texture bleeding 2020-01-09 15:13:07 +02:00
decorations_logging.cpp pedantic fixes 2016-07-16 13:14:44 -04:00
decorations_logging.h [decorations] Introduce logging category for decorations 2015-07-31 13:13:46 +02:00
settings.cpp [decorations] Let KDecoration plugins recommend a border size per default 2019-06-06 22:24:45 +02:00
settings.h Run clang-tidy with modernize-use-override check 2019-07-22 20:03:22 +03:00