{
// Check alpha of overlapped pixels
uint8_t& currentAlpha = *( bitmapBuffer + verticalOffset + xOffsetIndex );
- uint8_t newAlpha = static_cast<uint8_t>( color->a * static_cast<float>( alpha ) );
+ uint8_t newAlpha = static_cast<uint8_t>( static_cast<float>( alpha ) );
// For any pixel overlapped with the pixel in previous glyphs, make sure we don't
// overwrite a previous bigger alpha with a smaller alpha (in order to avoid
discard;\n
\n
mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
- textTexture.rgb *= mix( 1.0, textTexture.a, preMultipliedAlpha );\n
\n
gl_FragColor = textTexture * uColor * visualMixColor();
}\n
return result;
}
+void TextColorConstraint( Vector4& current, const PropertyInputContainer& inputs )
+{
+ Vector4 color = inputs[0]->GetVector4();
+ current.r = color.r * color.a;
+ current.g = color.g * color.a;
+ current.b = color.b * color.a;
+ current.a = color.a;
+}
+
} // unnamed namespace
TextVisualPtr TextVisual::New( VisualFactoryCache& factoryCache, const Property::Map& properties )
// Create constraint for the animatable text's color Property with uTextColorAnimatable in the renderer.
if( shaderTextColorIndex != Property::INVALID_INDEX )
{
- Constraint constraint = Constraint::New<Vector4>( mImpl->mRenderer, shaderTextColorIndex, EqualToConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( mImpl->mRenderer, shaderTextColorIndex, TextColorConstraint );
constraint.AddSource( Source( actor, mAnimatableTextColorPropertyIndex ) );
constraint.Apply();
}