If the size of TextLabel is bigger than uint16 max value,
there is a problem that assert occurs in Texture::New.
We can avoid the assert by setting the VisualTransform size to uint16 max,
but this also doesn't guaranteed rendering behavior.
To guaranteed the behavior, VisualTransform size is limitted to maxTextureSize.
Change-Id: I68523c89aecc71a9158e59948bca037d5c73c95a
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
// Check if the number of renderers is greater than 1.
DALI_TEST_CHECK(label.GetRendererCount() > 1u);
// Check if the number of renderers is greater than 1.
DALI_TEST_CHECK(label.GetRendererCount() > 1u);
+ // Coverage test for case of layoutSize is bigger than maxTextureSize
+ float max_value = static_cast<float>(std::numeric_limits<uint16_t>::max());
+ label.SetProperty(Actor::Property::SIZE, Vector2(max_value, 30.0f));
+ application.SendNotification();
+ application.Render();
+
+
alignmentOffset.x = 0.0f;
alignmentOffset.y = (contentSize.y - layoutSize.y) * VERTICAL_ALIGNMENT_TABLE[mController->GetVerticalAlignment()];
alignmentOffset.x = 0.0f;
alignmentOffset.y = (contentSize.y - layoutSize.y) * VERTICAL_ALIGNMENT_TABLE[mController->GetVerticalAlignment()];
+ const int maxTextureSize = Dali::GetMaxTextureSize();
+ if(layoutSize.width > maxTextureSize)
+ {
+ DALI_LOG_WARNING("layoutSize(%f) > maxTextureSize(%d): To guarantee the behavior of Texture::New, layoutSize must not be bigger than maxTextureSize\n", layoutSize.width, maxTextureSize);
+ layoutSize.width = maxTextureSize;
+ }
+
Property::Map visualTransform;
visualTransform.Add(Toolkit::Visual::Transform::Property::SIZE, layoutSize)
.Add(Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE))
Property::Map visualTransform;
visualTransform.Add(Toolkit::Visual::Transform::Property::SIZE, layoutSize)
.Add(Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE))