diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-01-31 13:54:30 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-02-02 14:03:29 +0000 |
commit | aa475a30af2e6905acee5e0e4260414ac493b0e3 (patch) | |
tree | fafd36971fb2307804a868bb40f9572f95cab13b /src/gui/kernel/qopenglcontext.cpp | |
parent | d800180f828087e144b30346e8cea312aa2bf062 (diff) |
Expose the ThreadedOpenGL cap to apps
Applications have no public API to check for the ThreadedOpenGL flag
reported by the platform plugins. Add a static function to QOpenGLContext
to give interested applications a way to decide if they should do
rendering on separate threads.
Task-number: QTBUG-44208
Change-Id: I629332512ab31fe49f842065a911270cd6cea7aa
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/kernel/qopenglcontext.cpp')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 15 |
1 files changed, 15 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 |