[effects] Use shader traits in SnapHelper effect

To simplify rendering is moved from postPaintScreen to paintScreen.
This commit is contained in:
Martin Gräßlin 2015-11-26 16:41:07 +01:00
parent 2de0b527d0
commit 6aa19b1587
2 changed files with 5 additions and 4 deletions

View file

@ -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);

View file

@ -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: