+ 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->mDecorationData != nullptr || !Dali::EqualsZero(width)))
+ {
+ mImpl->SetBorderlineWidth(width);
+ }
+
+ if(DALI_UNLIKELY(mImpl->mRenderer && IsTypeAvailableForBorderline(mImpl->mType)))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBorderlineUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH, mImpl->GetBorderlineWidth());
+
+ // Check whether we must update shader.
+ if(!mImpl->mAlwaysUsingBorderline && IsBorderlineRequired())
+ {
+ // Required to change shader mean, we didn't setup BORDERLINE_COLOR and BORDERLINE_OFFSET into mRenderer before. Set property now.
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->GetBorderlineColor());
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->GetBorderlineOffset());
+
+ // 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
+ if(!mImpl->mCustomShader)
+ {
+ needUpdateShader = true;
+ }
+ }
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::BORDERLINE_COLOR:
+ {
+ Vector4 color;
+ if(value.Get(color) && (mImpl->mDecorationData != nullptr || color != Vector4::ZERO))
+ {
+ mImpl->SetBorderlineColor(color);
+ }
+
+ if(DALI_UNLIKELY(mImpl->mRenderer && IsTypeAvailableForBorderline(mImpl->mType)))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->GetBorderlineColor());
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::BORDERLINE_OFFSET:
+ {
+ float offset;
+ if(value.Get(offset) && (mImpl->mDecorationData != nullptr || !Dali::EqualsZero(offset)))
+ {
+ mImpl->SetBorderlineOffset(offset);
+ }
+
+ if(DALI_UNLIKELY(mImpl->mRenderer && IsTypeAvailableForBorderline(mImpl->mType)))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->GetBorderlineOffset());
+ }
+ 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->mDecorationData != nullptr || radius != Vector4::ZERO))
+ {
+ mImpl->SetCornerRadius(radius);
+ }
+ }
+ else
+ {
+ // If CORNER_RADIUS Property is float,
+ // Every corner radius have same value
+ float radius;
+ if(value.Get(radius) && (mImpl->mDecorationData != nullptr || !Dali::EqualsZero(radius)))
+ {
+ mImpl->SetCornerRadius(Vector4(radius, radius, radius, radius));
+ }
+ }
+
+ if(DALI_UNLIKELY(mImpl->mRenderer && IsTypeAvailableForCornerRadius(mImpl->mType)))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterCornerRadiusUniform();
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS, mImpl->GetCornerRadius());
+
+ // Check whether we must update shader.
+ if(!mImpl->mAlwaysUsingCornerRadius && IsRoundedCornerRequired())
+ {
+ // Required to change shader mean, we didn't setup CORNER_RADIUS_POLICY into mRenderer before. Set property now.
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, static_cast<float>(mImpl->GetCornerRadiusPolicy()));
+
+ // 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
+ if(!mImpl->mCustomShader)
+ {
+ 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->SetCornerRadiusPolicy(policy);
+ if(DALI_UNLIKELY(mImpl->mRenderer))
+ {
+ // Unusual case. SetProperty called after OnInitialize().
+ // Assume that DoAction call UPDATE_PROPERTY.
+ mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, static_cast<float>(mImpl->GetCornerRadiusPolicy()));
+ }
+ break;
+ }
+ default:
+ {
+ DALI_LOG_ERROR("Unsupported policy: %d\n", policy);
+ break;
+ }
+ }
+ }