D25737: Avoid texture bleed rendering X11 window - New version

David Edmundson noreply at phabricator.kde.org
Wed Dec 4 13:23:23 GMT 2019


davidedmundson created this revision.
davidedmundson added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
davidedmundson requested review of this revision.

REVISION 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.

TEST PLAN
  Using Vlad's atlas padding for decoration
  Slowed animations, wobbled a dark window over a light background
  No artifacts

REPOSITORY
  R108 KWin

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D25737

AFFECTED FILES
  libkwineffects/kwinglutils.cpp
  libkwineffects/kwinglutils.h
  plugins/scenes/opengl/scene_opengl.cpp

To: davidedmundson, #kwin
Cc: kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20191204/e77646b7/attachment.html>


More information about the kwin mailing list