From 6aa19b15877ad53c8243868ed342dad07b09055e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 26 Nov 2015 16:41:07 +0100 Subject: [PATCH] [effects] Use shader traits in SnapHelper effect To simplify rendering is moved from postPaintScreen to paintScreen. --- effects/snaphelper/snaphelper.cpp | 7 ++++--- effects/snaphelper/snaphelper.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/effects/snaphelper/snaphelper.cpp b/effects/snaphelper/snaphelper.cpp index 56871ef5a9..6a22c20284 100644 --- a/effects/snaphelper/snaphelper.cpp +++ b/effects/snaphelper/snaphelper.cpp @@ -63,16 +63,17 @@ void SnapHelperEffect::prePaintScreen(ScreenPrePaintData &data, int time) effects->prePaintScreen(data, time); } -void SnapHelperEffect::postPaintScreen() +void SnapHelperEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) { - effects->postPaintScreen(); + effects->paintScreen(mask, region, data); if (m_timeline.currentValue() != 0.0) { // Display the guide if (effects->isOpenGLCompositing()) { GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); vbo->reset(); vbo->setUseColor(true); - ShaderBinder binder(ShaderManager::ColorShader); + ShaderBinder binder(ShaderTrait::UniformColor); + binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, data.projectionMatrix()); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/effects/snaphelper/snaphelper.h b/effects/snaphelper/snaphelper.h index 206abae333..de3096fc5d 100644 --- a/effects/snaphelper/snaphelper.h +++ b/effects/snaphelper/snaphelper.h @@ -38,7 +38,7 @@ public: virtual void reconfigure(ReconfigureFlags); virtual void prePaintScreen(ScreenPrePaintData &data, int time); - virtual void postPaintScreen(); + void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; virtual bool isActive() const; public Q_SLOTS: