Commit 5186f411 authored by Mathias Tillman's avatar Mathias Tillman Committed by Vlad Zahorodnii
Browse files

effects/blur: Fix window flickering when the clip intersected with the current blur region.

This fixes a bug introduced in !2045 where it would no longer check if it should redraw the whole region unless the data clip intersected. This would lead to flickering in certain cases

BUG: 421135


(cherry picked from commit 140c2fb2)
parent 4852474a
Pipeline #151551 passed with stage
in 14 minutes and 36 seconds
......@@ -509,10 +509,10 @@ void BlurEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, std::
return;
}
const QRegion oldClip = data.clip;
if (data.clip.intersects(m_currentBlur)) {
// to blur an area partially we have to shrink the opaque area of a window
QRegion newClip;
const QRegion oldClip = data.clip;
for (const QRect &rect : data.clip) {
newClip |= rect.adjusted(m_expandSize, m_expandSize, -m_expandSize, -m_expandSize);
}
......@@ -520,11 +520,12 @@ void BlurEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, std::
// we don't have to blur a region we don't see
m_currentBlur -= newClip;
// if we have to paint a non-opaque part of this window that intersects with the
// currently blurred region we have to redraw the whole region
if ((data.paint - oldClip).intersects(m_currentBlur)) {
data.paint |= m_currentBlur;
}
}
// if we have to paint a non-opaque part of this window that intersects with the
// currently blurred region we have to redraw the whole region
if ((data.paint - oldClip).intersects(m_currentBlur)) {
data.paint |= m_currentBlur;
}
// in case this window has regions to be blurred
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment