diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2013-08-22 17:02:05 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-11 04:24:57 +0100 |
commit | fd619946be51784dc709363324897be6af144c52 (patch) | |
tree | 4add7162e8fae66840e73267935ea4a131997dfa /src/plugins/platforms/qnx/qqnxeglwindow.cpp | |
parent | d4ade9d4ef785a96f0bd1a89acfdba8ec09324f6 (diff) |
Refactor QQnxWindow
This patch does following things:
* Remove the root window: First window which is created will serve as a root window
* Allow creation of more than one application window (with every app window having
an own window group) on one screen
* Fixes a bug when reparanting an EGL window
Change-Id: I1afd64a813bc084c0893b958aa191d4a25c32b9d
Reviewed-by: Matt Hoosier <matt.hoosier@garmin.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxeglwindow.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxeglwindow.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index e8fcdd692b..6afc3cad21 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -42,6 +42,7 @@ #include "qqnxeglwindow.h" #include "qqnxscreen.h" +#include "qqnxglcontext.h" #include <QDebug> @@ -55,8 +56,8 @@ QT_BEGIN_NAMESPACE -QQnxEglWindow::QQnxEglWindow(QWindow *window, screen_context_t context) : - QQnxWindow(window, context), +QQnxEglWindow::QQnxEglWindow(QWindow *window, screen_context_t context, bool needRootWindow) : + QQnxWindow(window, context, needRootWindow), m_requestedBufferSize(window->geometry().size()), m_platformOpenGLContext(0), m_newSurfaceRequested(true), @@ -98,8 +99,6 @@ void QQnxEglWindow::createEGLSurface() QQnxGLContext::checkEGLError("eglCreateWindowSurface"); qFatal("QQNX: failed to create EGL surface, err=%d", eglGetError()); } - - screen()->onWindowPost(0); } void QQnxEglWindow::destroyEGLSurface() @@ -166,6 +165,13 @@ QSize QQnxEglWindow::requestedBufferSize() const return m_requestedBufferSize; } +void QQnxEglWindow::adjustBufferSize() +{ + const QSize windowSize = window()->size(); + if (windowSize != bufferSize()) + setBufferSize(windowSize); +} + void QQnxEglWindow::setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext) { // This function does not take ownership of the platform gl context. @@ -175,6 +181,9 @@ void QQnxEglWindow::setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContex int QQnxEglWindow::pixelFormat() const { + if (!m_platformOpenGLContext) //The platform GL context was not set yet + return -1; + const QSurfaceFormat format = m_platformOpenGLContext->format(); // Extract size of color channels from window format const int redSize = format.redBufferSize(); |