Speed up EffectQuickView teardown

On my Nvidia machine there was a massive lag exitingthe overview effect.
Hotspot showed it as being in QOpenGLVertexArrayObjectPrivate::destroy.
In this method we clean up some shared objects used in the context when
the context closes.

In order to do this we need the context to be current. If it is not
current Qt currently internally creates a temporary offscreen surface.

To fix this we need to have our context current during destruction,
which includes changing order so it is destroyed before the surface.
master
David Edmundson 3 years ago
parent 030cc2d844
commit 044767e296

@ -57,8 +57,8 @@ class Q_DECL_HIDDEN EffectQuickView::Private
public:
QQuickWindow *m_view;
QQuickRenderControl *m_renderControl;
QScopedPointer<QOpenGLContext> m_glcontext;
QScopedPointer<QOffscreenSurface> m_offscreenSurface;
QScopedPointer<QOpenGLContext> m_glcontext;
QScopedPointer<QOpenGLFramebufferObject> m_fbo;
QTimer *m_repaintTimer;
@ -165,7 +165,6 @@ EffectQuickView::~EffectQuickView()
delete d->m_view;
d->m_view = nullptr;
d->m_renderControl->invalidate();
d->m_glcontext->doneCurrent();
}
}

Loading…
Cancel
Save