plugins/qpa: Assume there's current context when swapBuffers() is called

It can happen that the window is resized after makeCurrent() and before
swapBuffers(). In that case, context()->makeCurrent() will re-create the
fbo and qpa will present an uninitialize fbo.

Assume that there's current context when swapBuffers() is called. Other
QPA already do this, for example, QtWayland. This would make the
behavior of our qpa consistent with QtWayland and fix resizing the fbo
in swapBuffers().

In general, kwin should be able to handle size mismatch between the fbo
and QWindow, but as an extra hardening measure, we could forbid resizing
windows during rendering, this can be done later though.
This commit is contained in:
Vlad Zahorodnii 2022-06-19 12:54:35 +03:00
parent 11ad5fea9a
commit a9267bdcdc

View file

@ -118,7 +118,6 @@ void EGLPlatformContext::swapBuffers(QPlatformSurface *surface)
if (!internalWindow) {
return;
}
context()->makeCurrent(surface->surface());
glFlush();
auto fbo = window->swapFBO();
window->bindContentFBO();