{
namespace
{
-const int CUSTOM_PROPERTY_COUNT(12); // 5 transform properties + Blur Radius + Mix Color + border/corner
+const int CUSTOM_PROPERTY_COUNT(6); // Blur Radius + border/corner
VisualFactoryCache::ShaderType SHADER_TYPE_TABLE[6] =
{
// We must regist properies into renderer, and update shader.
// BlurRadius added by this action. Regist property to renderer.
- mBlurRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
+ mBlurRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
// Change the shader must not be occured many times. we always have to use blur feature.
// Do nothing
}
+void ColorVisual::EnablePreMultipliedAlpha(bool preMultiplied)
+{
+ // Make always disable pre multiplied alpha whether preMultiplied value is true.
+ if(preMultiplied)
+ {
+ DALI_LOG_WARNING("Note : ColorVisual cannot enable PreMultipliedAlpha\n");
+ }
+}
+
void ColorVisual::OnSetTransform()
{
if(mImpl->mRenderer)
{
- mImpl->mTransform.RegisterUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
+ mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
}
}
Shader shader = GenerateShader();
- mImpl->mRenderer = Renderer::New(geometry, shader);
+ mImpl->mRenderer = VisualRenderer::New(geometry, shader);
mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
- // ColorVisual has it's own index key for mix color - use this instead
- // of using the new base index to avoid changing existing applications
- // String keys will get to this property.
- mImpl->mMixColorIndex = mImpl->mRenderer.RegisterProperty(Toolkit::ColorVisual::Property::MIX_COLOR, MIX_COLOR, Vector3(mImpl->mMixColor));
+ mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_MIX_COLOR, Vector3(mImpl->mMixColor));
if(!EqualsZero(mBlurRadius))
{
- mBlurRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
+ mBlurRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
}
// Register transform properties
- mImpl->mTransform.RegisterUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
+ mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
}
Shader ColorVisual::GenerateShader() const