+ SetMixColor(mImpl->mMixColor);
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE:
+ {
+ Scripting::GetEnumerationProperty<Visual::FittingMode>(
+ value, VISUAL_FITTING_MODE_TABLE, VISUAL_FITTING_MODE_TABLE_COUNT, mImpl->mFittingMode);
+ break;
+ }
+ case Toolkit::DevelVisual::Property::BORDERLINE_WIDTH:
+ {
+ float width;
+ if(value.Get(width))
+ {
+ mImpl->mBorderlineWidth = width;
+ }
+
+ if(mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
+ {
+ mImpl->mRenderer.SetProperty(mImpl->mBorderlineWidthIndex, mImpl->mBorderlineWidth);
+ }
+ else if(DALI_UNLIKELY(mImpl->mRenderer && IsBorderlineRequired()))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ // We must regist properies into renderer, and update shader.
+
+ // Borderline added by this action. Register property to renderer.
+ mImpl->mBorderlineWidthIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
+ mImpl->mBorderlineColorIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
+ mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
+
+ // Make Blend mode ON_WITHOUT_CULL for transparent mix color.
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
+
+ // Change the shader must not be occured many times. we always have to use borderline feature.
+ mImpl->mAlwaysUsingBorderline = true;
+
+ // Change shader
+ needUpdateShader = true;
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::BORDERLINE_COLOR:
+ {
+ Vector4 color;
+ if(value.Get(color))
+ {
+ mImpl->mBorderlineColor = color;
+ }
+
+ if(mImpl->mBorderlineColorIndex != Property::INVALID_INDEX)
+ {
+ mImpl->mRenderer.SetProperty(mImpl->mBorderlineColorIndex, mImpl->mBorderlineColor);
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::BORDERLINE_OFFSET:
+ {
+ float offset;
+ if(value.Get(offset))
+ {
+ mImpl->mBorderlineOffset = offset;
+ }
+
+ if(mImpl->mBorderlineOffsetIndex != Property::INVALID_INDEX)
+ {
+ mImpl->mRenderer.SetProperty(mImpl->mBorderlineOffsetIndex, mImpl->mBorderlineOffset);
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::CORNER_RADIUS:
+ {
+ if(value.GetType() == Property::VECTOR4)
+ {
+ // If CORNER_RADIUS Property is Vector4,
+ // Each values mean the radius of
+ // (top-left, top-right, bottom-right, bottom-left)
+ Vector4 radius;
+ if(value.Get(radius))
+ {
+ mImpl->mCornerRadius = radius;
+ }
+ }
+ else
+ {
+ // If CORNER_RADIUS Property is float,
+ // Every corner radius have same value
+ float radius;
+ if(value.Get(radius))
+ {
+ mImpl->mCornerRadius = Vector4(radius, radius, radius, radius);
+ }
+ }
+
+ if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
+ {
+ mImpl->mRenderer.SetProperty(mImpl->mCornerRadiusIndex, mImpl->mCornerRadius);
+ }
+ else if(DALI_UNLIKELY(mImpl->mRenderer && IsRoundedCornerRequired()))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ // We must regist properies into renderer, and update shader.
+
+ // CornerRadius added by this action. Regist property to renderer.
+ mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
+ mImpl->mRenderer.RegisterUniqueProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
+
+ // Change the shader must not be occured many times. we always have to use corner radius feature.
+ mImpl->mAlwaysUsingCornerRadius = true;
+
+ if(!IsBorderlineRequired())
+ {
+ // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ }
+
+ // Change shader
+ needUpdateShader = true;
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY:
+ {
+ int policy;
+ if(value.Get(policy))
+ {
+ switch(policy)
+ {
+ case Toolkit::Visual::Transform::Policy::RELATIVE:
+ case Toolkit::Visual::Transform::Policy::ABSOLUTE:
+ {
+ mImpl->mCornerRadiusPolicy = policy;
+ if(DALI_UNLIKELY(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ // We must update properies result into renderer
+ // Note : mImpl->mCornerRadiusIndex is not INVALID_INDEX.
+ // So CornerRadiusPolicy property is already registed.
+ mImpl->mRenderer.SetProperty(mImpl->mRenderer.GetPropertyIndex(CORNER_RADIUS_POLICY), mImpl->mCornerRadiusPolicy);
+ }
+ break;
+ }
+ default:
+ {
+ DALI_LOG_ERROR("Unsupported policy: %d\n", policy);
+ break;
+ }
+ }