<table><tr><td style="">anemeth added inline comments.<br />Restricted Application edited projects, added Plasma; removed KWin.
</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/D9848" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D9848#inline-45214" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">fredrik</span> wrote in <span style="color: #4b4d51; font-weight: bold;">blur.cpp:145</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">Why is this needed?</p>

<p style="padding: 0; margin: 8px;">I'm probably missing something here, but it looks to me as if the effect copies the contents of the framebuffer to the helper texture, then copies the contents of that texture to m_renderTextures[0], after which the contents of helper texture is not used again. Can't copyScreenSampleTexture() copy directly from the framebuffer to m_renderTextures[0]?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">This texture is only used by <tt style="background: #ebebeb; font-size: 13px;">copyScreenSampleTexture()</tt><br />
It could very well be a separate variable, but I just appended another texture to the textures vector and used that instead.<br />
The reason for first rendering into m_renderTextures.last() and then copying that to m_renderTextures[0] is to eliminate what I call "extended blur".<br />
Extended blur is when windows or other elements that are not under the blurred area affect the blur effect. This sounds great in theory, and this is how the old blur method worked as well, but it becomes a big issue when the blur radius gets big. For example when you maximize a white window, the completely transparent taskbar also becomes almost completely white because of this effect, so the way I achieve this is by creating a GL_CLAMP_TO_EDGE effect.<br />
<a href="https://phabricator.kde.org/F5656755" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F5656755: c3_clamping.png</a><br />
For example if we want to blur a window (red) we have to blur a bigger area. To avoid extended blur I use the copySample shader to create a GL_CLAMP_TO_EDGE effect (blue) when copying the texture from m_renderTextures.last() to m_renderTextures[0]</p>

<p style="padding: 0; margin: 8px;">Ideally we could specify to only disable extended blur on the taskbar, but I don't see a way to identify a window as the taskbar.</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9848" rel="noreferrer">https://phabricator.kde.org/D9848</a></div></div><br /><div><strong>To: </strong>anemeth, Plasma, KWin<br /><strong>Cc: </strong>luebking, broulik, romangg, zzag, anthonyfieroni, mart, davidedmundson, fredrik, ngraham, plasma-devel, kwin, KWin, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol<br /></div>