/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
0.0f,1.0f,
0.5f,1.0f,
1.0f,1.0f};
+
// clang-format on
Vector2 result(&pointToVector2[point * 2]);
mTransform(),
mMixColor(Color::WHITE),
mControlSize(Vector2::ZERO),
+ mBorderlineWidth(0.0f),
+ mBorderlineColor(Color::BLACK),
+ mBorderlineOffset(0.0f),
mCornerRadius(Vector4::ZERO),
mCornerRadiusPolicy(1.0f),
mDepthIndex(0.0f),
- mMixColorIndex(Property::INVALID_INDEX),
+ mBorderlineWidthIndex(Property::INVALID_INDEX),
+ mBorderlineColorIndex(Property::INVALID_INDEX),
+ mBorderlineOffsetIndex(Property::INVALID_INDEX),
mCornerRadiusIndex(Property::INVALID_INDEX),
mFittingMode(fittingMode),
mFlags(0),
mResourceStatus(Toolkit::Visual::ResourceStatus::PREPARING),
mType(type),
- mNeedCornerRadius(false)
+ mAlwaysUsingBorderline(false),
+ mAlwaysUsingCornerRadius(false)
{
}
mExtraSize(0.0f, 0.0f),
mOffsetSizeMode(0.0f, 0.0f, 0.0f, 0.0f),
mOrigin(Toolkit::Align::TOP_BEGIN),
- mAnchorPoint(Toolkit::Align::TOP_BEGIN),
- mOffsetIndex(Property::INVALID_INDEX),
- mSizeIndex(Property::INVALID_INDEX)
+ mAnchorPoint(Toolkit::Align::TOP_BEGIN)
{
}
for(Property::Map::SizeType i(0); i < map.Count(); ++i)
{
KeyValuePair keyValue = map.GetKeyValue(i);
- if(keyValue.first.type == Property::Key::INDEX)
- {
- switch(keyValue.first.indexKey)
- {
- case Toolkit::Visual::Transform::Property::OFFSET:
- {
- keyValue.second.Get(mOffset);
- break;
- }
- case Toolkit::Visual::Transform::Property::SIZE:
- {
- keyValue.second.Get(mSize);
- break;
- }
- case Toolkit::Visual::Transform::Property::ORIGIN:
- {
- Scripting::GetEnumerationProperty<Toolkit::Align::Type>(keyValue.second, ALIGN_TABLE, ALIGN_TABLE_COUNT, mOrigin);
- break;
- }
- case Toolkit::Visual::Transform::Property::ANCHOR_POINT:
- {
- Scripting::GetEnumerationProperty<Toolkit::Align::Type>(keyValue.second, ALIGN_TABLE, ALIGN_TABLE_COUNT, mAnchorPoint);
- break;
- }
- case Toolkit::Visual::Transform::Property::OFFSET_POLICY:
- {
- Vector2 policy;
- if(GetPolicyFromValue(keyValue.second, policy))
- {
- mOffsetSizeMode.x = policy.x;
- mOffsetSizeMode.y = policy.y;
- }
- break;
- }
- case Toolkit::Visual::Transform::Property::SIZE_POLICY:
- {
- Vector2 policy;
- if(GetPolicyFromValue(keyValue.second, policy))
- {
- mOffsetSizeMode.z = policy.x;
- mOffsetSizeMode.w = policy.y;
- }
- break;
- }
- case Toolkit::DevelVisual::Transform::Property::EXTRA_SIZE:
- {
- keyValue.second.Get(mExtraSize);
- break;
- }
- }
- }
- else // Key type is STRING
+ switch(Visual::Base::GetIntKey(keyValue.first))
{
- if(keyValue.first == "offset")
+ case Toolkit::Visual::Transform::Property::OFFSET:
{
keyValue.second.Get(mOffset);
+ break;
}
- else if(keyValue.first == "size")
+ case Toolkit::Visual::Transform::Property::SIZE:
{
keyValue.second.Get(mSize);
+ break;
}
- else if(keyValue.first == "origin")
+ case Toolkit::Visual::Transform::Property::ORIGIN:
{
Scripting::GetEnumerationProperty<Toolkit::Align::Type>(keyValue.second, ALIGN_TABLE, ALIGN_TABLE_COUNT, mOrigin);
+ break;
}
- else if(keyValue.first == "anchorPoint")
+ case Toolkit::Visual::Transform::Property::ANCHOR_POINT:
{
Scripting::GetEnumerationProperty<Toolkit::Align::Type>(keyValue.second, ALIGN_TABLE, ALIGN_TABLE_COUNT, mAnchorPoint);
+ break;
}
- else if(keyValue.first == "offsetPolicy")
+ case Toolkit::Visual::Transform::Property::OFFSET_POLICY:
{
Vector2 policy;
if(GetPolicyFromValue(keyValue.second, policy))
mOffsetSizeMode.x = policy.x;
mOffsetSizeMode.y = policy.y;
}
+ break;
}
- else if(keyValue.first == "sizePolicy")
+ case Toolkit::Visual::Transform::Property::SIZE_POLICY:
{
Vector2 policy;
if(GetPolicyFromValue(keyValue.second, policy))
mOffsetSizeMode.z = policy.x;
mOffsetSizeMode.w = policy.y;
}
+ break;
}
- else if(keyValue.first == "extraSize")
+ case Toolkit::DevelVisual::Transform::Property::EXTRA_SIZE:
{
keyValue.second.Get(mExtraSize);
+ break;
}
}
}
void Internal::Visual::Base::Impl::Transform::GetPropertyMap(Property::Map& map) const
{
map.Clear();
- map.Add(Toolkit::Visual::Transform::Property::OFFSET, mOffset)
+ map
+ .Add(Toolkit::Visual::Transform::Property::OFFSET, mOffset)
.Add(Toolkit::Visual::Transform::Property::SIZE, mSize)
.Add(Toolkit::Visual::Transform::Property::ORIGIN, mOrigin)
.Add(Toolkit::Visual::Transform::Property::ANCHOR_POINT, mAnchorPoint)
.Add(Toolkit::DevelVisual::Transform::Property::EXTRA_SIZE, mExtraSize);
}
-void Internal::Visual::Base::Impl::Transform::RegisterUniforms(Dali::Renderer renderer, Toolkit::Direction::Type direction)
+void Internal::Visual::Base::Impl::Transform::SetUniforms(Dali::VisualRenderer renderer, Toolkit::Direction::Type direction)
{
- mSizeIndex = renderer.RegisterProperty(SIZE, mSize);
- mOffsetIndex = renderer.RegisterProperty(OFFSET, direction == Toolkit::Direction::LEFT_TO_RIGHT ? mOffset : mOffset * Vector2(-1.0f, 1.0f));
- renderer.RegisterProperty(OFFSET_SIZE_MODE, mOffsetSizeMode);
- renderer.RegisterProperty(ORIGIN, PointToVector2(mOrigin, direction) - Vector2(0.5, 0.5));
- renderer.RegisterProperty(ANCHOR_POINT, Vector2(0.5, 0.5) - PointToVector2(mAnchorPoint, direction));
- renderer.RegisterProperty(EXTRA_SIZE, mExtraSize);
+ renderer.SetProperty(VisualRenderer::Property::TRANSFORM_SIZE, mSize);
+ renderer.SetProperty(VisualRenderer::Property::TRANSFORM_OFFSET,
+ direction == Toolkit::Direction::LEFT_TO_RIGHT ? mOffset : mOffset * Vector2(-1.0f, 1.0f));
+ renderer.SetProperty(VisualRenderer::Property::TRANSFORM_OFFSET_SIZE_MODE, mOffsetSizeMode);
+ renderer.SetProperty(VisualRenderer::Property::TRANSFORM_ORIGIN, PointToVector2(mOrigin, direction) - Vector2(0.5, 0.5));
+ renderer.SetProperty(VisualRenderer::Property::TRANSFORM_ANCHOR_POINT,
+ Vector2(0.5, 0.5) - PointToVector2(mAnchorPoint, direction));
+ renderer.SetProperty(VisualRenderer::Property::EXTRA_SIZE, mExtraSize);
}
Vector2 Internal::Visual::Base::Impl::Transform::GetVisualSize(const Vector2& controlSize)