summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-10-13 11:57:13 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-10-13 14:00:21 +0200
commitd92a9ca2d33ae737b4b4362561209324ade3c95b (patch)
tree43dfa468fc53e0bc0a9a1d7e39852322078d0bb1 /src
parentdf2afcad2fc58effc73797402176a67d0964637a (diff)
Update QOffscreenSurface docs regarding threads
Change-Id: Ic2e3230835aa7fc1b1c3ac0530a65cd478e1ec5f Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qoffscreensurface.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp
index 56c4fbbf8b..5cf77de5d8 100644
--- a/src/gui/kernel/qoffscreensurface.cpp
+++ b/src/gui/kernel/qoffscreensurface.cpp
@@ -64,6 +64,12 @@ QT_BEGIN_NAMESPACE
typically use a pixel buffer (pbuffer). If the platform doesn't implement or support
offscreen surfaces, QOffscreenSurface will use an invisible QWindow internally.
+ \note Due to the fact that QOffscreenSurface is backed by a QWindow on some platforms,
+ cross-platform applications must ensure that create() is only called on the main (GUI)
+ thread. The QOffscreenSurface is then safe to be used with
+ \l{QOpenGLContext::makeCurrent()}{makeCurrent()} on other threads, but the
+ initialization and destruction must always happen on the main (GUI) thread.
+
\note In order to create an offscreen surface that is guaranteed to be compatible with
a given context and window, make sure to set the format to the context's or the
window's actual format, that is, the QSurfaceFormat returned from
@@ -152,6 +158,8 @@ QOffscreenSurface::SurfaceType QOffscreenSurface::surfaceType() const
Call destroy() to free the platform resources if necessary.
+ \note Some platforms require this function to be called on the main (GUI) thread.
+
\sa destroy()
*/
void QOffscreenSurface::create()