diff --git a/src/backends/wayland/egl_wayland_backend.cpp b/src/backends/wayland/egl_wayland_backend.cpp index 51d71546d7..f9a3ec53fa 100644 --- a/src/backends/wayland/egl_wayland_backend.cpp +++ b/src/backends/wayland/egl_wayland_backend.cpp @@ -309,6 +309,17 @@ static QVector regionToRects(const QRegion ®ion, AbstractWaylandOutpu return rects; } + +QSharedPointer EglWaylandBackend::textureForOutput(KWin::AbstractOutput *output) const +{ + QSharedPointer texture(new GLTexture(GL_RGBA8, output->pixelSize())); + GLRenderTarget::pushRenderTarget(m_outputs[output]->renderTarget()); + GLRenderTarget renderTarget(texture.data()); + renderTarget.blitFromFramebuffer(QRect(0, texture->height(), texture->width(), -texture->height())); + GLRenderTarget::popRenderTarget(); + return texture; +} + void EglWaylandBackend::aboutToStartPainting(AbstractOutput *output, const QRegion &damagedRegion) { Q_ASSERT_X(output, "aboutToStartPainting", "not using per screen rendering"); diff --git a/src/backends/wayland/egl_wayland_backend.h b/src/backends/wayland/egl_wayland_backend.h index 6496a93dbd..3d04ff1a02 100644 --- a/src/backends/wayland/egl_wayland_backend.h +++ b/src/backends/wayland/egl_wayland_backend.h @@ -83,6 +83,7 @@ public: return m_havePlatformBase; } + QSharedPointer textureForOutput(KWin::AbstractOutput *output) const override; void aboutToStartPainting(AbstractOutput *output, const QRegion &damage) override; private: