END_TEST;
}
+int UtcDaliControlOffScreenRenderingSizeSet(void)
+{
+ ToolkitTestApplication application;
+
+ Control control = Control::New();
+ control.SetProperty(Actor::Property::SIZE, Vector2::ZERO);
+ application.GetScene().Add(control);
+
+ control.SetBackgroundColor(Color::RED);
+ control.SetProperty(DevelControl::Property::OFFSCREEN_RENDERING, DevelControl::OffScreenRenderingType::REFRESH_ALWAYS);
+ DALI_TEST_EQUALS(control.GetProperty(Actor::Property::SIZE).Get<Vector2>(), Vector2::ZERO, TEST_LOCATION);
+
+ control.SetProperty(Actor::Property::SIZE, Vector2::ZERO);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS(control.GetProperty(Actor::Property::SIZE).Get<Vector2>(), Vector2::ZERO, TEST_LOCATION);
+ tet_infoline("Size update: zero to zero");
+
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS(control.GetProperty(Actor::Property::SIZE).Get<Vector2>(), Vector2(100.0f, 100.0f), TEST_LOCATION);
+ tet_infoline("Size update: zero to a valid size");
+
+ control.SetProperty(Actor::Property::SIZE, Vector2(150.0f, 150.0f));
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS(control.GetProperty(Actor::Property::SIZE).Get<Vector2>(), Vector2(150.0f, 150.0f), TEST_LOCATION);
+ tet_infoline("Size update: size1 to size2");
+
+ control.SetProperty(Actor::Property::SIZE, Vector2::ZERO);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS(control.GetProperty(Actor::Property::SIZE).Get<Vector2>(), Vector2::ZERO, TEST_LOCATION);
+ tet_infoline("Size update: a valid size to zero");
+
+ END_TEST;
+}
+
int UtcDaliControlNewWithDisableVisuals(void)
{
ToolkitTestApplication application;
mPlacementSceneHolder = sceneHolder;
Vector2 size = GetTargetSize();
- if(size != Vector2::ZERO)
- {
- mCamera.SetPerspectiveProjection(size);
- ownerControl.Add(mCamera);
+ mCamera.SetPerspectiveProjection(size);
+ ownerControl.Add(mCamera);
- // Activate logic for subclass.
- OnActivate();
+ // Activate logic for subclass.
+ OnActivate();
- // Set round corner. Default is to sync to owner control's BACKGROUND.
- Vector4 cornerRadius = ownerControl.GetProperty<Vector4>(Toolkit::DevelControl::Property::CORNER_RADIUS);
- if(cornerRadius != Vector4::ZERO)
- {
- int32_t cornerRadiusPolicy = ownerControl.GetProperty<int32_t>(Toolkit::DevelControl::Property::CORNER_RADIUS_POLICY);
+ // Set round corner. Default is to sync to owner control's BACKGROUND.
+ Vector4 cornerRadius = ownerControl.GetProperty<Vector4>(Toolkit::DevelControl::Property::CORNER_RADIUS);
+ if(cornerRadius != Vector4::ZERO)
+ {
+ int32_t cornerRadiusPolicy = ownerControl.GetProperty<int32_t>(Toolkit::DevelControl::Property::CORNER_RADIUS_POLICY);
- Property::Map map;
- map[Toolkit::DevelVisual::Property::CORNER_RADIUS] = cornerRadius;
- map[Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY] = static_cast<Toolkit::Visual::Transform::Policy::Type>(cornerRadiusPolicy);
+ Property::Map map;
+ map[Toolkit::DevelVisual::Property::CORNER_RADIUS] = cornerRadius;
+ map[Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY] = static_cast<Toolkit::Visual::Transform::Policy::Type>(cornerRadiusPolicy);
- SetCornerConstants(map);
- }
+ SetCornerConstants(map);
}
}
}
// - All actors of owner control are visible
// - The SceneHolder is exist, and it is visible
// TODO : Currently we don't check SceneHolder's visibility.
+
bool ret = false;
- Dali::Toolkit::Control ownerControl = mOwnerControl.GetHandle();
- if(ownerControl && ownerControl.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
+ Vector2 size = GetTargetSize();
+ if(size.x > Math::MACHINE_EPSILON_1000 && size.y > Math::MACHINE_EPSILON_1000)
{
- Integration::SceneHolder sceneHolder = Integration::SceneHolder::Get(ownerControl);
- if(sceneHolder)
+ Dali::Toolkit::Control ownerControl = mOwnerControl.GetHandle();
+ if(ownerControl && ownerControl.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
{
- ret = true;
-
- // Check visibility of owner control's parents.
- // TODO : We'd better check the control visibility at core side.
- // TODO : Window visibility will be consider at dali-core actor side in future.
- Dali::Actor self = ownerControl;
- while(self)
+ Integration::SceneHolder sceneHolder = Integration::SceneHolder::Get(ownerControl);
+ if(sceneHolder)
{
- if(!self.GetProperty<bool>(Dali::Actor::Property::VISIBLE))
+ ret = true;
+
+ // Check visibility of owner control's parents.
+ // TODO : We'd better check the control visibility at core side.
+ // TODO : Window visibility will be consider at dali-core actor side in future.
+ Dali::Actor self = ownerControl;
+ while(self)
{
- ret = false;
- break;
+ if(!self.GetProperty<bool>(Dali::Actor::Property::VISIBLE))
+ {
+ ret = false;
+ break;
+ }
+ self = self.GetParent();
}
- self = self.GetParent();
}
}
- }
- DALI_LOG_INFO(gRenderEffectLogFilter, Debug::Concise, "[RenderEffect:%p] IsActivateValid? [ID:%d][ret:%d]\n", this, ownerControl ? ownerControl.GetProperty<int>(Actor::Property::ID) : -1, ret);
+ DALI_LOG_INFO(gRenderEffectLogFilter, Debug::Concise, "[RenderEffect:%p] IsActivateValid? [ID:%d][ret:%d]\n", this, ownerControl ? ownerControl.GetProperty<int>(Actor::Property::ID) : -1, ret);
+ }
return ret;
}
Dali::Toolkit::Control ownerControl = mOwnerControl.GetHandle();
if(ownerControl)
{
- const auto targetSize = ownerControl.GetCurrentProperty<Vector2>(Actor::Property::SIZE);
- if(mTargetSize != targetSize && IsActivated())
+ const Vector2 targetSize = mTargetSize;
+ UpdateTargetSize();
+ if(mTargetSize != targetSize)
{
- UpdateTargetSize();
- mCamera.SetPerspectiveProjection(GetTargetSize());
- OnRefresh();
+ if(IsActivateValid())
+ {
+ if(!IsActivated())
+ {
+ Activate();
+ }
+ else
+ {
+ mCamera.SetPerspectiveProjection(GetTargetSize());
+ OnRefresh();
+ }
+ }
+ else
+ {
+ Deactivate();
+ }
}
}
}