From 82f701ed00546a01602413e90390388a1ec6dfbe Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Wed, 10 May 2017 07:52:30 -0400 Subject: Skip EGL surface re-creation when the buffer size is unchanged Skip EGL surface re-creation when a sequence of unprocessed resizing requests leaves the buffer size unchanged. In this situation, the buffers won't be resized. Recreating the surface without resizing the buffers leads to screen providing incorrect information about the buffers. Change-Id: I1f75ab99eb1dffe0bcf9660bf014f047407b0c1b Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxeglwindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index aa2e4db193..33ce0f924c 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -140,11 +140,17 @@ EGLSurface QQnxEglWindow::getSurface() if (m_newSurfaceRequested.testAndSetOrdered(true, false)) { const QMutexLocker locker(&m_mutex); //Set geomety must not reset the requestedBufferSize till //the surface is created - if (m_eglSurface != EGL_NO_SURFACE) { - platformOpenGLContext()->doneCurrent(); - destroyEGLSurface(); + + if ((m_requestedBufferSize != bufferSize()) || (m_eglSurface == EGL_NO_SURFACE)) { + if (m_eglSurface != EGL_NO_SURFACE) { + platformOpenGLContext()->doneCurrent(); + destroyEGLSurface(); + } + createEGLSurface(); + } else { + // Must've been a sequence of unprocessed changes returning us to the original size. + resetBuffers(); } - createEGLSurface(); } return m_eglSurface; -- cgit v1.2.3