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 @@ -1184,6 +1184,21 @@ bool QOpenGLContext::isOpenGLES() const return format().renderableType() == QSurfaceFormat::OpenGLES; } +/*! + 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 */ 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();