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>
This commit is contained in:
parent
f54327c3c3
commit
82f701ed00
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user