summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxeglwindow.cpp
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2014-04-04 17:42:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-08 09:50:08 +0200
commitc6720d87218915f2557d9698218a22c1d46b4950 (patch)
tree7325bfb38d03456124477c0058ac790382b70b23 /src/plugins/platforms/qnx/qqnxeglwindow.cpp
parent118494aeda916a63dd94474442f9dbf7b2ad7ff5 (diff)
QNX: Destroy window buffers when resized
QNX version of screen doesn't reallocate window buffers dynamically. The buffers have to be destroyed and recreated when a window is resized. As the overhead is minimal this will be done on BlackBerry, as well. Change-Id: I488942879822c64a6ab1871ebf5d6da9aec144d6 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxeglwindow.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxeglwindow.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
index f1f9f5469c..9d40d166af 100644
--- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp
@@ -81,15 +81,14 @@ QQnxEglWindow::~QQnxEglWindow()
void QQnxEglWindow::createEGLSurface()
{
- // Fetch the surface size from the window and update
- // the window's buffers before we create the EGL surface
- const QSize surfaceSize = requestedBufferSize();
- if (!surfaceSize.isValid()) {
+ if (!m_requestedBufferSize.isValid()) {
qWarning("QQNX: Trying to create 0 size EGL surface. "
"Please set a valid window size before calling QOpenGLContext::makeCurrent()");
return;
}
- setBufferSize(surfaceSize);
+
+ // update the window's buffers before we create the EGL surface
+ setBufferSize(m_requestedBufferSize);
const EGLint eglSurfaceAttrs[] =
{
@@ -99,9 +98,10 @@ void QQnxEglWindow::createEGLSurface()
qEglWindowDebug() << "Creating EGL surface" << platformOpenGLContext()->getEglDisplay()
<< platformOpenGLContext()->getEglConfig();
+
// Create EGL surface
- m_eglSurface = eglCreateWindowSurface(platformOpenGLContext()->getEglDisplay()
- , platformOpenGLContext()->getEglConfig(),
+ m_eglSurface = eglCreateWindowSurface(platformOpenGLContext()->getEglDisplay(),
+ platformOpenGLContext()->getEglConfig(),
(EGLNativeWindowType) nativeHandle(), eglSurfaceAttrs);
if (m_eglSurface == EGL_NO_SURFACE) {
const EGLenum error = QQnxGLContext::checkEGLError("eglCreateWindowSurface");
@@ -171,11 +171,6 @@ void QQnxEglWindow::setGeometry(const QRect &rect)
QQnxWindow::setGeometry(newGeometry);
}
-QSize QQnxEglWindow::requestedBufferSize() const
-{
- return m_requestedBufferSize;
-}
-
void QQnxEglWindow::setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext)
{
// This function does not take ownership of the platform gl context.