diff options
author | Andy Shaw <andy.shaw@qt.io> | 2019-03-26 17:37:48 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-04-09 11:23:32 +0000 |
commit | 1f4862ef5db138e9dcefe1ebc16df3e054200775 (patch) | |
tree | 6812df8dba3b529216ab321b14aab0f61f31e934 | |
parent | bc00353cffbfe0f74b602a16452f2e7bcd588152 (diff) |
QQuickWindow: Run render jobs when there is a render control in NoStage
When running a QML application with using Canvas3D component inside a
QQuickWidget, the Canvas3D is not rendered. This is due to no scheduled
OpenGL commands with RenderStage == NoStage are actually executed when
there is a render control instead of a window manager.
Fixes: QTBUG-51993
Change-Id: I33323893cd6144187feccb1c6bcd010eff0fff6d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index c6bfcaa647..bd01e9b3ce 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -4828,10 +4828,18 @@ void QQuickWindow::scheduleRenderJob(QRunnable *job, RenderStage stage) } else if (stage == AfterSwapStage) { d->afterSwapJobs << job; } else if (stage == NoStage) { - if (isExposed()) + if (d->renderControl && openglContext() +#if QT_CONFIG(opengl) + && openglContext()->thread() == QThread::currentThread() +#endif + ) { + job->run(); + delete job; + } else if (isExposed()) { d->windowManager->postJob(this, job); - else + } else { delete job; + } } d->renderJobMutex.unlock(); } |