From 74d84f32daadbb5e8998bc13bdbb5b06642b0a56 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Sat, 1 Feb 2014 12:26:09 +0100 Subject: [QNX} Remove adjustBufferSize from the egl window setGeometry will adjust the buffer for an egl window when a egl surface is created. Adjusting the buffer somewhere else can be potentially harmful. Another reason is that every egl window has a buffer on its own (unlike raster windows) so we do not have to check if we have to create a buffer after reparanting. Change-Id: I01406867a0dab598dac7d86e1f1e28ca9736a299 Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxeglwindow.cpp | 7 ------- src/plugins/platforms/qnx/qqnxeglwindow.h | 2 -- src/plugins/platforms/qnx/qqnxrasterwindow.cpp | 6 ++++++ src/plugins/platforms/qnx/qqnxrasterwindow.h | 2 ++ src/plugins/platforms/qnx/qqnxwindow.cpp | 2 -- src/plugins/platforms/qnx/qqnxwindow.h | 1 - 6 files changed, 8 insertions(+), 12 deletions(-) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index 5892252a5b..8acb258a1d 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -170,13 +170,6 @@ 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. diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.h b/src/plugins/platforms/qnx/qqnxeglwindow.h index fc53afcd7a..a6a223c58e 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.h +++ b/src/plugins/platforms/qnx/qqnxeglwindow.h @@ -68,8 +68,6 @@ public: // Called by QQnxGLContext::createSurface() QSize requestedBufferSize() const; - void adjustBufferSize(); - protected: int pixelFormat() const; void resetBuffers(); diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp index fc86525c3c..e5d7846253 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp @@ -162,6 +162,12 @@ QQnxBuffer &QQnxRasterWindow::renderBuffer() return m_buffers[m_currentBufferIndex]; } +void QQnxRasterWindow::setParent(const QPlatformWindow *wnd) +{ + QQnxWindow::setParent(wnd); + adjustBufferSize(); +} + void QQnxRasterWindow::adjustBufferSize() { // When having a raster window we don't need any buffers, since diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.h b/src/plugins/platforms/qnx/qqnxrasterwindow.h index ad34b3ccf2..2be5f63464 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.h +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.h @@ -60,6 +60,8 @@ public: bool hasBuffers() const { return !bufferSize().isEmpty(); } + void setParent(const QPlatformWindow *window); + void adjustBufferSize(); protected: diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 90b00efc13..bb76efea64 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -398,8 +398,6 @@ void QQnxWindow::setParent(const QPlatformWindow *window) joinWindowGroup(QByteArray()); } - adjustBufferSize(); - m_screen->updateHierarchy(); } diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h index 288ce66087..ea7b388e9f 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.h +++ b/src/plugins/platforms/qnx/qqnxwindow.h @@ -78,7 +78,6 @@ public: WId winId() const { return (WId)m_window; } screen_window_t nativeHandle() const { return m_window; } - virtual void adjustBufferSize() = 0; void setBufferSize(const QSize &size); QSize bufferSize() const { return m_bufferSize; } -- cgit v1.2.3