Bug 950312 - Part 5: Implement SCREEN and MULTIPLY for CompositorOGL. r=mtseng

This commit is contained in:
Matt Woodrow
2014-05-09 22:06:18 +12:00
parent 0176b048cd
commit d626ae69d5
4 changed files with 88 additions and 18 deletions

View File

@@ -130,6 +130,12 @@ ShaderConfigOGL::SetMask3D(bool aEnabled)
SetFeature(ENABLE_MASK_3D, aEnabled);
}
void
ShaderConfigOGL::SetPremultiply(bool aEnabled)
{
SetFeature(ENABLE_PREMULTIPLY, aEnabled);
}
/* static */ ProgramProfileOGL
ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig)
{
@@ -323,6 +329,9 @@ ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig)
if (aConfig.mFeatures & ENABLE_OPACITY) {
fs << " color *= uLayerOpacity;" << endl;
}
if (aConfig.mFeatures & ENABLE_PREMULTIPLY) {
fs << " color.rgb *= color.a;" << endl;
}
}
if (aConfig.mFeatures & ENABLE_MASK_3D) {
fs << " vec2 maskCoords = vMaskCoord.xy / vMaskCoord.z;" << endl;