Remove forceAlpha uniform, which is no longer needed

This was originally added by d467fc1bdbcf69bd6ef213bd909633c2edfb6878,
to prevent alpha ending up to be 0 with blending disabled. Apparently,
that was a driver issue that is no longer present.

REVIEW: 107090
This commit is contained in:
Casian Andrei 2012-10-28 12:34:02 +02:00
parent a46d247702
commit 22569f7eb9
7 changed files with 1 additions and 17 deletions

View file

@ -387,7 +387,6 @@ void LogoutEffect::renderBlurTexture()
m_blurShader->setUniform(GLShader::Offset, QVector2D(0, 0));
m_blurShader->setUniform(GLShader::ModulationConstant, QVector4D(1.0, 1.0, 1.0, 1.0));
m_blurShader->setUniform(GLShader::Saturation, 1.0);
m_blurShader->setUniform(GLShader::AlphaToOne, 1);
m_blurShader->setUniform("u_alphaProgress", (float)progress * 0.4f);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

View file

@ -143,7 +143,6 @@ void TrackMouseEffect::paintScreen(int mask, QRegion region, ScreenPaintData& da
shader->setUniform(GLShader::ModelViewMatrix, matrix);
shader->setUniform(GLShader::Saturation, 1.0);
shader->setUniform(GLShader::ModulationConstant, QVector4D(1.0, 1.0, 1.0, 1.0));
shader->setUniform(GLShader::AlphaToOne, 0);
} else
pushMatrix(matrix);
m_texture[i]->bind();

View file

@ -215,7 +215,6 @@ void LanczosFilter::performPaint(EffectWindowImpl* w, int mask, QRegion region,
shader->setUniform(GLShader::Offset, QVector2D(0, 0));
shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a));
shader->setUniform(GLShader::Saturation, data.saturation());
shader->setUniform(GLShader::AlphaToOne, 0);
cachedTexture->render(region, textureRect, hardwareClipping);
@ -352,7 +351,6 @@ void LanczosFilter::performPaint(EffectWindowImpl* w, int mask, QRegion region,
shader->setUniform(GLShader::Offset, QVector2D(0, 0));
shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a));
shader->setUniform(GLShader::Saturation, data.saturation());
shader->setUniform(GLShader::AlphaToOne, 0);
cache->render(region, textureRect, hardwareClipping);

View file

@ -430,8 +430,6 @@ void GLShader::resolveLocations()
mFloatLocation[Saturation] = uniformLocation("saturation");
mIntLocation[AlphaToOne] = uniformLocation("u_forceAlpha");
mLocationsResolved = true;
}
@ -895,7 +893,6 @@ void ShaderManager::resetShader(ShaderType type)
shader->setUniform(GLShader::ModulationConstant, QVector4D(1.0, 1.0, 1.0, 1.0));
shader->setUniform(GLShader::Saturation, 1.0f);
shader->setUniform(GLShader::AlphaToOne, 0);
}
/*** GLRenderTarget ***/

View file

@ -190,7 +190,7 @@ public:
};
enum IntUniform {
AlphaToOne,
AlphaToOne, ///< @deprecated no longer used
IntUniformCount
};
@ -247,9 +247,6 @@ public:
* normalized texture coordinates. Defaults to @c (1.0/1.0). And expects a @c vec3
* uniform @c colorManiuplation, with @c x being opacity, @c y being brightness and
* @c z being saturation. All three values default to @c 1.0.
* The fragment shader takes a uniform @c u_forceAlpha to force the alpha component
* to @c 1.0 if it is set to a value not @c 0. This uniform is useful when rendering
* a RGB-only window and the alpha channel is required in a later step.
* The sampler uniform is @c sample and defaults to @c 0.
* The shader uses two vertex attributes @c vertex and @c texCoord.
**/

View file

@ -1,7 +1,6 @@
uniform sampler2D sampler;
uniform vec4 modulation;
uniform float saturation;
uniform int u_forceAlpha;
varying vec2 varyingTexCoords;
@ -10,8 +9,6 @@ varying vec2 varyingTexCoords;
void main() {
vec4 tex = texture2D(sampler, varyingTexCoords);
tex.a += float(u_forceAlpha);
if (saturation != 1.0) {
tex.rgb = mix(vec3(dot( vec3( 0.30, 0.59, 0.11 ), tex.rgb )), tex.rgb, saturation);
}

View file

@ -1256,7 +1256,6 @@ void SceneOpenGL2Window::prepareStates(TextureType type, qreal opacity, qreal br
GLShader *shader = ShaderManager::instance()->getBoundShader();
shader->setUniform(GLShader::ModulationConstant, QVector4D(rgb, rgb, rgb, a));
shader->setUniform(GLShader::Saturation, saturation);
shader->setUniform(GLShader::AlphaToOne, opaque ? 1 : 0);
}
void SceneOpenGL2Window::restoreStates(TextureType type, qreal opacity, qreal brightness, qreal saturation)
@ -1269,7 +1268,6 @@ void SceneOpenGL2Window::restoreStates(TextureType type, qreal opacity, qreal br
if (m_blendingEnabled) {
glDisable(GL_BLEND);
}
ShaderManager::instance()->getBoundShader()->setUniform(GLShader::AlphaToOne, 0);
}
//***************************************
@ -1561,7 +1559,6 @@ void SceneOpenGL::EffectFrame::render(QRegion region, double opacity, double fra
shader->setUniform(GLShader::ModulationConstant, QVector4D(1.0, 1.0, 1.0, 1.0));
shader->setUniform(GLShader::Saturation, 1.0f);
shader->setUniform(GLShader::AlphaToOne, 0);
}
glEnable(GL_BLEND);