summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-01-31 13:54:30 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-02 14:03:29 +0000
commitaa475a30af2e6905acee5e0e4260414ac493b0e3 (patch)
treefafd36971fb2307804a868bb40f9572f95cab13b /src/gui
parentd800180f828087e144b30346e8cea312aa2bf062 (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')
-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();