CWebRender pt2

This commit is contained in:
wuggy 2026-09-18 12:00:30 -07:00
commit fe181d242f
22 changed files with 1623 additions and 489 deletions

View file

@ -60,6 +60,7 @@ AddUniforms(ProgramProfileOGL& aProfile)
"uViewportSize",
"uVisibleCenter",
"uYuvColorMatrix",
"uTextureTint",
nullptr
};
@ -75,6 +76,12 @@ ShaderConfigOGL::SetRenderColor(bool aEnabled)
SetFeature(ENABLE_RENDER_COLOR, aEnabled);
}
void
ShaderConfigOGL::SetTextureTint(bool aEnabled)
{
SetFeature(ENABLE_TEXTURE_TINT, aEnabled);
}
void
ShaderConfigOGL::SetTextureTarget(GLenum aTarget)
{
@ -351,6 +358,9 @@ ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig)
if (aConfig.mFeatures & ENABLE_OPACITY) {
fs << "uniform COLOR_PRECISION float uLayerOpacity;" << endl;
}
if (aConfig.mFeatures & ENABLE_TEXTURE_TINT) {
fs << "uniform COLOR_PRECISION vec4 uTextureTint;" << endl;
}
}
if (BlendOpIsMixBlendMode(blendOp)) {
fs << "varying vec2 vBackdropCoord;" << endl;
@ -506,6 +516,9 @@ ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig)
if (aConfig.mFeatures & ENABLE_OPACITY) {
fs << " color *= uLayerOpacity;" << endl;
}
if (aConfig.mFeatures & ENABLE_TEXTURE_TINT) {
fs << " color *= uTextureTint;" << endl;
}
}
if (aConfig.mFeatures & ENABLE_DEAA) {
// Calculate the sub-pixel coverage of the pixel and modulate its opacity