diff options
author | Samuli Piippo <samuli.piippo@digia.com> | 2013-07-29 14:39:15 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-31 14:42:13 +0200 |
commit | c837dbecdd9ab6707798cd26ae7979063eb8d93b (patch) | |
tree | bb92ec872ea6b094374c84f3125a94b113bfd180 /src/plugins | |
parent | 22fbb5be6edd1b128d582f68c095ff5118dadc29 (diff) |
eglfs: allow egl native window to be zero
Change the checking for created EGLNativeWindowType so that zero
is a valid value. This is the case e.g, with BeagleBoard, where
widget application cannot be run without this change.
Change-Id: I36c30091e1a5a0598ae3822d0be8dc4362779c0b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfswindow.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfswindow.h | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index 9aece1ea83..3b0c7de8e7 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -53,6 +53,7 @@ QEglFSWindow::QEglFSWindow(QWindow *w) : QPlatformWindow(w) , m_surface(0) , m_window(0) + , has_window(false) { static int serialNo = 0; m_winid = ++serialNo; @@ -69,7 +70,7 @@ QEglFSWindow::~QEglFSWindow() void QEglFSWindow::create() { - if (m_window) + if (has_window) return; setWindowState(Qt::WindowFullScreen); @@ -91,7 +92,7 @@ void QEglFSWindow::create() void QEglFSWindow::invalidateSurface() { // Native surface has been deleted behind our backs - m_window = 0; + has_window = false; if (m_surface != 0) { EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display(); eglDestroySurface(display, m_surface); @@ -104,6 +105,7 @@ void QEglFSWindow::resetSurface() EGLDisplay display = static_cast<QEglFSScreen *>(screen())->display(); m_window = QEglFSHooks::hooks()->createNativeWindow(QEglFSHooks::hooks()->screenSize(), m_format); + has_window = true; m_surface = eglCreateWindowSurface(display, m_config, m_window, NULL); if (m_surface == EGL_NO_SURFACE) { EGLint error = eglGetError(); @@ -120,9 +122,9 @@ void QEglFSWindow::destroy() m_surface = 0; } - if (m_window) { + if (has_window) { QEglFSHooks::hooks()->destroyNativeWindow(m_window); - m_window = 0; + has_window = false; } } diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index 67a64973ce..a119c9f815 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -76,6 +76,7 @@ private: WId m_winid; EGLConfig m_config; QSurfaceFormat m_format; + bool has_window; }; QT_END_NAMESPACE #endif // QEGLFSWINDOW_H |