+ Visual::Base visual = VisualFactory::Get().CreateVisual(visualMap);
+ visual.SetName("visual1");
+
+ Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
+ dummyImpl.RegisterVisual(visualIndex, visual);
+
+ Animation anim = dummyImpl.CreateTransition(transition);
+ DALI_TEST_CHECK(anim);
+
+ Renderer renderer = actor.GetRendererAt(0);
+ Property::Index mixColorIndex = VisualRenderer::Property::VISUAL_MIX_COLOR;
+ application.SendNotification();
+ application.Render(0);
+
+ DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer.GetCurrentProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer.GetProperty<float>(DevelRenderer::Property::OPACITY), 1.0f, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer.GetCurrentProperty<float>(DevelRenderer::Property::OPACITY), 1.0f, 0.001f, TEST_LOCATION);
+
+ anim.Play();
+
+ application.SendNotification();
+ application.Render(0);
+ application.Render(500); // Start animation
+ application.Render(500); // Halfway thru anim
+ application.SendNotification();
+ DALI_TEST_EQUALS(renderer.GetCurrentProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA + Color::RED) * 0.5f, TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer.GetCurrentProperty<float>(DevelRenderer::Property::OPACITY), 1.0f, 0.001f, TEST_LOCATION);
+
+ application.Render(500); // End of anim
+ application.SendNotification();
+ DALI_TEST_EQUALS(renderer.GetCurrentProperty<Vector3>(mixColorIndex), Vector3(Color::RED), TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer.GetCurrentProperty<float>(DevelRenderer::Property::OPACITY), 1.0f, 0.001f, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliTransitionDataMap2Pb(void)
+{
+ ToolkitTestApplication application;
+
+ tet_printf("Testing animation of a visual property using programmatic maps\n");
+
+ Property::Map map;
+ map["target"] = "visual1";
+ map["property"] = PrimitiveVisual::Property::MIX_COLOR;
+ map["initialValue"] = Color::MAGENTA;
+ map["targetValue"] = Color::RED;
+ map["animator"] = Property::Map()
+ .Add("alphaFunction", "LINEAR")
+ .Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
+
+ Dali::Toolkit::TransitionData transition = TransitionData::New(map);
+
+ DummyControl actor = DummyControl::New();
+ actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ actor.SetProperty(Dali::Actor::Property::NAME, "Actor1");
+ actor.SetProperty(Actor::Property::COLOR, Color::CYAN);
+ application.GetScene().Add(actor);
+
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+
+ Property::Map visualMap;
+ visualMap[Visual::Property::TYPE] = Visual::PRIMITIVE;
+ visualMap[PrimitiveVisual::Property::MIX_COLOR] = Color::MAGENTA;
+ visualMap[PrimitiveVisual::Property::SHAPE] = PrimitiveVisual::Shape::SPHERE;
+ visualMap[PrimitiveVisual::Property::SLICES] = 10;
+ visualMap[PrimitiveVisual::Property::STACKS] = 10;
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(visualMap);
+ visual.SetName("visual1");