Qt: Only close GL context on thread when shutting down

This commit is contained in:
Vicki Pfau 2019-05-20 17:28:34 -07:00
parent 3056655060
commit 1868ccaadd
1 changed files with 0 additions and 28 deletions

View File

@ -315,18 +315,8 @@ void PainterGL::resizeContext() {
return;
}
if (!m_active) {
m_gl->makeCurrent(m_surface);
#if defined(_WIN32) && defined(USE_EPOXY)
epoxy_handle_external_wglMakeCurrent();
#endif
}
QSize size = m_context->screenDimensions();
m_backend->setDimensions(m_backend, size.width(), size.height());
if (!m_active) {
m_gl->doneCurrent();
}
}
void PainterGL::setMessagePainter(MessagePainter* messagePainter) {
@ -493,12 +483,6 @@ void PainterGL::setShaders(struct VDir* dir) {
return;
}
#ifdef BUILD_GLES2
if (!m_active) {
m_gl->makeCurrent(m_surface);
#if defined(_WIN32) && defined(USE_EPOXY)
epoxy_handle_external_wglMakeCurrent();
#endif
}
if (m_shader.passes) {
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
mGLES2ShaderFree(&m_shader);
@ -507,9 +491,6 @@ void PainterGL::setShaders(struct VDir* dir) {
if (m_started) {
mGLES2ShaderAttach(reinterpret_cast<mGLES2Context*>(m_backend), static_cast<mGLES2Shader*>(m_shader.passes), m_shader.nPasses);
}
if (!m_active) {
m_gl->doneCurrent();
}
#endif
}
@ -518,19 +499,10 @@ void PainterGL::clearShaders() {
return;
}
#ifdef BUILD_GLES2
if (!m_active) {
m_gl->makeCurrent(m_surface);
#if defined(_WIN32) && defined(USE_EPOXY)
epoxy_handle_external_wglMakeCurrent();
#endif
}
if (m_shader.passes) {
mGLES2ShaderDetach(reinterpret_cast<mGLES2Context*>(m_backend));
mGLES2ShaderFree(&m_shader);
}
if (!m_active) {
m_gl->doneCurrent();
}
#endif
}