Drop Scene::Window::windowTexture()
This commit is contained in:
parent
10032e99e3
commit
8518a7ea8c
3 changed files with 0 additions and 43 deletions
|
@ -316,10 +316,6 @@ public:
|
||||||
SurfaceItem *surfaceItem() const;
|
SurfaceItem *surfaceItem() const;
|
||||||
ShadowItem *shadowItem() const;
|
ShadowItem *shadowItem() const;
|
||||||
|
|
||||||
virtual QSharedPointer<GLTexture> windowTexture() {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Toplevel* toplevel;
|
Toplevel* toplevel;
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -933,44 +933,6 @@ void OpenGLWindow::performPaint(int mask, const QRegion ®ion, const WindowPai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<GLTexture> OpenGLWindow::windowTexture()
|
|
||||||
{
|
|
||||||
OpenGLSurfaceTexture *frame = nullptr;
|
|
||||||
const SurfaceItem *item = surfaceItem();
|
|
||||||
|
|
||||||
if (item && item->pixmap()) {
|
|
||||||
frame = static_cast<OpenGLSurfaceTexture *>(item->pixmap()->texture());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (frame && item->childItems().isEmpty() && frame->texture()) {
|
|
||||||
return QSharedPointer<GLTexture>(new GLTexture(*frame->texture()));
|
|
||||||
} else {
|
|
||||||
auto effectWindow = window()->effectWindow();
|
|
||||||
const QRect virtualGeometry = window()->bufferGeometry();
|
|
||||||
QSharedPointer<GLTexture> texture(new GLTexture(GL_RGBA8, virtualGeometry.size() * window()->bufferScale()));
|
|
||||||
|
|
||||||
QScopedPointer<GLRenderTarget> framebuffer(new KWin::GLRenderTarget(*texture));
|
|
||||||
GLRenderTarget::pushRenderTarget(framebuffer.data());
|
|
||||||
|
|
||||||
auto renderVSG = GLRenderTarget::virtualScreenGeometry();
|
|
||||||
const QRect outputGeometry = { virtualGeometry.topLeft(), texture->size() };
|
|
||||||
GLVertexBuffer::setVirtualScreenGeometry(outputGeometry);
|
|
||||||
GLRenderTarget::setVirtualScreenGeometry(outputGeometry);
|
|
||||||
|
|
||||||
QMatrix4x4 mvp;
|
|
||||||
mvp.ortho(virtualGeometry.x(), virtualGeometry.x() + virtualGeometry.width(), virtualGeometry.y(), virtualGeometry.y() + virtualGeometry.height(), -1, 1);
|
|
||||||
|
|
||||||
WindowPaintData data(effectWindow);
|
|
||||||
data.setProjectionMatrix(mvp);
|
|
||||||
|
|
||||||
performPaint(Scene::PAINT_WINDOW_TRANSFORMED, outputGeometry, data);
|
|
||||||
GLRenderTarget::popRenderTarget();
|
|
||||||
GLVertexBuffer::setVirtualScreenGeometry(renderVSG);
|
|
||||||
GLRenderTarget::setVirtualScreenGeometry(renderVSG);
|
|
||||||
return texture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//****************************************
|
//****************************************
|
||||||
// SceneOpenGL::EffectFrame
|
// SceneOpenGL::EffectFrame
|
||||||
//****************************************
|
//****************************************
|
||||||
|
|
|
@ -120,7 +120,6 @@ public:
|
||||||
~OpenGLWindow() override;
|
~OpenGLWindow() override;
|
||||||
|
|
||||||
void performPaint(int mask, const QRegion ®ion, const WindowPaintData &data) override;
|
void performPaint(int mask, const QRegion ®ion, const WindowPaintData &data) override;
|
||||||
QSharedPointer<GLTexture> windowTexture() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMatrix4x4 modelViewProjectionMatrix(int mask, const WindowPaintData &data) const;
|
QMatrix4x4 modelViewProjectionMatrix(int mask, const WindowPaintData &data) const;
|
||||||
|
|
Loading…
Reference in a new issue