Use shader traits API to render cached texture in lanczos filter
This commit is contained in:
parent
2f5de22ac8
commit
99739106d1
1 changed files with 8 additions and 4 deletions
|
@ -213,9 +213,11 @@ void LanczosFilter::performPaint(EffectWindowImpl* w, int mask, QRegion region,
|
||||||
const qreal rgb = data.brightness() * data.opacity();
|
const qreal rgb = data.brightness() * data.opacity();
|
||||||
const qreal a = data.opacity();
|
const qreal a = data.opacity();
|
||||||
|
|
||||||
ShaderBinder binder(ShaderManager::SimpleShader);
|
ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::Modulate | ShaderTrait::AdjustSaturation);
|
||||||
GLShader *shader = binder.shader();
|
GLShader *shader = binder.shader();
|
||||||
shader->setUniform(GLShader::Offset, QVector2D(0, 0));
|
QMatrix4x4 mvp = data.screenProjectionMatrix();
|
||||||
|
mvp.translate(textureRect.x(), textureRect.y());
|
||||||
|
shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp);
|
||||||
shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a));
|
shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a));
|
||||||
shader->setUniform(GLShader::Saturation, data.saturation());
|
shader->setUniform(GLShader::Saturation, data.saturation());
|
||||||
|
|
||||||
|
@ -344,9 +346,11 @@ void LanczosFilter::performPaint(EffectWindowImpl* w, int mask, QRegion region,
|
||||||
const qreal rgb = data.brightness() * data.opacity();
|
const qreal rgb = data.brightness() * data.opacity();
|
||||||
const qreal a = data.opacity();
|
const qreal a = data.opacity();
|
||||||
|
|
||||||
ShaderBinder binder(ShaderManager::SimpleShader);
|
ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::Modulate | ShaderTrait::AdjustSaturation);
|
||||||
GLShader *shader = binder.shader();
|
GLShader *shader = binder.shader();
|
||||||
shader->setUniform(GLShader::Offset, QVector2D(0, 0));
|
QMatrix4x4 mvp = data.screenProjectionMatrix();
|
||||||
|
mvp.translate(textureRect.x(), textureRect.y());
|
||||||
|
shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp);
|
||||||
shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a));
|
shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a));
|
||||||
shader->setUniform(GLShader::Saturation, data.saturation());
|
shader->setUniform(GLShader::Saturation, data.saturation());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue