From 16af4bf437b2abb5d0071511956d04e187065f7b Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 28 Apr 2022 15:09:09 +0300 Subject: [PATCH] Remove redundant window filter calls If the window filter rejects a window, that window won't be in the stacking_order and henceforth won't be painted, so finalDrawWindow() does extra work of checking again if the window is accepted. --- src/scene.cpp | 3 --- src/scene.h | 2 +- src/scenes/opengl/scene_opengl.cpp | 8 -------- src/scenes/opengl/scene_opengl.h | 1 - 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/scene.cpp b/src/scene.cpp index 5f1fc52a22..cd5114b169 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -616,9 +616,6 @@ void Scene::finalPaintWindow(EffectWindowImpl *w, int mask, const QRegion ®io // will be eventually called from drawWindow() void Scene::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data) { - if (!m_filter.filterAcceptsWindow(w->window())) { - return; - } w->sceneWindow()->performPaint(mask, region, data); } diff --git a/src/scene.h b/src/scene.h index 8581ea0ead..9f7716d3ea 100644 --- a/src/scene.h +++ b/src/scene.h @@ -237,7 +237,7 @@ protected: // shared implementation, starts painting the window virtual void paintWindow(SceneWindow *w, int mask, const QRegion ®ion); // called after all effects had their drawWindow() called - virtual void finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data); + void finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data); virtual void paintOffscreenQuickView(OffscreenQuickView *w) = 0; diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index daee52a7a2..687894dd8c 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -311,14 +311,6 @@ SceneWindow *SceneOpenGL::createWindow(Window *t) return new OpenGLWindow(t, this); } -void SceneOpenGL::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data) -{ - if (!m_filter.filterAcceptsWindow(w->window())) { - return; - } - performPaintWindow(w, mask, region, data); -} - void SceneOpenGL::performPaintWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data) { if (mask & PAINT_WINDOW_LANCZOS) { diff --git a/src/scenes/opengl/scene_opengl.h b/src/scenes/opengl/scene_opengl.h index 0e63f5a59b..044ff386ef 100644 --- a/src/scenes/opengl/scene_opengl.h +++ b/src/scenes/opengl/scene_opengl.h @@ -70,7 +70,6 @@ protected: void paintSimpleScreen(int mask, const QRegion ®ion) override; void paintGenericScreen(int mask, const ScreenPaintData &data) override; SceneWindow *createWindow(Window *t) override; - void finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion ®ion, WindowPaintData &data) override; private: void doPaintBackground(const QVector &vertices);