diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-01-08 12:15:55 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2019-01-08 11:57:53 +0000 |
commit | 6258c4994200348220be6f35667a2c0f4b705539 (patch) | |
tree | ac54ad477b07f00aa4faaf46927522312e01b7d3 /src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | |
parent | c584db87cf924f3a3d883288de8c2f4210186af6 (diff) | |
download | qtwayland-6258c4994200348220be6f35667a2c0f4b705539.tar.gz |
Revert "Client: Full implementation for frame callbacks"
This caused regressions because QtQuick depends on swapBuffers for throttling
animations. We probably need to emulate a blocking swapBuffers and continue
after a timeout, but until we have a patch for this, revert this to avoid
releasing a regression.
This brings back the bug with a frozen event loop when a surface is waiting for
a frame callback, but this is preferable to a regression.
This reverts commit 1dc85b95ab0adc1e805d059e2c35c671ef790011.
Fixes: QTBUG-72578
Change-Id: If6435a947aae5e9fd775404649a392bfafe9130a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp')
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 0cbbe538..e58403ad 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -315,9 +315,7 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis mSupportNonBlockingSwap = false; } if (!mSupportNonBlockingSwap) { - qWarning(lcQpaWayland) << "Non-blocking swap buffers not supported." - << "Subsurface rendering can be affected." - << "It may also cause the event loop to freeze in some situations"; + qWarning() << "Non-blocking swap buffers not supported. Subsurface rendering can be affected."; } updateGLFormat(); @@ -552,10 +550,20 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface) m_blitter->blit(window); } - window->handleUpdate(); - int swapInterval = mSupportNonBlockingSwap ? 0 : m_format.swapInterval(); - eglSwapInterval(m_eglDisplay, swapInterval); - eglSwapBuffers(m_eglDisplay, eglSurface); + + QWaylandSubSurface *sub = window->subSurfaceWindow(); + if (sub) { + QMutexLocker l(sub->syncMutex()); + + int si = (sub->isSync() && mSupportNonBlockingSwap) ? 0 : m_format.swapInterval(); + + eglSwapInterval(m_eglDisplay, si); + eglSwapBuffers(m_eglDisplay, eglSurface); + } else { + eglSwapInterval(m_eglDisplay, m_format.swapInterval()); + eglSwapBuffers(m_eglDisplay, eglSurface); + } + window->setCanResize(true); } |