Qt: Minor GL fixes

This commit is contained in:
Vicki Pfau 2019-09-14 22:59:00 -07:00
parent 1dc405db38
commit 0cc8046121
1 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,7 @@ void DisplayGL::startDrawing(std::shared_ptr<CoreController> controller) {
messagePainter()->resize(size(), isAspectRatioLocked(), devicePixelRatio()); messagePainter()->resize(size(), isAspectRatioLocked(), devicePixelRatio());
#endif #endif
resizePainter(); resizePainter();
setUpdatesEnabled(false);
} }
void DisplayGL::stopDrawing() { void DisplayGL::stopDrawing() {
@ -124,12 +125,14 @@ void DisplayGL::stopDrawing() {
CoreController::Interrupter interrupter(m_context); CoreController::Interrupter interrupter(m_context);
QMetaObject::invokeMethod(m_painter, "stop", Qt::BlockingQueuedConnection); QMetaObject::invokeMethod(m_painter, "stop", Qt::BlockingQueuedConnection);
m_drawThread->exit(); m_drawThread->exit();
m_drawThread->wait();
m_drawThread = nullptr; m_drawThread = nullptr;
m_gl->makeCurrent(windowHandle()); m_gl->makeCurrent(windowHandle());
#if defined(_WIN32) && defined(USE_EPOXY) #if defined(_WIN32) && defined(USE_EPOXY)
epoxy_handle_external_wglMakeCurrent(); epoxy_handle_external_wglMakeCurrent();
#endif #endif
setUpdatesEnabled(true);
} }
m_context.reset(); m_context.reset();
} }
@ -139,6 +142,7 @@ void DisplayGL::pauseDrawing() {
m_isDrawing = false; m_isDrawing = false;
CoreController::Interrupter interrupter(m_context); CoreController::Interrupter interrupter(m_context);
QMetaObject::invokeMethod(m_painter, "pause", Qt::BlockingQueuedConnection); QMetaObject::invokeMethod(m_painter, "pause", Qt::BlockingQueuedConnection);
setUpdatesEnabled(true);
} }
} }
@ -147,6 +151,7 @@ void DisplayGL::unpauseDrawing() {
m_isDrawing = true; m_isDrawing = true;
CoreController::Interrupter interrupter(m_context); CoreController::Interrupter interrupter(m_context);
QMetaObject::invokeMethod(m_painter, "unpause", Qt::BlockingQueuedConnection); QMetaObject::invokeMethod(m_painter, "unpause", Qt::BlockingQueuedConnection);
setUpdatesEnabled(false);
} }
} }