: ControlRenderer( factoryCache ),
mGradientType( LINEAR )
{
+ mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
}
GradientRenderer::~GradientRenderer()
for( unsigned int i=0; i<stops.Count(); i++ )
{
offsets.PushBack( stops[i].mOffset );
- colors.PushBack( stops[i].mStopColor );
+ if( EqualsZero(stops[i].mStopColor.a) )
+ {
+ colors.PushBack( Vector4::ZERO );
+ }
+ else
+ {
+ colors.PushBack( Vector4( stops[i].mStopColor.r / stops[i].mStopColor.a,
+ stops[i].mStopColor.g / stops[i].mStopColor.a,
+ stops[i].mStopColor.b / stops[i].mStopColor.a,
+ stops[i].mStopColor.a));
+ }
}
map.Insert( STOP_OFFSET_NAME, offsets );
{
if( (colorArray->GetElementAt(i)).Get(color) )
{
- mGradient->AddStop( offsetArray[i], color);
+ mGradient->AddStop( offsetArray[i], Vector4(color.r*color.a, color.g*color.a, color.b*color.a, color.a));
numValidStop++;
}
}