<table><tr><td style="">davidedmundson created this revision.<br />davidedmundson added a reviewer: KWin.<br />Herald added a project: KWin.<br />Herald added a subscriber: kwin.<br />davidedmundson requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D25737">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>We currently see a gap on transformed windows between the window and the<br />
top decoration.</p>
<p>This is partly the atlas bleed on the decoration, and partly a bleed on<br />
the window content itself.</p>
<p>On X11, the window we composite is the frame window - which is a larger<br />
texture containing a transparent border where the frame normally would<br />
be. When we sample with a linear filter we include these texels. Hence<br />
GL_CLAMP_TO_EDGE doesn't work.</p>
<p>Vlad's patch to composite the correct window, not the frame was my<br />
preferred approach, but we had to revert it as it caused an issue with<br />
xwayland :(</p>
<p>Half pixel correction nearly worked, but caused blurry fonts.</p>
<p>This patch resolves it in the fragment shader used by effects doing<br />
transforms. We pass the real texture geometry of the window to the<br />
client with a half pixel correction. Any samples outside the outer half<br />
pixel are then clamped within bounds.</p>
<p>Arguably a hack, but solves the problem in a comparatively<br />
non-invasive way.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Using Vlad's atlas padding for decoration<br />
Slowed animations, wobbled a dark window over a light background<br />
No artifacts</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D25737">https://phabricator.kde.org/D25737</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>libkwineffects/kwinglutils.cpp<br />
libkwineffects/kwinglutils.h<br />
plugins/scenes/opengl/scene_opengl.cpp</div></div></div><br /><div><strong>To: </strong>davidedmundson, KWin<br /><strong>Cc: </strong>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<br /></div>