From 4a879379b3e3d177754298cae45b5058d71fa6d1 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 28 Nov 2020 22:01:45 +0200 Subject: [PATCH] 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. --- scene.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene.cpp b/scene.cpp index 8c1f91804c..695e5af7a1 100644 --- a/scene.cpp +++ b/scene.cpp @@ -66,6 +66,7 @@ #include "deleted.h" #include "effects.h" #include "overlaywindow.h" +#include "renderloop.h" #include "screens.h" #include "shadow.h" #include "subsurfacemonitor.h" @@ -109,13 +110,13 @@ void Scene::addRepaint(const QRegion ®ion) const QRegion dirtyRegion = region & output->geometry(); if (!dirtyRegion.isEmpty()) { m_repaints[screenId] += dirtyRegion; + output->renderLoop()->scheduleRepaint(); } } } else { m_repaints[0] += region; + kwinApp()->platform()->renderLoop()->scheduleRepaint(); } - - Compositor::self()->scheduleRepaint(); } QRegion Scene::repaints(int screenId) const