scene: Schedule a repaint only if the output is affected by workspace repaint

If an output is not affected by a workspace repaint, then we don't have
to schedule a repaint on that output. This improves the overall performance.
This commit is contained in:
Vlad Zahorodnii 2020-11-28 22:01:45 +02:00
parent ee3515680a
commit 4a879379b3

View file

@ -66,6 +66,7 @@
#include "deleted.h" #include "deleted.h"
#include "effects.h" #include "effects.h"
#include "overlaywindow.h" #include "overlaywindow.h"
#include "renderloop.h"
#include "screens.h" #include "screens.h"
#include "shadow.h" #include "shadow.h"
#include "subsurfacemonitor.h" #include "subsurfacemonitor.h"
@ -109,13 +110,13 @@ void Scene::addRepaint(const QRegion &region)
const QRegion dirtyRegion = region & output->geometry(); const QRegion dirtyRegion = region & output->geometry();
if (!dirtyRegion.isEmpty()) { if (!dirtyRegion.isEmpty()) {
m_repaints[screenId] += dirtyRegion; m_repaints[screenId] += dirtyRegion;
output->renderLoop()->scheduleRepaint();
} }
} }
} else { } else {
m_repaints[0] += region; m_repaints[0] += region;
kwinApp()->platform()->renderLoop()->scheduleRepaint();
} }
Compositor::self()->scheduleRepaint();
} }
QRegion Scene::repaints(int screenId) const QRegion Scene::repaints(int screenId) const