+
+int UtcDaliActorAllowOnlyOwnTouchPropertyP(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH).Get<bool>(), false, TEST_LOCATION);
+ actor.SetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH, true);
+ DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH).Get<bool>(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.GetPropertyType(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH), Property::BOOLEAN, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsPropertyWritable(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsPropertyAnimatable(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsPropertyAConstraintInput(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.GetPropertyName(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH), "allowOnlyOwnTouch", TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliActorAllowOnlyOwnTouchPropertyN(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+
+ // Make sure setting invalid types does not cause a crash
+ try
+ {
+ actor.SetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH, 1.0f);
+ actor.SetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH, Vector2::ONE);
+ actor.SetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH, Vector3::ONE);
+ actor.SetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH, Vector4::ONE);
+ actor.SetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH, Property::Map());
+ actor.SetProperty(DevelActor::Property::ALLOW_ONLY_OWN_TOUCH, Property::Array());
+ tet_result(TET_PASS);
+ }
+ catch(...)
+ {
+ tet_result(TET_FAIL);
+ }
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldTransform01(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor position inheritance produces right transform matrix");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(0.0f, 0.0f, 0.0f);
+ branchActor[Actor::Property::POSITION] = Vector3(100.0f, 100.0f, 0.0f);
+ leafActor[Actor::Property::POSITION] = Vector3(100.0f, 50.0f, 30.0f);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ // Set anchor point to the same value as parent origin
+ rootActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::TOP_LEFT;
+ branchActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::TOP_LEFT;
+ leafActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::TOP_LEFT;
+
+ rootActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ branchActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ leafActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix m = DevelActor::GetWorldTransform(leafActor);
+
+ Matrix actualMatrix = leafActor.GetCurrentProperty<Matrix>(Actor::Property::WORLD_MATRIX);
+ DALI_TEST_EQUALS(m, actualMatrix, 0.001f, TEST_LOCATION);
+
+ Vector3 worldPos;
+ Vector3 worldScale;
+ Quaternion worldRotation;
+ m.GetTransformComponents(worldPos, worldRotation, worldScale);
+ DALI_TEST_EQUALS(worldPos, Vector3(200.0f, 150.0f, 30.0f), 0.0001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldTransform02(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor position produces right transform matrix");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(0.0f, 0.0f, 0.0f);
+ branchActor[Actor::Property::POSITION] = Vector3(100.0f, 100.0f, 0.0f);
+ leafActor[Actor::Property::POSITION] = Vector3(100.0f, 50.0f, 30.0f);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ // Set anchor point to the same value as parent origin
+ rootActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ branchActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ leafActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ leafActor[Actor::Property::INHERIT_POSITION] = false;
+ leafActor[Actor::Property::INHERIT_ORIENTATION] = false;
+ leafActor[Actor::Property::INHERIT_SCALE] = false;
+
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix m = DevelActor::GetWorldTransform(leafActor);
+
+ Matrix actualMatrix = leafActor.GetCurrentProperty<Matrix>(Actor::Property::WORLD_MATRIX);
+ DALI_TEST_EQUALS(m, actualMatrix, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldTransform03(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor position produces right transform matrix");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(0.0f, 0.0f, 0.0f);
+ branchActor[Actor::Property::POSITION] = Vector3(100.0f, 100.0f, 0.0f);
+ leafActor[Actor::Property::POSITION] = Vector3(100.0f, 50.0f, 30.0f);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ // Set anchor point to the same value as parent origin
+ rootActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ branchActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ leafActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ leafActor[Actor::Property::INHERIT_POSITION] = true;
+ leafActor[Actor::Property::INHERIT_ORIENTATION] = false;
+ leafActor[Actor::Property::INHERIT_SCALE] = false;
+
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix m = DevelActor::GetWorldTransform(leafActor);
+
+ Matrix actualMatrix = leafActor.GetCurrentProperty<Matrix>(Actor::Property::WORLD_MATRIX);
+ DALI_TEST_EQUALS(m, actualMatrix, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldTransform04(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor inheritance scale/orientation produces right transform matrix");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ // Set anchor point to the same value as parent origin
+ rootActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::CENTER;
+ rootActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::CENTER;
+ branchActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ leafActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+
+ branchActor[Actor::Property::POSITION] = Vector3(100.0f, 100.0f, 0.0f);
+ leafActor[Actor::Property::POSITION] = Vector3(100.0f, 50.0f, 30.0f);
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix m = DevelActor::GetWorldTransform(leafActor);
+
+ Matrix actualMatrix = leafActor.GetCurrentProperty<Matrix>(Actor::Property::WORLD_MATRIX);
+ DALI_TEST_EQUALS(m, actualMatrix, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldTransform05(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor inheritance of scale produces right transform matrix");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ // Set anchor point to the same value as parent origin
+ rootActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::CENTER;
+ rootActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::CENTER;
+ branchActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ leafActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+
+ branchActor[Actor::Property::POSITION] = Vector3(100.0f, 100.0f, 0.0f);
+ leafActor[Actor::Property::POSITION] = Vector3(100.0f, 50.0f, 30.0f);
+
+ leafActor[Actor::Property::INHERIT_POSITION] = false;
+ leafActor[Actor::Property::INHERIT_ORIENTATION] = false;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix m = DevelActor::GetWorldTransform(leafActor);
+
+ Matrix actualMatrix = leafActor.GetCurrentProperty<Matrix>(Actor::Property::WORLD_MATRIX);
+ DALI_TEST_EQUALS(m, actualMatrix, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldTransform06(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor inheritance of scale produces right transform matrix");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ // Set anchor point to the same value as parent origin
+ rootActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::CENTER;
+ rootActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::CENTER;
+ branchActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+ leafActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+
+ branchActor[Actor::Property::POSITION] = Vector3(100.0f, 30.0f, -50.0f);
+ branchActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(45.0f), Vector3::XAXIS);
+ leafActor[Actor::Property::POSITION] = Vector3(100.0f, 50.0f, 30.0f);
+
+ leafActor[Actor::Property::INHERIT_POSITION] = false;
+ leafActor[Actor::Property::INHERIT_SCALE] = false;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix m = DevelActor::GetWorldTransform(leafActor);
+
+ Matrix actualMatrix = leafActor.GetCurrentProperty<Matrix>(Actor::Property::WORLD_MATRIX);
+ DALI_TEST_EQUALS(m, actualMatrix, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldTransform07(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor inheritance of scale produces right transform matrix");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ // Set anchor point to the same value as parent origin
+ rootActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::CENTER;
+ rootActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::CENTER;
+ branchActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT;
+
+ // This should be ignored.
+ leafActor[Actor::Property::PARENT_ORIGIN] = ParentOrigin::CENTER;
+ leafActor[Actor::Property::ANCHOR_POINT] = AnchorPoint::CENTER;
+
+ branchActor[Actor::Property::POSITION] = Vector3(100.0f, 30.0f, -50.0f);
+ branchActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(45.0f), Vector3::XAXIS);
+ leafActor[Actor::Property::POSITION] = Vector3(100.0f, 50.0f, 30.0f);
+
+ leafActor[Actor::Property::INHERIT_POSITION] = false;
+ leafActor[Actor::Property::INHERIT_SCALE] = false;
+ leafActor[Actor::Property::POSITION_USES_ANCHOR_POINT] = false;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+
+ Matrix m = DevelActor::GetWorldTransform(leafActor);
+
+ Matrix actualMatrix = leafActor.GetCurrentProperty<Matrix>(Actor::Property::WORLD_MATRIX);
+ DALI_TEST_EQUALS(m, actualMatrix, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldColor01(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor inheritance of color produces right final color");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ rootActor[Actor::Property::COLOR] = Color::WHITE;
+ branchActor[Actor::Property::COLOR] = Vector4(1.0f, 1.0f, 0.5f, 0.8f);
+ leafActor[Actor::Property::COLOR] = Vector4(0.1f, 0.5f, 0.5f, 0.8f);
+
+ // Default is to inherit:
+ leafActor[Actor::Property::COLOR_MODE] = ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+
+ Vector4 color = DevelActor::GetWorldColor(leafActor);
+
+ Vector4 actualColor = leafActor.GetCurrentProperty<Vector4>(Actor::Property::WORLD_COLOR);
+ DALI_TEST_EQUALS(color, actualColor, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldColor02(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor uses own color");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ rootActor[Actor::Property::COLOR] = Color::WHITE;
+ branchActor[Actor::Property::COLOR] = Vector4(1.0f, 1.0f, 0.5f, 0.8f);
+ leafActor[Actor::Property::COLOR] = Vector4(0.1f, 0.5f, 0.5f, 0.8f);
+
+ leafActor[Actor::Property::COLOR_MODE] = ColorMode::USE_OWN_COLOR;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+
+ Vector4 color = DevelActor::GetWorldColor(leafActor);
+
+ Vector4 actualColor = leafActor.GetCurrentProperty<Vector4>(Actor::Property::WORLD_COLOR);
+ DALI_TEST_EQUALS(color, actualColor, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS(color, Vector4(0.1f, 0.5f, 0.5f, 0.8f), 0.001f, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldColor03(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor uses parent color");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ rootActor[Actor::Property::COLOR] = Color::WHITE * 0.9f;
+ branchActor[Actor::Property::COLOR] = Vector4(1.0f, 1.0f, 0.5f, 0.8f);
+ leafActor[Actor::Property::COLOR] = Vector4(0.1f, 0.5f, 0.5f, 0.8f);
+
+ leafActor[Actor::Property::COLOR_MODE] = ColorMode::USE_PARENT_COLOR;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+
+ Vector4 color = DevelActor::GetWorldColor(leafActor);
+
+ Vector4 actualColor = leafActor.GetCurrentProperty<Vector4>(Actor::Property::WORLD_COLOR);
+ DALI_TEST_EQUALS(color, actualColor, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS(color, Vector4(1.0f, 1.0f, 0.5f, 0.72f), 0.001f, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliActorCalculateWorldColor04(void)
+{
+ TestApplication application;
+
+ tet_infoline("Test that actor blends with parent color");
+
+ Actor rootActor = Actor::New();
+ Actor branchActor = Actor::New();
+ Actor leafActor = Actor::New();
+
+ rootActor[Actor::Property::POSITION] = Vector3(100.0f, 0.0f, 0.0f);
+ rootActor[Actor::Property::SCALE] = Vector3(2.0f, 2.0f, 2.0f);
+ rootActor[Actor::Property::ORIENTATION] = AngleAxis(Degree(90.0f), Vector3::ZAXIS);
+
+ rootActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ branchActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ leafActor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+ rootActor[Actor::Property::COLOR] = Color::WHITE * 0.9f;
+ branchActor[Actor::Property::COLOR] = Vector4(1.0f, 1.0f, 0.5f, 0.8f);
+ leafActor[Actor::Property::COLOR] = Vector4(0.1f, 0.5f, 0.5f, 0.8f);
+
+ leafActor[Actor::Property::COLOR_MODE] = ColorMode::USE_OWN_MULTIPLY_PARENT_COLOR;
+
+ application.GetScene().Add(rootActor);
+ rootActor.Add(branchActor);
+ branchActor.Add(leafActor);
+
+ application.SendNotification();
+ application.Render(0);
+
+ Vector4 color = DevelActor::GetWorldColor(leafActor);
+
+ Vector4 actualColor = leafActor.GetCurrentProperty<Vector4>(Actor::Property::WORLD_COLOR);
+ DALI_TEST_EQUALS(color, actualColor, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}