summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorJames McDonnell <jmcdonnell@blackberry.com>2017-05-10 07:52:30 -0400
committerJames McDonnell <jmcdonnell@blackberry.com>2017-07-20 20:04:26 +0000
commit82f701ed00546a01602413e90390388a1ec6dfbe (patch)
treec072e637b314ae80f6fdf8896cd1340873f312c2 /src/plugins/platforms
parentf54327c3c3956c045f4bfe4023bf4ce92fceee3b (diff)
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 <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/qnx/qqnxeglwindow.cpp14
1 files 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;