#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/texture-set.h>
#include <dali/public-api/rendering/shader.h>
-#include <dali/devel-api/images/nine-patch-image.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/dali-toolkit.h>
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
- DALI_TEST_EQUALS( static_cast<BlendMode::Type>(blendMode), BlendMode::ON, TEST_LOCATION );
+ DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::ON, TEST_LOCATION );
TestGlAbstraction& gl = application.GetGlAbstraction();
application.Render(0);
int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
- DALI_TEST_EQUALS( static_cast<BlendMode::Type>(blendMode), BlendMode::AUTO, TEST_LOCATION );
+ DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::AUTO, TEST_LOCATION );
Vector4 actualColor(Vector4::ZERO);
DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "borderColor", actualColor ) );
application.SendNotification();
application.Render(0);
blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
- DALI_TEST_EQUALS( static_cast<BlendMode::Type>(blendMode), BlendMode::ON, TEST_LOCATION );
+ DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::ON, TEST_LOCATION );
END_TEST;
}
//This should still load but display an error image
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid URL" );
+ tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid Property::Map" );
VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
+ propertyMap.Insert( Visual::Property::TYPE, 111 );
propertyMap.Insert( ImageVisual::Property::URL, "ERROR.9.jpg" );
Visual::Base visual = factory.CreateVisual( propertyMap );
END_TEST;
}
-int UtcDaliVisualFactoryGetNPatchVisualN3(void)
-{
- // Passing in an invalid visual type so we should not get a visual
-
- ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid visual type" );
-
- VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
-
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, 111 );
- propertyMap.Insert( ImageVisual::Property::URL, "ERROR.9.jpg" );
-
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( !visual );
-
- END_TEST;
-}
-
int UtcDaliVisualFactoryGetSvgVisual(void)
{
ToolkitTestApplication application;
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 );
propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 );
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTRUM );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
propertyMap.Insert( PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f );
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::BEVELLED_CUBE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, 0.7f );
//Test to see if shape loads correctly.
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::OCTAHEDRON );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
//Test to see if shape loads correctly.
TestPrimitiveVisualWithProperties( propertyMap, application );
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f );
Property::Map propertyMap;
propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3( 0.0, 1.0, 2.0 ) );
//Test to see if shape loads correctly.
END_TEST;
}
-//Test if primitive shape loads correctly when told to use too many slices.
-int UtcDaliVisualFactoryGetPrimitiveVisual9(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual9: Request primitive visual with above-cap slices." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, Property::Value( 1000000 ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use too few slices. (2 slices or less.)
-int UtcDaliVisualFactoryGetPrimitiveVisual10(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual10: Request primitive visual with too few slices." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, Property::Value( 2 ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use too many stacks.
-int UtcDaliVisualFactoryGetPrimitiveVisual11(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual11: Request primitive visual with too many stacks." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::STACKS, Property::Value( 1000000 ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use too few stacks. (1 stack or less.)
-int UtcDaliVisualFactoryGetPrimitiveVisual12(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual12: Request primitive visual with too few stacks." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::STACKS, Property::Value( 1 ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use invalid (zero or negative) dimensions.
-int UtcDaliVisualFactoryGetPrimitiveVisual13(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual13: Request primitive visual with invalid scale dimensions." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_DIMENSIONS, Vector3::ZERO );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use too low a bevel percentage.
-int UtcDaliVisualFactoryGetPrimitiveVisual14(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual14: Request primitive visual with too low a bevel percentage." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, Property::Value( -1.0f ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use too high a bevel percentage.
-int UtcDaliVisualFactoryGetPrimitiveVisual15(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual15: Request primitive visual with too high a bevel percentage." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, Property::Value( 2.0f ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use too low a bevel smoothness.
-int UtcDaliVisualFactoryGetPrimitiveVisual16(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual16: Request primitive visual with too low a bevel smoothness." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_SMOOTHNESS, Property::Value( -1.0f ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
-//Test if primitive shape loads correctly when told to use too high a bevel smoothness.
-int UtcDaliVisualFactoryGetPrimitiveVisual17(void)
-{
- //Set up test application first, so everything else can be handled.
- ToolkitTestApplication application;
-
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual17: Request primitive visual with too high a bevel smoothness." );
-
- //Set up visual properties.
- Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_SMOOTHNESS, Property::Value( 2.0f ) );
-
- //Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
-
- END_TEST;
-}
-
//Test if primitive shape renderer handles the case of not being passed a specific shape to use.
int UtcDaliVisualFactoryGetPrimitiveVisualN1(void)
{