[effects] Use shader traits api in screenedge effect

This commit is contained in:
Martin Gräßlin 2015-11-27 10:43:40 +01:00
parent 700adad9b1
commit 8d9321ca4c

View file

@ -98,9 +98,12 @@ void ScreenEdgeEffect::paintScreen(int mask, QRegion region, ScreenPaintData &da
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
texture->bind(); texture->bind();
ShaderBinder binder(ShaderManager::SimpleShader); ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::Modulate);
const QVector4D constant(opacity, opacity, opacity, opacity); const QVector4D constant(opacity, opacity, opacity, opacity);
binder.shader()->setUniform(GLShader::ModulationConstant, constant); binder.shader()->setUniform(GLShader::ModulationConstant, constant);
QMatrix4x4 mvp = data.projectionMatrix();
mvp.translate((*it)->geometry.x(), (*it)->geometry.y());
binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, mvp);
texture->render(infiniteRegion(), (*it)->geometry); texture->render(infiniteRegion(), (*it)->geometry);
texture->unbind(); texture->unbind();
glDisable(GL_BLEND); glDisable(GL_BLEND);