[platform/virtual] Swap buffers in EGL GBM backend
Summary: The virtual platform did not actually present content and spin the compositor. Let's do this from now on , first for the EGL GBM backend. Test Plan: All tests pass according to Vlad Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: graesslin, zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D18436
This commit is contained in:
parent
9b922f8833
commit
1e6f6700f8
1 changed files with 10 additions and 1 deletions
|
@ -156,6 +156,12 @@ bool EglGbmBackend::initBufferConfigs()
|
|||
|
||||
void EglGbmBackend::present()
|
||||
{
|
||||
Compositor::self()->aboutToSwapBuffers();
|
||||
|
||||
eglSwapBuffers(eglDisplay(), surface());
|
||||
setLastDamage(QRegion());
|
||||
|
||||
Compositor::self()->bufferSwapComplete();
|
||||
}
|
||||
|
||||
void EglGbmBackend::screenGeometryChanged(const QSize &size)
|
||||
|
@ -171,6 +177,9 @@ SceneOpenGLTexturePrivate *EglGbmBackend::createBackendTexture(SceneOpenGLTextur
|
|||
|
||||
QRegion EglGbmBackend::prepareRenderingFrame()
|
||||
{
|
||||
if (!lastDamage().isEmpty()) {
|
||||
present();
|
||||
}
|
||||
startRenderTimer();
|
||||
if (!GLRenderTarget::isRenderTargetBound()) {
|
||||
GLRenderTarget::pushRenderTarget(m_fbo);
|
||||
|
@ -211,7 +220,6 @@ static void convertFromGLImage(QImage &img, int w, int h)
|
|||
|
||||
void EglGbmBackend::endRenderingFrame(const QRegion &renderedRegion, const QRegion &damagedRegion)
|
||||
{
|
||||
Q_UNUSED(renderedRegion)
|
||||
Q_UNUSED(damagedRegion)
|
||||
glFlush();
|
||||
if (m_backend->saveFrames()) {
|
||||
|
@ -221,6 +229,7 @@ void EglGbmBackend::endRenderingFrame(const QRegion &renderedRegion, const QRegi
|
|||
img.save(QStringLiteral("%1/%2.png").arg(m_backend->saveFrames()).arg(QString::number(m_frameCounter++)));
|
||||
}
|
||||
GLRenderTarget::popRenderTarget();
|
||||
setLastDamage(renderedRegion);
|
||||
}
|
||||
|
||||
bool EglGbmBackend::usesOverlayWindow() const
|
||||
|
|
Loading…
Reference in a new issue