summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qopenglcontext.cpp15
-rw-r--r--src/gui/kernel/qopenglcontext.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 90e9235353..8cfb4154c1 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1185,6 +1185,21 @@ bool QOpenGLContext::isOpenGLES() const
}
/*!
+ Returns \c true if the platform supports OpenGL rendering outside the main (gui)
+ thread.
+
+ The value is controlled by the platform plugin in use and may also depend on the
+ graphics drivers.
+
+ \since 5.5
+ */
+bool QOpenGLContext::supportsThreadedOpenGL()
+{
+ Q_ASSERT(qGuiApp);
+ return QGuiApplicationPrivate::instance()->platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL);
+}
+
+/*!
\internal
*/
QOpenGLVersionFunctionsBackend *QOpenGLContext::functionsBackend(const QOpenGLVersionStatus &v) const
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index b31cc693b7..6be82aeb1d 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -198,6 +198,8 @@ public:
bool isOpenGLES() const;
+ static bool supportsThreadedOpenGL();
+
Q_SIGNALS:
void aboutToBeDestroyed();