+ DALI_TEST_EQUALS( value->Get<float>(), offset , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliVisualGetPropertyMap12(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliVisualGetPropertyMap12: AnimatedGradientVisual with animation param" );
+
+ // Case 1 : Set values by index
+ {
+ tet_printf( " - Set Values by Index\n" );
+ // NOTE : PropertyMap doesn't optimized even delay < -loop_count * (duration + repeat_delay) so this animation will not run
+ // _delay = -10.0f is this case. It will progress (10.0f / 1.5f) amount. and 10.0f / 1.5f > 5.
+ for(float _delay = -10.0f; _delay <= 5.0f; _delay += 5.0f)
+ {
+ tet_printf( "test with delay [%f]\n", _delay );
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ Property::Map propertyMap;
+ Property::Map animationMap;
+ propertyMap.Insert(Visual::Property::TYPE, DevelVisual::ANIMATED_GRADIENT);
+
+ float duration = 1.1f;
+ float delay = _delay;
+ float repeat_delay = 0.4f;
+
+ int direction = DevelAnimatedGradientVisual::AnimationParameter::DirectionType::BACKWARD;
+ int loop_count = 5;
+ int motion = DevelAnimatedGradientVisual::AnimationParameter::MotionType::MIRROR;
+ int easing = DevelAnimatedGradientVisual::AnimationParameter::EasingType::OUT;
+
+ auto buildAnimatedMap = [&animationMap, &direction, &duration, &delay, &loop_count, &repeat_delay, &motion, &easing](const Property::Value &start, const Property::Value &target)->Property::Map&
+ {
+ animationMap.Clear();
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::START, start);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::TARGET, target);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DIRECTION, direction);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DURATION, duration);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DELAY, delay);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT, loop_count);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT_DELAY, repeat_delay);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::MOTION_TYPE, motion);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::EASING_TYPE, easing);
+
+ return animationMap;
+ };
+
+ Vector2 start1(-0.5f, 0.5f);
+ Vector2 end1 (0.5f, -0.5f);
+ Vector4 start_color1(1.0f, 0.7f, 0.5f, 1.0f);
+ Vector4 end_color1 (0.7f, 0.5f, 1.0f, 1.0f);
+ Vector2 rotate_center1(0.0f, 0.4f);
+ float rotate_amount1 = 0.0f;
+ float offset1 = 0.f;
+
+ Vector2 start2(-0.5f, -0.5f);
+ Vector2 end2 (0.5f, 0.5f);
+ Vector4 start_color2(0.0f, 0.1f, 0.8f, 1.0f);
+ Vector4 end_color2 (0.3f, 1.0f, 0.1f, 0.0f);
+ Vector2 rotate_center2(0.0f, -0.4f);
+ float rotate_amount2 = 6.2832f;
+ float offset2 = 2.f;
+
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::GRADIENT_TYPE, DevelAnimatedGradientVisual::GradientType::LINEAR);
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::UNIT_TYPE, DevelAnimatedGradientVisual::UnitType::OBJECT_BOUNDING_BOX);
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::SPREAD_TYPE, DevelAnimatedGradientVisual::SpreadType::REPEAT);
+
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::START_POSITION, buildAnimatedMap(start1 , start2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::END_POSITION, buildAnimatedMap(end1 , end2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::START_COLOR, buildAnimatedMap(start_color1 , start_color2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::END_COLOR, buildAnimatedMap(end_color1 , end_color2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::ROTATE_CENTER, buildAnimatedMap(rotate_center1, rotate_center2));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::ROTATE_AMOUNT, buildAnimatedMap(rotate_amount1, rotate_amount2));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::OFFSET, buildAnimatedMap(offset1 , offset2 ));
+
+ Visual::Base animatedGradientVisual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( animatedGradientVisual );
+
+ Property::Map resultMap;
+ animatedGradientVisual.CreatePropertyMap( resultMap );
+
+ // check the property values from the returned map from visual
+ Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelVisual::ANIMATED_GRADIENT );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::GRADIENT_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::GradientType::LINEAR );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::UNIT_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::UnitType::OBJECT_BOUNDING_BOX );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::SPREAD_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::SpreadType::REPEAT );
+
+ auto checkAnimatedMap = [&value, &resultMap, &direction, &duration, &delay, &loop_count, &repeat_delay, &motion, &easing](const Property::Index &index, const Property::Value &start, const Property::Value &target, int line_num)->void
+ {
+ tet_printf("Check value at %d\n", line_num);
+ value = resultMap.Find( index, Property::MAP );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->GetType() == Property::MAP );
+ Property::Map *temp_map = value->GetMap();
+ DALI_TEST_CHECK( temp_map );
+
+ auto checkMapValue = [&temp_map](const Property::Index index)->Property::Value
+ {
+ Property::Value *res = temp_map->Find( index );
+ DALI_TEST_CHECK( res );
+ return *res;
+ };
+
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::START) , start, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::TARGET) , target, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::DIRECTION) , Property::Value( direction ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::DURATION) , Property::Value( duration ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::DELAY) , Property::Value( delay ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT) , Property::Value( loop_count ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT_DELAY), Property::Value( repeat_delay ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::MOTION_TYPE) , Property::Value( motion ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::EASING_TYPE) , Property::Value( easing ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ };
+
+ // check the animation map data is good
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::START_POSITION, start1 , start2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::END_POSITION , end1 , end2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::START_COLOR , start_color1 , start_color2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::END_COLOR , end_color1 , end_color2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::ROTATE_CENTER , rotate_center1, rotate_center2, __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::ROTATE_AMOUNT , rotate_amount1, rotate_amount2, __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::OFFSET , offset1 , offset2 , __LINE__);
+ }
+ }
+
+ // Case 2 : Set values by string
+ {
+ tet_printf( " - Set Values by String\n" );
+ // NOTE : PropertyMap doesn't optimized even delay < -loop_count * (duration + repeat_delay) so this animation will not run
+ // _delay = -10.0f is this case. It will progress (10.0f / 1.5f) amount. and 10.0f / 1.5f > 5.
+ for(float _delay = -10.0f; _delay <= 5.0f; _delay += 5.0f)
+ {
+ tet_printf( "test with delay [%f]\n", _delay );
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ Property::Map propertyMap;
+ Property::Map animationMap;
+ propertyMap.Insert("visualType", "ANIMATED_GRADIENT");
+
+ float duration = 1.1f;
+ float delay = _delay;
+ float repeat_delay = 0.4f;
+
+ int direction = DevelAnimatedGradientVisual::AnimationParameter::DirectionType::BACKWARD;
+ int loop_count = 5;
+ int motion = DevelAnimatedGradientVisual::AnimationParameter::MotionType::MIRROR;
+ int easing = DevelAnimatedGradientVisual::AnimationParameter::EasingType::IN_OUT;
+
+ auto buildAnimatedMap = [&animationMap, &duration, &delay, &loop_count, &repeat_delay](const Property::Value &start, const Property::Value &target)->Property::Map&
+ {
+ animationMap.Clear();
+ animationMap.Insert("startValue" , start);
+ animationMap.Insert("targetValue" , target);
+ animationMap.Insert("directionType", "BACKWARD");
+ animationMap.Insert("duration" , duration);
+ animationMap.Insert("delay" , delay);
+ animationMap.Insert("repeat" , loop_count);
+ animationMap.Insert("repeatDelay" , repeat_delay);
+ animationMap.Insert("motionType" , "MIRROR");
+ animationMap.Insert("easingType" , "IN_OUT");
+
+ return animationMap;
+ };
+
+ Vector2 start1(-0.5f, 0.5f);
+ Vector2 end1 (0.5f, -0.5f);
+ Vector4 start_color1(1.0f, 0.7f, 0.5f, 1.0f);
+ Vector4 end_color1 (0.7f, 0.5f, 1.0f, 1.0f);
+ Vector2 rotate_center1(0.0f, 0.4f);
+ float rotate_amount1 = 0.0f;
+ float offset1 = 0.f;
+
+ Vector2 start2(-0.5f, -0.5f);
+ Vector2 end2 (0.5f, 0.5f);
+ Vector4 start_color2(0.0f, 0.1f, 0.8f, 1.0f);
+ Vector4 end_color2 (0.3f, 1.0f, 0.1f, 0.0f);
+ Vector2 rotate_center2(0.0f, -0.4f);
+ float rotate_amount2 = 6.2832f;
+ float offset2 = 2.f;
+
+ // For test mix the type string/index key and string/index value works well.
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::GRADIENT_TYPE, "RADIAL");
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::UNIT_TYPE, DevelAnimatedGradientVisual::UnitType::USER_SPACE);
+ propertyMap.Insert("spreadType" , DevelAnimatedGradientVisual::SpreadType::REFLECT);
+
+ propertyMap.Insert("startPosition", buildAnimatedMap(start1 , start2 ));
+ propertyMap.Insert("endPosition" , buildAnimatedMap(end1 , end2 ));
+ propertyMap.Insert("startColor" , buildAnimatedMap(start_color1 , start_color2 ));
+ propertyMap.Insert("endColor" , buildAnimatedMap(end_color1 , end_color2 ));
+ propertyMap.Insert("rotateCenter" , buildAnimatedMap(rotate_center1, rotate_center2));
+ propertyMap.Insert("rotateAmount" , buildAnimatedMap(rotate_amount1, rotate_amount2));
+ propertyMap.Insert("offset" , buildAnimatedMap(offset1 , offset2 ));
+
+ Visual::Base animatedGradientVisual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( animatedGradientVisual );
+
+ Property::Map resultMap;
+ animatedGradientVisual.CreatePropertyMap( resultMap );
+
+ // check the property values from the returned map from visual
+ // Note : resultMap from CreatePropertyMap only contain indexKey
+ Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelVisual::ANIMATED_GRADIENT );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::GRADIENT_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::GradientType::RADIAL );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::UNIT_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::UnitType::USER_SPACE );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::SPREAD_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::SpreadType::REFLECT );
+
+ auto checkAnimatedMap = [&value, &resultMap, &direction, &duration, &delay, &loop_count, &repeat_delay, &motion, &easing](const Property::Index &index, const Property::Value &start, const Property::Value &target, int line_num)->void
+ {
+ tet_printf("Check value at %d\n", line_num);
+ value = resultMap.Find( index, Property::MAP );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->GetType() == Property::MAP );
+ Property::Map *temp_map = value->GetMap();
+ DALI_TEST_CHECK( temp_map );
+
+ auto checkMapValue = [&temp_map](const Property::Index index)->Property::Value
+ {
+ Property::Value *res = temp_map->Find( index );
+ DALI_TEST_CHECK( res );
+ return *res;
+ };
+
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::START) , start, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::TARGET) , target, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::DIRECTION) , Property::Value( direction ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::DURATION) , Property::Value( duration ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::DELAY) , Property::Value( delay ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT) , Property::Value( loop_count ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT_DELAY), Property::Value( repeat_delay ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::MOTION_TYPE) , Property::Value( motion ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_EQUALS( checkMapValue(DevelAnimatedGradientVisual::AnimationParameter::Property::EASING_TYPE) , Property::Value( easing ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ };
+
+ // check the animation map data is good
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::START_POSITION, start1 , start2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::END_POSITION , end1 , end2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::START_COLOR , start_color1 , start_color2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::END_COLOR , end_color1 , end_color2 , __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::ROTATE_CENTER , rotate_center1, rotate_center2, __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::ROTATE_AMOUNT , rotate_amount1, rotate_amount2, __LINE__);
+ checkAnimatedMap(DevelAnimatedGradientVisual::Property::OFFSET , offset1 , offset2 , __LINE__);
+ }
+ }
+
+ END_TEST;
+}
+int UtcDaliVisualGetPropertyMap13(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliVisualGetPropertyMap13: AnimatedGradientVisual when repeat = 0" );
+
+ for(int _direction = 0; _direction <= 1; ++_direction)
+ {
+ for(float _delay = -10.0f; _delay <= 10.0f; _delay += 10.0f)
+ {
+ tet_printf( ((_direction == 0) ? "Forward test with delay [%f]\n" : "Backward test with delay [%f]\n") , _delay );
+ VisualFactory factory = VisualFactory::Get();
+ DALI_TEST_CHECK( factory );
+
+ Property::Map propertyMap;
+ Property::Map animationMap;
+ propertyMap.Insert(Visual::Property::TYPE, DevelVisual::ANIMATED_GRADIENT);
+
+ float duration = 1.0f;
+ float delay = _delay;
+ float repeat_delay = 0.5f;
+
+ int direction = _direction;
+ int loop_count = 0; // When loop_count is 0, Animation will not be created.
+ int motion = DevelAnimatedGradientVisual::AnimationParameter::MotionType::LOOP;
+ int easing = DevelAnimatedGradientVisual::AnimationParameter::EasingType::IN;
+
+ auto buildAnimatedMap = [&animationMap, &direction, &duration, &delay, &loop_count, &repeat_delay, &motion, &easing](const Property::Value &start, const Property::Value &target)->Property::Map&
+ {
+ animationMap.Clear();
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::START, start);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::TARGET, target);
+ if(direction == 0)animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DIRECTION, DevelAnimatedGradientVisual::AnimationParameter::DirectionType::FORWARD);
+ else animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DIRECTION, DevelAnimatedGradientVisual::AnimationParameter::DirectionType::BACKWARD);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DIRECTION, direction);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DURATION, duration);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::DELAY, delay);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT, loop_count);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::REPEAT_DELAY, repeat_delay);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::MOTION_TYPE, motion);
+ animationMap.Insert(DevelAnimatedGradientVisual::AnimationParameter::Property::EASING_TYPE, easing);
+
+ return animationMap;
+ };
+
+ Vector2 start1(-0.5f, 0.5f);
+ Vector2 end1 (0.5f, -0.5f);
+ Vector4 start_color1(1.0f, 0.7f, 0.5f, 1.0f);
+ Vector4 end_color1 (0.7f, 0.5f, 1.0f, 1.0f);
+ Vector2 rotate_center1(1.0f, 0.4f);
+ float rotate_amount1 = 2.0f;
+ float offset1 = 1.f;
+
+ Vector2 start2(-0.5f, -0.5f);
+ Vector2 end2 (0.5f, 0.5f);
+ Vector4 start_color2(0.0f, 0.1f, 0.8f, 1.0f);
+ Vector4 end_color2 (0.3f, 1.0f, 0.1f, 0.0f);
+ Vector2 rotate_center2(1.0f, -0.4f);
+ float rotate_amount2 = 1.0f;
+ float offset2 = 3.f;
+
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::GRADIENT_TYPE, DevelAnimatedGradientVisual::GradientType::LINEAR);
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::UNIT_TYPE, DevelAnimatedGradientVisual::UnitType::OBJECT_BOUNDING_BOX);
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::SPREAD_TYPE, DevelAnimatedGradientVisual::SpreadType::REFLECT);
+
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::START_POSITION, buildAnimatedMap(start1 , start2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::END_POSITION, buildAnimatedMap(end1 , end2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::START_COLOR, buildAnimatedMap(start_color1 , start_color2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::END_COLOR, buildAnimatedMap(end_color1 , end_color2 ));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::ROTATE_CENTER, buildAnimatedMap(rotate_center1, rotate_center2));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::ROTATE_AMOUNT, buildAnimatedMap(rotate_amount1, rotate_amount2));
+ propertyMap.Insert(DevelAnimatedGradientVisual::Property::OFFSET, buildAnimatedMap(offset1 , offset2 ));
+
+ Visual::Base animatedGradientVisual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( animatedGradientVisual );
+
+ Property::Map resultMap;
+ animatedGradientVisual.CreatePropertyMap( resultMap );
+
+ // check the property values from the returned map from visual
+ Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelVisual::ANIMATED_GRADIENT );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::GRADIENT_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::GradientType::LINEAR );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::UNIT_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::UnitType::OBJECT_BOUNDING_BOX );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::SPREAD_TYPE, Property::INTEGER );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK( value->Get<int>() == DevelAnimatedGradientVisual::SpreadType::REFLECT );
+
+ // If loop_count = 0, Animation doesn't created.
+ // Optimized resultMap only have one value, which is target value
+ // Note: target value will be changed by direction option.
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::START_POSITION, Property::VECTOR2 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<Vector2>(), direction ? start1 : start2 , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::END_POSITION, Property::VECTOR2 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<Vector2>(), direction ? end1 : end2 , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::START_COLOR, Property::VECTOR4 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<Vector4>(), direction ? start_color1 : start_color2 , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::END_COLOR, Property::VECTOR4 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<Vector4>(), direction ? end_color1 : end_color2 , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::ROTATE_CENTER, Property::VECTOR2 );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<Vector2>(), direction ? rotate_center1 : rotate_center2 , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::ROTATE_AMOUNT, Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<float>(), direction ? rotate_amount1 : rotate_amount2 , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+
+ value = resultMap.Find( DevelAnimatedGradientVisual::Property::OFFSET, Property::FLOAT );
+ DALI_TEST_CHECK( value );
+ DALI_TEST_EQUALS( value->Get<float>(), direction ? offset1 : offset2 , Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ }
+ }