diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-06-28 08:50:34 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-03 00:40:58 +0200 |
commit | ca456f34b0a7c6229f43bb932b3aaa2d15ce8740 (patch) | |
tree | b6a7f2d69b07a72ece8addea2f35a36ec94fc8d5 /src/plugins/platforms/qnx/qqnxwindow.h | |
parent | ab2fb14b466173a5230d07a768f46203eb9ae08a (diff) |
QNX: Enable threaded OpenGL rendering on QNX
The only complicated aspect to this was deferring EGLsurface
re-creation as a result of window geometry changes (e.g. when we
receive an orientation change event). To allow this to be done
in a controlled way we defer the surface manipulation until the
next call to QQnxGLContext::makeCurrent().
Change-Id: I8062d3e4d19220a822fbc3b8ca563bb1e3be09d0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxwindow.h')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h index 4a461d0acc..26afe71536 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.h +++ b/src/plugins/platforms/qnx/qqnxwindow.h @@ -47,6 +47,7 @@ #include "qqnxbuffer.h" #include <QtGui/QImage> +#include <QtCore/QMutex> #ifndef QT_NO_OPENGL #include <EGL/egl.h> @@ -82,6 +83,9 @@ public: WId winId() const { return (WId)m_window; } screen_window_t nativeHandle() const { return m_window; } + // Called by QQnxGLContext::createSurface() + QSize requestedBufferSize() const; + void setBufferSize(const QSize &size); QSize bufferSize() const { return m_bufferSize; } bool hasBuffers() const { return !m_bufferSize.isEmpty(); } @@ -140,6 +144,15 @@ private: bool m_visible; QRect m_unmaximizedGeometry; Qt::WindowState m_windowState; + + // This mutex is used to protect access to the m_requestedBufferSize + // member. This member is used in conjunction with QQnxGLContext::requestNewSurface() + // to coordinate recreating the EGL surface which involves destroying any + // existing EGL surface; resizing the native window buffers; and creating a new + // EGL surface. All of this has to be done from the thread that is calling + // QQnxGLContext::makeCurrent() + mutable QMutex m_mutex; + QSize m_requestedBufferSize; }; QT_END_NAMESPACE |