diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2012-05-29 15:23:25 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-05 18:48:00 +0200 |
commit | e1774d202912b5d053872f242c61d964a5d69450 (patch) | |
tree | 2db13710c7d5979e5b49639b9ed5ef3f566a2beb /src/gui/kernel/qplatformwindow_qpa.cpp | |
parent | 7d28f7772cd8f5aad63359ed0b9c57c12923dc85 (diff) |
Verify the surfaceType before activating the GL context
Verify that the surfaceType() of the QPlatformContext is of type
OpenGLSurface before making the context active. Make it possible
to get the QSurface from a QPlatformSurface, make QPlatformWindow
use that to access the QWindow. Remove the setSurfaceType call from
the eglfs plugin as this hiding a problem.
Change-Id: I08906da052e066bb1f1f042030643c6389ab17d7
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/gui/kernel/qplatformwindow_qpa.cpp')
-rw-r--r-- | src/gui/kernel/qplatformwindow_qpa.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index 4e464d7838..01254966f0 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE class QPlatformWindowPrivate { - QWindow *window; QRect rect; friend class QPlatformWindow; }; @@ -59,11 +58,10 @@ class QPlatformWindowPrivate */ QPlatformWindow::QPlatformWindow(QWindow *window) - : QPlatformSurface(QSurface::Window) + : QPlatformSurface(window) , d_ptr(new QPlatformWindowPrivate) { Q_D(QPlatformWindow); - d->window = window; d->rect = window->geometry(); } @@ -79,8 +77,7 @@ QPlatformWindow::~QPlatformWindow() */ QWindow *QPlatformWindow::window() const { - Q_D(const QPlatformWindow); - return d->window; + return static_cast<QWindow *>(m_surface); } /*! @@ -88,8 +85,7 @@ QWindow *QPlatformWindow::window() const */ QPlatformWindow *QPlatformWindow::parent() const { - Q_D(const QPlatformWindow); - return d->window->parent() ? d->window->parent()->handle() : 0; + return window()->parent() ? window()->parent()->handle() : 0; } /*! @@ -97,8 +93,7 @@ QPlatformWindow *QPlatformWindow::parent() const */ QPlatformScreen *QPlatformWindow::screen() const { - Q_D(const QPlatformWindow); - return d->window->screen()->handle(); + return window()->screen()->handle(); } /*! @@ -170,8 +165,7 @@ Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags) bool QPlatformWindow::isExposed() const { - Q_D(const QPlatformWindow); - return d->window->isVisible(); + return window()->isVisible(); } /*! |