From 84b73ab2b30b4ff2acac2ecd8c5314b7dd2b5bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 1 Dec 2015 13:35:26 +0100 Subject: [PATCH] Drop remaining old shader API usage from SceneOpenGL No effect uses old API, so we don't need to setup the old shaders any more. --- scene_opengl.cpp | 31 ------------------------------- scene_opengl.h | 1 - 2 files changed, 32 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index ca0fbbffe9..55dd6ae002 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1112,24 +1112,9 @@ void SceneOpenGL2::paintGenericScreen(int mask, ScreenPaintData data) m_screenProjectionMatrix = m_projectionMatrix * screenMatrix; - // ### Remove the following two lines when there are no more users of the old shader API - ShaderBinder binder(ShaderManager::GenericShader); - binder.shader()->setUniform(GLShader::ScreenTransformation, screenMatrix); - Scene::paintGenericScreen(mask, data); } -void SceneOpenGL2::paintDesktop(int desktop, int mask, const QRegion ®ion, ScreenPaintData &data) -{ - ShaderBinder binder(ShaderManager::GenericShader); - GLShader *shader = binder.shader(); - QMatrix4x4 screenTransformation = shader->getUniformMatrix4x4("screenTransformation"); - - KWin::SceneOpenGL::paintDesktop(desktop, mask, region, data); - - shader->setUniform(GLShader::ScreenTransformation, screenTransformation); -} - void SceneOpenGL2::doPaintBackground(const QVector< float >& vertices) { GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); @@ -1556,8 +1541,6 @@ void SceneOpenGL2Window::performPaint(int mask, QRegion region, WindowPaintData cc->setupForOutput(data.screen()); } - // ### Remove the following line when there are no more users of the old shader API - shader->setUniform(GLShader::WindowTransformation, windowMatrix); shader->setUniform(GLShader::Saturation, data.saturation()); const GLenum filter = (mask & (Effect::PAINT_WINDOW_TRANSFORMED | Effect::PAINT_SCREEN_TRANSFORMED)) @@ -1811,10 +1794,8 @@ void SceneOpenGL::EffectFrame::render(QRegion region, double opacity, double fra region = infiniteRegion(); // TODO: Old region doesn't seem to work with OpenGL GLShader* shader = m_effectFrame->shader(); - bool sceneShader = false; if (!shader) { shader = ShaderManager::instance()->pushShader(ShaderTrait::MapTexture | ShaderTrait::Modulate); - sceneShader = true; } else if (shader) { ShaderManager::instance()->pushShader(shader); } @@ -1943,24 +1924,12 @@ void SceneOpenGL::EffectFrame::render(QRegion region, double opacity, double fra m_unstyledTexture->bind(); const QPoint pt = m_effectFrame->geometry().topLeft(); - if (!sceneShader) { - QMatrix4x4 translation; - translation.translate(pt.x(), pt.y()); - if (shader) { - shader->setUniform(GLShader::WindowTransformation, translation); - } - } QMatrix4x4 mvp(projection); mvp.translate(pt.x(), pt.y()); shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp); m_unstyledVBO->render(region, GL_TRIANGLES); - if (!sceneShader) { - if (shader) { - shader->setUniform(GLShader::WindowTransformation, QMatrix4x4()); - } - } m_unstyledTexture->unbind(); } else if (m_effectFrame->style() == EffectFrameStyled) { if (!m_texture) // Lazy creation diff --git a/scene_opengl.h b/scene_opengl.h index 7ba625c1b6..c53ea252c1 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -137,7 +137,6 @@ protected: virtual void doPaintBackground(const QVector< float >& vertices); virtual Scene::Window *createWindow(Toplevel *t); virtual void finalDrawWindow(EffectWindowImpl* w, int mask, QRegion region, WindowPaintData& data); - virtual void paintDesktop(int desktop, int mask, const QRegion ®ion, ScreenPaintData &data); virtual void updateProjectionMatrix() override; private Q_SLOTS: