diff --git a/src/backends/drm/egl_gbm_backend.cpp b/src/backends/drm/egl_gbm_backend.cpp index 9bdf1514e9..4e7e607b09 100644 --- a/src/backends/drm/egl_gbm_backend.cpp +++ b/src/backends/drm/egl_gbm_backend.cpp @@ -234,7 +234,9 @@ bool EglGbmBackend::swapBuffers(DrmAbstractOutput *drmOutput, const QRegion &dir { Q_ASSERT(m_outputs.contains(drmOutput)); Output &output = m_outputs[drmOutput]; - renderFramebufferToSurface(output); + if (output.current.shadowBuffer) { + output.current.shadowBuffer->render(output.output); + } if (output.current.gbmSurface->swapBuffers()) { cleanupRenderData(output.old); updateBufferAge(output, dirty); @@ -353,16 +355,6 @@ QSharedPointer EglGbmBackend::importFramebuffer(Output &output, const return nullptr; } -void EglGbmBackend::renderFramebufferToSurface(Output &output) -{ - if (!output.current.shadowBuffer) { - // No additional render target. - return; - } - output.current.gbmSurface->makeContextCurrent(); - output.current.shadowBuffer->render(output.output); -} - bool EglGbmBackend::initBufferConfigs() { const EGLint config_attribs[] = { @@ -581,7 +573,9 @@ QSharedPointer EglGbmBackend::endFrameWithBuffer(AbstractOutput *drmO Q_ASSERT(m_outputs.contains(drmOutput)); Output &output = m_outputs[drmOutput]; if (isPrimary()) { - renderFramebufferToSurface(output); + if (output.current.shadowBuffer) { + output.current.shadowBuffer->render(output.output); + } auto buffer = output.current.gbmSurface->swapBuffersForDrm(); if (buffer) { updateBufferAge(output, dirty); diff --git a/src/backends/drm/egl_gbm_backend.h b/src/backends/drm/egl_gbm_backend.h index 258991cde7..2d0f491bc7 100644 --- a/src/backends/drm/egl_gbm_backend.h +++ b/src/backends/drm/egl_gbm_backend.h @@ -123,7 +123,6 @@ private: void setViewport(const Output &output) const; - void renderFramebufferToSurface(Output &output); QRegion prepareRenderingForOutput(Output &output); QSharedPointer importFramebuffer(Output &output, const QRegion &dirty) const; QSharedPointer endFrameWithBuffer(AbstractOutput *output, const QRegion &dirty);