From 2de0b527d00146e6083ef2ccc8a14792e6f36b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 26 Nov 2015 16:25:00 +0100 Subject: [PATCH] [effects] Use shader traits in ShowPaint effect --- effects/showpaint/showpaint.cpp | 7 ++++--- effects/showpaint/showpaint.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/effects/showpaint/showpaint.cpp b/effects/showpaint/showpaint.cpp index 455b974ca2..bfdda7f651 100644 --- a/effects/showpaint/showpaint.cpp +++ b/effects/showpaint/showpaint.cpp @@ -54,7 +54,7 @@ void ShowPaintEffect::paintScreen(int mask, QRegion region, ScreenPaintData& dat painted = QRegion(); effects->paintScreen(mask, region, data); if (effects->isOpenGLCompositing()) - paintGL(); + paintGL(data.projectionMatrix()); #ifdef KWIN_HAVE_XRENDER_COMPOSITING if (effects->compositingType() == XRenderCompositing) paintXrender(); @@ -72,12 +72,13 @@ void ShowPaintEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Win effects->paintWindow(w, mask, region, data); } -void ShowPaintEffect::paintGL() +void ShowPaintEffect::paintGL(const QMatrix4x4 &projection) { GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); vbo->reset(); vbo->setUseColor(true); - ShaderBinder binder(ShaderManager::ColorShader); + ShaderBinder binder(ShaderTrait::UniformColor); + binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, projection); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); QColor color = colors[ color_index ]; diff --git a/effects/showpaint/showpaint.h b/effects/showpaint/showpaint.h index 7765f5fc52..9952fd300e 100644 --- a/effects/showpaint/showpaint.h +++ b/effects/showpaint/showpaint.h @@ -35,7 +35,7 @@ public: virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); private: - void paintGL(); + void paintGL(const QMatrix4x4 &projection); void paintXrender(); void paintQPainter(); QRegion painted; // what's painted in one pass