diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qoffscreensurface.cpp | 8 |
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() |