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.
This commit is contained in:
Vlad Zahorodnii 2022-04-28 15:09:09 +03:00
parent 05877a8321
commit 16af4bf437
4 changed files with 1 additions and 13 deletions

View file

@ -616,9 +616,6 @@ void Scene::finalPaintWindow(EffectWindowImpl *w, int mask, const QRegion &regio
// will be eventually called from drawWindow()
void Scene::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data)
{
if (!m_filter.filterAcceptsWindow(w->window())) {
return;
}
w->sceneWindow()->performPaint(mask, region, data);
}

View file

@ -237,7 +237,7 @@ protected:
// shared implementation, starts painting the window
virtual void paintWindow(SceneWindow *w, int mask, const QRegion &region);
// called after all effects had their drawWindow() called
virtual void finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data);
void finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data);
virtual void paintOffscreenQuickView(OffscreenQuickView *w) = 0;

View file

@ -311,14 +311,6 @@ SceneWindow *SceneOpenGL::createWindow(Window *t)
return new OpenGLWindow(t, this);
}
void SceneOpenGL::finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data)
{
if (!m_filter.filterAcceptsWindow(w->window())) {
return;
}
performPaintWindow(w, mask, region, data);
}
void SceneOpenGL::performPaintWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data)
{
if (mask & PAINT_WINDOW_LANCZOS) {

View file

@ -70,7 +70,6 @@ protected:
void paintSimpleScreen(int mask, const QRegion &region) override;
void paintGenericScreen(int mask, const ScreenPaintData &data) override;
SceneWindow *createWindow(Window *t) override;
void finalDrawWindow(EffectWindowImpl *w, int mask, const QRegion &region, WindowPaintData &data) override;
private:
void doPaintBackground(const QVector<float> &vertices);