Don't reload background contrast effect on screen resize

Summary:
Similar to the Blur patch. Arguably rven less reason as this doesn't
have a texture the size of the workspace.

We don't need to delete and recreate the entire effect every time the
screen changes; This deletes the wayland global which causes quite a bit
of extra work for the clients.

Test Plan:
Changed resolution under X, and scale under wayland
Panel looked the same and nothing exploded

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, plasma-devel, kwin, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7937
icc-effect-5.14.5
David Edmundson 2017-09-29 13:30:42 +01:00
parent bc88f84777
commit 55d219429a
1 changed files with 10 additions and 2 deletions

View File

@ -67,8 +67,9 @@ ContrastEffect::ContrastEffect()
);
// Fetch the contrast regions for all windows
foreach (EffectWindow *window, effects->stackingOrder())
for (EffectWindow *window: effects->stackingOrder()) {
updateContrastRegion(window);
}
}
ContrastEffect::~ContrastEffect()
@ -78,7 +79,14 @@ ContrastEffect::~ContrastEffect()
void ContrastEffect::slotScreenGeometryChanged()
{
effects->reloadEffect(this);
effects->makeOpenGLContextCurrent();
if (!supported()) {
effects->reloadEffect(this);
return;
}
for (EffectWindow *window: effects->stackingOrder()) {
updateContrastRegion(window);
}
}
void ContrastEffect::reconfigure(ReconfigureFlags flags)