X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-VisualFactory.cpp;h=48de1ca3b9b412d3a60db258d21e96f67c4bdf75;hp=76d6aac900212f49043fe0d1f6f1814fa73b689a;hb=9ce1fa453940de2fb38552cc374cd54af660debf;hpb=afe38927f068846eaa02c374430da05f6209a6f9 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index 76d6aac..48de1ca 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -17,12 +17,18 @@ #include #include #include +#include +#include #include #include #include #include +#include +#include +#include #include #include +#include "dummy-control.h" using namespace Dali; using namespace Dali::Toolkit; @@ -33,13 +39,32 @@ typedef NinePatchImage::StretchRanges StretchRanges; const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg"; const char* TEST_NPATCH_FILE_NAME = "gallery_image_01.9.png"; - const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg"; const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj"; const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl"; const char* TEST_SIMPLE_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube-Points-Only.obj"; const char* TEST_SIMPLE_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal-Simple.mtl"; +// resolution: 50*50, frame count: 4, frame delay: 0.2 second for each frame +const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif"; + +// resolution: 34*34, pixel format: RGBA8888 +static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png"; +// resolution: 600*600, pixel format: RGB888 +static const char* gImage_600_RGB = TEST_RESOURCE_DIR "/test-image-600.jpg"; + +Property::Map DefaultTransform() +{ + Property::Map transformMap; + transformMap + .Add( Toolkit::DevelVisual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f) ) + .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) ) + .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER ) + .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER ) + .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_SIZE_MODE, Vector4::ZERO ); + return transformMap; +} + Integration::Bitmap* CreateBitmap( unsigned int imageWidth, unsigned int imageHeight, unsigned int initialColor, Pixel::Format pixelFormat ) { Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN ); @@ -175,12 +200,15 @@ Integration::ResourcePointer CustomizeNinePatch( TestApplication& application, } void TestVisualRender( ToolkitTestApplication& application, - Actor& actor, - Visual::Base& visual, - std::size_t expectedSamplers = 0, - ImageDimensions imageDimensions = ImageDimensions(), - Integration::ResourcePointer resourcePtr = Integration::ResourcePointer()) + DummyControl& actor, + Visual::Base& visual, + std::size_t expectedSamplers = 0, + ImageDimensions imageDimensions = ImageDimensions(), + Integration::ResourcePointer resourcePtr = Integration::ResourcePointer()) { + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + if( resourcePtr ) { // set the image size, for test case, this needs to be set before loading started @@ -188,11 +216,9 @@ void TestVisualRender( ToolkitTestApplication& application, } actor.SetSize( 200.f, 200.f ); - Stage::GetCurrent().Add( actor ); - visual.SetSize( Vector2(200.f, 200.f) ); - visual.SetOnStage( actor ); + DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); - DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); + Stage::GetCurrent().Add( actor ); application.SendNotification(); application.Render(); @@ -211,11 +237,11 @@ void TestVisualRender( ToolkitTestApplication& application, if( resourcePtr ) { - DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) || - application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc )); + DALI_TEST_EQUALS( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) || + application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ), true, TEST_LOCATION); } - DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); + DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); } @@ -251,7 +277,7 @@ int UtcDaliVisualFactoryGet(void) VisualFactory newFactory = VisualFactory::Get(); DALI_TEST_CHECK( newFactory ); - // Check that renderer factory is a singleton + // Check that visual factory is a singleton DALI_TEST_CHECK(factory == newFactory); END_TEST; @@ -301,7 +327,7 @@ int UtcDaliVisualFactoryGetColorVisual1(void) Visual::Base visual = factory.CreateVisual(propertyMap); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual ); Vector4 actualValue(Vector4::ZERO); @@ -327,7 +353,7 @@ int UtcDaliVisualFactoryGetColorVisual2(void) Visual::Base visual = factory.CreateVisual( map ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual ); Vector4 actualValue(Vector4::ZERO); @@ -335,7 +361,7 @@ int UtcDaliVisualFactoryGetColorVisual2(void) DALI_TEST_CHECK( gl.GetUniformValue( "mixColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION ); - visual.SetOffStage( actor ); + Stage::GetCurrent().Remove(actor); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); END_TEST; @@ -359,15 +385,16 @@ int UtcDaliVisualFactoryGetBorderVisual1(void) Visual::Base visual = factory.CreateVisual(propertyMap); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); actor.SetSize(200.f, 200.f); Stage::GetCurrent().Add( actor ); - visual.SetSize(Vector2(200.f, 200.f)); - visual.SetOnStage( actor ); + visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f)); DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); int blendMode = actor.GetRendererAt(0u).GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( static_cast(blendMode), BlendingMode::ON, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast(blendMode), BlendMode::ON, TEST_LOCATION ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -382,7 +409,7 @@ int UtcDaliVisualFactoryGetBorderVisual1(void) DALI_TEST_CHECK( gl.GetUniformValue( "borderSize", actualSize ) ); DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION ); - visual.SetOffStage( actor ); + actor.Unparent(); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); END_TEST; @@ -406,11 +433,12 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) Visual::Base visual = factory.CreateVisual( propertyMap ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); actor.SetSize(200.f, 200.f); Stage::GetCurrent().Add( actor ); - visual.SetSize(Vector2(200.f, 200.f)); - visual.SetOnStage( actor ); + visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f)); DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); @@ -420,7 +448,7 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) application.Render(0); int blendMode = actor.GetRendererAt(0u).GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( static_cast(blendMode), BlendingMode::AUTO, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast(blendMode), BlendMode::AUTO, TEST_LOCATION ); Vector4 actualColor(Vector4::ZERO); DALI_TEST_CHECK( gl.GetUniformValue( "borderColor", actualColor ) ); @@ -430,7 +458,7 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) DALI_TEST_CHECK( gl.GetUniformValue( "borderSize", actualSize ) ); DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION ); - visual.SetOffStage( actor ); + actor.Unparent(); // enable the anti-aliasing Dali::Property::Map map; @@ -439,12 +467,12 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) map[ BorderVisual::Property::SIZE ] = testSize; map[ BorderVisual::Property::ANTI_ALIASING ] = true; visual = factory.CreateVisual( map ); - visual.SetOnStage( actor ); - application.SendNotification(); - application.Render(0); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + Stage::GetCurrent().Add( actor ); + blendMode = actor.GetRendererAt(0u).GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( static_cast(blendMode), BlendingMode::ON, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast(blendMode), BlendMode::ON, TEST_LOCATION ); END_TEST; } @@ -480,11 +508,8 @@ int UtcDaliVisualFactoryGetLinearGradientVisual(void) DALI_TEST_CHECK( visual ); // A lookup texture is generated and pass to shader as sampler - Actor actor = Actor::New(); - TestVisualRender( application, actor, visual, 1u ); - - visual.SetOffStage( actor ); - DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + DummyControl actor = DummyControl::New(); + TestVisualRender( application, actor, visual, 1u); END_TEST; } @@ -520,7 +545,7 @@ int UtcDaliVisualFactoryGetRadialGradientVisual(void) DALI_TEST_CHECK( visual ); // A lookup texture is generated and pass to shader as sampler - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u ); Matrix3 alignMatrix( radius, 0.f, 0.f, 0.f, radius, 0.f, center.x, center.y, 1.f ); @@ -560,10 +585,10 @@ int UtcDaliVisualFactoryDefaultOffsetsGradientVisual(void) DALI_TEST_CHECK( visual ); // A lookup texture is generated and pass to shader as sampler - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u ); - visual.SetOffStage( actor ); + Stage::GetCurrent().Remove( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); END_TEST; @@ -572,7 +597,7 @@ int UtcDaliVisualFactoryDefaultOffsetsGradientVisual(void) int UtcDaliVisualFactoryGetImageVisual1(void) { ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetImageVisual1: Request image renderer with a Property::Map" ); + tet_infoline( "UtcDaliVisualFactoryGetImageVisual1: Request image visual with a Property::Map" ); VisualFactory factory = VisualFactory::Get(); DALI_TEST_CHECK( factory ); @@ -584,7 +609,6 @@ int UtcDaliVisualFactoryGetImageVisual1(void) Visual::Base visual = factory.CreateVisual( propertyMap ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); // For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied. // Image with a size smaller than 512*512 will be uploaded as a part of the atlas. @@ -597,13 +621,14 @@ int UtcDaliVisualFactoryGetImageVisual1(void) Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD ); bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height,width, height ); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(width, height), - Integration::ResourcePointer( bitmap ) ); + ImageDimensions(width, height), + Integration::ResourcePointer( bitmap ) ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); - visual.SetOffStage( actor ); + Stage::GetCurrent().Remove( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); END_TEST; @@ -612,7 +637,7 @@ int UtcDaliVisualFactoryGetImageVisual1(void) int UtcDaliVisualFactoryGetImageVisual2(void) { ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetImageVisual2: Request image renderer with an image handle" ); + tet_infoline( "UtcDaliVisualFactoryGetImageVisual2: Request image visual with an image handle" ); VisualFactory factory = VisualFactory::Get(); DALI_TEST_CHECK( factory ); @@ -620,7 +645,6 @@ int UtcDaliVisualFactoryGetImageVisual2(void) Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME); Visual::Base visual = factory.CreateVisual( image ); - Actor actor = Actor::New(); // For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied. // Image with a size smaller than 512*512 will be uploaded as a part of the atlas. @@ -634,19 +658,183 @@ int UtcDaliVisualFactoryGetImageVisual2(void) TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(width, height), - Integration::ResourcePointer(bitmap) ); + ImageDimensions(width, height), + Integration::ResourcePointer(bitmap) ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + END_TEST; +} + +int UtcDaliVisualFactoryGetImageVisual3(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliVisualFactoryGetImageVisual3: Request image visual with a Property::Map, test custom wrap mode and pixel area with atlasing" ); + + VisualFactory factory = VisualFactory::Get(); + DALI_TEST_CHECK( factory ); + + // Test wrap mode with atlasing. Image with a size smaller than 512*512 will be uploaded as a part of the atlas. + const int width=34; + const int height=34; + const Vector4 pixelArea(-0.5f, -0.5f, 2.f, 2.f); + + Property::Map propertyMap; + propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); + propertyMap.Insert( ImageVisual::Property::URL, gImage_34_RGBA ); + propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH, width ); + propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT, height ); + propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true ); + propertyMap.Insert( ImageVisual::Property::PIXEL_AREA, pixelArea ); + propertyMap.Insert( ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT ); + propertyMap.Insert( ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT ); + + Visual::Base visual = factory.CreateVisual( propertyMap ); + DALI_TEST_CHECK( visual ); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TraceCallStack& texParameterTrace = gl.GetTexParameterTrace(); + texParameterTrace.Enable( true ); + + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + actor.SetSize(2000, 2000); + actor.SetParentOrigin(ParentOrigin::CENTER); + Stage::GetCurrent().Add( actor ); + + // loading started + application.SendNotification(); + application.Render(); + application.Render(); + application.SendNotification(); + BitmapLoader loader = BitmapLoader::GetLatestCreated(); + DALI_TEST_CHECK( loader ); + loader.WaitForLoading();// waiting until the image to be loaded + DALI_TEST_CHECK( loader.IsLoaded() ); + + DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + + // WITH atlasing, the wrapping is handled manually in shader, so the following gl function should not be called + std::stringstream out; + out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_S << ", " << GL_MIRRORED_REPEAT; + DALI_TEST_CHECK( !texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) ); + out.str(""); + out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_T << ", " << GL_REPEAT; + DALI_TEST_CHECK( !texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) ); + + // test the uniforms which used to handle the wrap mode + Renderer renderer = actor.GetRendererAt( 0u ); + DALI_TEST_CHECK( renderer ); + + Property::Value pixelAreaValue = renderer.GetProperty( renderer.GetPropertyIndex( "pixelArea" ) ); + DALI_TEST_EQUALS( pixelAreaValue.Get(), pixelArea, TEST_LOCATION ); + Vector4 pixelAreaUniform; + DALI_TEST_CHECK( gl.GetUniformValue( "pixelArea", pixelAreaUniform ) ); + DALI_TEST_EQUALS( pixelArea, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + Property::Value wrapModeValue = renderer.GetProperty( renderer.GetPropertyIndex( "wrapMode" ) ); + Vector2 wrapMode( WrapMode::MIRRORED_REPEAT-1, WrapMode::REPEAT-1 ); + DALI_TEST_EQUALS( wrapModeValue.Get(), wrapMode, TEST_LOCATION ); + Vector2 wrapModeUniform; + DALI_TEST_CHECK( gl.GetUniformValue( "wrapMode", wrapModeUniform ) ); + DALI_TEST_EQUALS( wrapMode, wrapModeUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + actor.Unparent( ); + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + + END_TEST; +} + +int UtcDaliVisualFactoryGetImageVisual4(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliVisualFactoryGetImageVisual4: Request image visual with a Property::Map, test custom wrap mode and pixel area without atlasing" ); + + VisualFactory factory = VisualFactory::Get(); + DALI_TEST_CHECK( factory ); + + // Test wrap mode without atlasing. Image with a size bigger than 512*512 will NOT be uploaded as a part of the atlas. + const int width=600; + const int height=600; + const Vector4 pixelArea(-0.5f, -0.5f, 2.f, 2.f); + + Property::Map propertyMap; + propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); + propertyMap.Insert( ImageVisual::Property::URL, gImage_600_RGB ); + propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH, width ); + propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT, height ); + propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true ); + propertyMap.Insert( ImageVisual::Property::PIXEL_AREA, pixelArea ); + propertyMap.Insert( ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT ); + propertyMap.Insert( ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT ); + + Visual::Base visual = factory.CreateVisual( propertyMap ); + DALI_TEST_CHECK( visual ); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TraceCallStack& texParameterTrace = gl.GetTexParameterTrace(); + texParameterTrace.Enable( true ); + + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + actor.SetSize(2000, 2000); + actor.SetParentOrigin(ParentOrigin::CENTER); + Stage::GetCurrent().Add( actor ); + + // loading started + application.SendNotification(); + application.Render(); + application.Render(); + application.SendNotification(); + BitmapLoader loader = BitmapLoader::GetLatestCreated(); + DALI_TEST_CHECK( loader ); + loader.WaitForLoading();// waiting until the image to be loaded + DALI_TEST_CHECK( loader.IsLoaded() ); + + DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + // WITHOUT atlasing, the wrapping is handled by setting gl texture parameters + std::stringstream out; + out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_S << ", " << GL_MIRRORED_REPEAT; + DALI_TEST_CHECK( texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) ); + out.str(""); + out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_T << ", " << GL_REPEAT; + DALI_TEST_CHECK( texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) ); + + // test the uniforms which used to handle the wrap mode + Renderer renderer = actor.GetRendererAt( 0u ); + DALI_TEST_CHECK( renderer ); + + Property::Value pixelAreaValue = renderer.GetProperty( renderer.GetPropertyIndex( "pixelArea" ) ); + DALI_TEST_EQUALS( pixelAreaValue.Get(), pixelArea, TEST_LOCATION ); + Vector4 pixelAreaUniform; + DALI_TEST_CHECK( gl.GetUniformValue( "pixelArea", pixelAreaUniform ) ); + DALI_TEST_EQUALS( pixelArea, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + Property::Index wrapModeIndex = renderer.GetPropertyIndex( "wrapMode" ); + DALI_TEST_CHECK(wrapModeIndex == Property::INVALID_INDEX); + + actor.Unparent(); + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + END_TEST; } int UtcDaliVisualFactoryGetNPatchVisual1(void) { ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual1: Request 9-patch renderer with a Property::Map" ); + tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual1: Request 9-patch visual with a Property::Map" ); VisualFactory factory = VisualFactory::Get(); DALI_TEST_CHECK( factory ); @@ -667,15 +855,15 @@ int UtcDaliVisualFactoryGetNPatchVisual1(void) Visual::Base visual = factory.CreateVisual( propertyMap ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), - ninePatchResource ); + ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), + ninePatchResource ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); } @@ -686,15 +874,14 @@ int UtcDaliVisualFactoryGetNPatchVisual1(void) Visual::Base visual = factory.CreateVisual( propertyMap ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); - TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), - ninePatchResource ); + ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), + ninePatchResource ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); } @@ -705,7 +892,7 @@ int UtcDaliVisualFactoryGetNPatchVisual1(void) int UtcDaliVisualFactoryGetNPatchVisual2(void) { ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual2: Request n-patch renderer with a Property::Map" ); + tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual2: Request n-patch visual with a Property::Map" ); VisualFactory factory = VisualFactory::Get(); DALI_TEST_CHECK( factory ); @@ -730,19 +917,18 @@ int UtcDaliVisualFactoryGetNPatchVisual2(void) Visual::Base visual = factory.CreateVisual( propertyMap ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), - ninePatchResource ); - + ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), + ninePatchResource ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); - visual.SetOffStage( actor ); + Stage::GetCurrent().Remove( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); } @@ -755,15 +941,15 @@ int UtcDaliVisualFactoryGetNPatchVisual2(void) TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), - ninePatchResource ); + ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), + ninePatchResource ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); - visual.SetOffStage( actor ); + Stage::GetCurrent().Remove( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); } @@ -773,7 +959,7 @@ int UtcDaliVisualFactoryGetNPatchVisual2(void) int UtcDaliVisualFactoryGetNPatchVisual3(void) { ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual3: Request 9-patch renderer with an image url" ); + tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual3: Request 9-patch visual with an image url" ); VisualFactory factory = VisualFactory::Get(); DALI_TEST_CHECK( factory ); @@ -789,18 +975,25 @@ int UtcDaliVisualFactoryGetNPatchVisual3(void) Visual::Base visual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); - TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), - ninePatchResource ); + ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), + ninePatchResource ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + + ResourceImage image = ResourceImage::New(TEST_NPATCH_FILE_NAME); + Visual::Base nPatchVisual = factory.CreateVisual( image ); + Vector2 controlSize( 20.f, 30.f ), naturalSize(0,0); + nPatchVisual.SetTransformAndSize(DefaultTransform(), controlSize ); + nPatchVisual.GetNaturalSize( naturalSize ); + DALI_TEST_EQUALS( naturalSize, Vector2( ninePatchImageWidth-2, ninePatchImageHeight-2 ), TEST_LOCATION ); + END_TEST; } @@ -828,15 +1021,14 @@ int UtcDaliVisualFactoryGetNPatchVisual4(void) Visual::Base visual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); - TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), - ninePatchResource ); + ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), + ninePatchResource ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); @@ -856,8 +1048,6 @@ int UtcDaliVisualFactoryGetNPatchVisualN1(void) Visual::Base visual = factory.CreateVisual( "ERROR.9.jpg", ImageDimensions() ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); - //The testkit still has to load a bitmap for the broken renderer image Integration::Bitmap* bitmap = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD); bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 100, 100, 100, 100 ); @@ -866,9 +1056,10 @@ int UtcDaliVisualFactoryGetNPatchVisualN1(void) TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(), - Integration::ResourcePointer(bitmap) ); + ImageDimensions(), + Integration::ResourcePointer(bitmap) ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); @@ -880,20 +1071,18 @@ int UtcDaliVisualFactoryGetNPatchVisualN2(void) //This should still load but display an error image ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid Property::Map" ); + tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid URL" ); VisualFactory factory = VisualFactory::Get(); DALI_TEST_CHECK( factory ); Property::Map propertyMap; - propertyMap.Insert( Visual::Property::TYPE, 111 ); + propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); propertyMap.Insert( ImageVisual::Property::URL, "ERROR.9.jpg" ); Visual::Base visual = factory.CreateVisual( propertyMap ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); - //The testkit still has to load a bitmap for the broken renderer image Integration::Bitmap* bitmap = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD); bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 100, 100, 100, 100 ); @@ -901,16 +1090,39 @@ int UtcDaliVisualFactoryGetNPatchVisualN2(void) TestGlAbstraction& gl = application.GetGlAbstraction(); TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); + TraceCallStack& drawTrace = gl.GetDrawTrace(); + drawTrace.Enable(true); + DummyControl actor = DummyControl::New(); TestVisualRender( application, actor, visual, 1u, - ImageDimensions(), - Integration::ResourcePointer(bitmap) ); + ImageDimensions(), + Integration::ResourcePointer(bitmap) ); DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); 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; @@ -924,22 +1136,61 @@ int UtcDaliVisualFactoryGetSvgVisual(void) TraceCallStack& textureTrace = gl.GetTextureTrace(); textureTrace.Enable(true); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); actor.SetSize( 200.f, 200.f ); Stage::GetCurrent().Add( actor ); - visual.SetSize( Vector2(200.f, 200.f) ); - visual.SetOnStage( actor ); + visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f) ); + application.SendNotification(); application.Render(); + // renderer is not added to actor until the rasterization is completed. + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + // renderer is added to actor DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); - EventThreadCallback* eventTrigger = EventThreadCallback::Get(); - CallbackBase* callback = eventTrigger->GetCallback(); + // waiting for the resource uploading + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliVisualFactoryGetSvgVisualLarge(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliVisualFactoryGetSvgVisual: Request svg visual with a svg url" ); - eventTrigger->WaitingForTrigger( 1 );// waiting until the svg image is rasterized. - CallbackBase::Execute( *callback ); + VisualFactory factory = VisualFactory::Get(); + Visual::Base visual = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions( 2000, 2000 ) ); + DALI_TEST_CHECK( visual ); + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + + DummyControl actor = DummyControl::New(true); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Only rasterizes when it knows control size. + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + Stage::GetCurrent().Add( actor ); + + application.SendNotification(); + application.Render(); + + // renderer is not added to actor until the rasterization is completed. + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + // renderer is added to actor DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); // waiting for the resource uploading @@ -951,7 +1202,7 @@ int UtcDaliVisualFactoryGetSvgVisual(void) END_TEST; } -//Creates a mesh renderer from the given propertyMap and tries to load it on stage in the given application. +//Creates a mesh visual from the given propertyMap and tries to load it on stage in the given application. //This is expected to succeed, which will then pass the test. void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application ) { @@ -963,11 +1214,12 @@ void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplic DALI_TEST_CHECK( visual ); //Create an actor on stage to house the visual. - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); actor.SetSize( 200.f, 200.f ); Stage::GetCurrent().Add( actor ); - visual.SetSize( Vector2( 200.f, 200.f ) ); - visual.SetOnStage( actor ); + visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) ); //Ensure set on stage. DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); @@ -993,7 +1245,7 @@ void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplic DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION ); //Finish by setting off stage, and ensuring this was successful. - visual.SetOffStage( actor ); + actor.Unparent(); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); } @@ -1009,11 +1261,12 @@ void MeshVisualDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTest DALI_TEST_CHECK( visual ); //Create an actor on stage to house the visual. - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); actor.SetSize( 200.f, 200.f ); Stage::GetCurrent().Add( actor ); - visual.SetSize( Vector2( 200.f, 200.f ) ); - visual.SetOnStage( actor ); + visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) ); //Ensure set on stage. DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); @@ -1035,7 +1288,7 @@ void MeshVisualDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTest DALI_TEST_CHECK( !application.GetGlAbstraction().GetUniformValue( "uObjectMatrix", scaleMatrix ) ); //Finish by setting off stage, and ensuring this was successful. - visual.SetOffStage( actor ); + actor.Unparent(); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); } @@ -1081,6 +1334,30 @@ int UtcDaliVisualFactoryGetMeshVisual2(void) END_TEST; } +//Test if mesh loads correctly when supplied with all main parameters, an object file, a material file and a directory location, but duff optional parameters +int UtcDaliVisualFactoryGetMeshVisual3b(void) +{ + //Set up test application first, so everything else can be handled. + ToolkitTestApplication application; + + tet_infoline( "UtcDaliVisualFactoryGetMeshVisual3: Request mesh visual with all parameters correct" ); + + //Set up visual properties. + Property::Map propertyMap; + propertyMap.Insert( Visual::Property::TYPE, Visual::MESH ); + propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME ); + propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME ); + propertyMap.Insert( MeshVisual::Property::USE_MIPMAPPING, Color::GREEN ); // Test that wrong property types don't prevent the object load + propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, 1.0f ); + propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, 1.0f ); + propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" ); + + //Test to see if mesh loads correctly. + MeshVisualLoadsCorrectlyTest( propertyMap, application ); + + END_TEST; +} + //Test if mesh loads correctly when supplied with all main parameters, an object file, a material file and a directory location. int UtcDaliVisualFactoryGetMeshVisual3(void) { @@ -1094,6 +1371,9 @@ int UtcDaliVisualFactoryGetMeshVisual3(void) propertyMap.Insert( Visual::Property::TYPE, Visual::MESH ); propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME ); propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME ); + propertyMap.Insert( MeshVisual::Property::USE_MIPMAPPING, false ); + propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, false ); + propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3::XAXIS ); propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" ); //Test to see if mesh loads correctly. @@ -1121,7 +1401,6 @@ int UtcDaliVisualFactoryGetMeshVisual4(void) //Test to see if mesh loads correctly. MeshVisualLoadsCorrectlyTest( propertyMap, application ); - END_TEST; } @@ -1136,10 +1415,13 @@ int UtcDaliVisualFactoryGetMeshVisual5(void) //Set up visual properties. Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::MESH ); - propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME ); - propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME ); - propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" ); - propertyMap.Insert( MeshVisual::Property::SHADING_MODE, MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING ); + propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME ); + propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME ); + propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" ); + propertyMap.Insert( "useMipmapping", false ); + propertyMap.Insert( "useSoftNormals", false ); + propertyMap.Insert( "lightPosition", Vector3::ZAXIS ); + propertyMap.Insert( "shadingMode", MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING ); //Test to see if mesh loads correctly. MeshVisualLoadsCorrectlyTest( propertyMap, application ); @@ -1289,11 +1571,13 @@ void TestPrimitiveVisualWithProperties( Property::Map& propertyMap, ToolkitTestA DALI_TEST_CHECK( visual ); //Create an actor on stage to house the visual. - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + actor.SetSize( 200.f, 200.f ); Stage::GetCurrent().Add( actor ); - visual.SetSize( Vector2( 200.f, 200.f ) ); - visual.SetOnStage( actor ); + visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) ); //Ensure set on stage. DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); @@ -1311,7 +1595,7 @@ void TestPrimitiveVisualWithProperties( Property::Map& propertyMap, ToolkitTestA DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION ); //Finish by setting off stage, and ensuring this was successful. - visual.SetOffStage( actor ); + actor.Unparent(); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); } @@ -1346,7 +1630,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual2(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_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 ); @@ -1375,7 +1659,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual3(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 ); @@ -1397,7 +1681,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual4(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTRUM ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_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 ); @@ -1421,7 +1705,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual5(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::BEVELLED_CUBE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_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. @@ -1442,7 +1726,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual6(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::OCTAHEDRON ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); //Test to see if shape loads correctly. TestPrimitiveVisualWithProperties( propertyMap, application ); @@ -1462,7 +1746,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual7(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_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 ); @@ -1485,7 +1769,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual8(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_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. @@ -1494,7 +1778,187 @@ int UtcDaliVisualFactoryGetPrimitiveVisual8(void) END_TEST; } -//Test if primitive shape renderer handles the case of not being passed a specific shape to use. +//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 visual handles the case of not being passed a specific shape to use. int UtcDaliVisualFactoryGetPrimitiveVisualN1(void) { //Set up test application first, so everything else can be handled. @@ -1528,21 +1992,22 @@ int UtcDaliVisualFactoryGetBatchImageVisual1(void) Visual::Base visual = factory.CreateVisual( propertyMap ); DALI_TEST_CHECK( visual ); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); actor.SetSize( 200.0f, 200.0f ); Stage::GetCurrent().Add( actor ); - visual.SetSize( Vector2( 200.0f, 200.0f ) ); + visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.0f, 200.0f ) ); // Test SetOnStage(). - visual.SetOnStage( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); application.SendNotification(); application.Render(); // Test SetOffStage(). - visual.SetOffStage( actor ); + actor.Unparent(); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); END_TEST; @@ -1576,21 +2041,22 @@ int UtcDaliVisualFactoryGetBatchImageVisual2(void) DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), (int)Visual::IMAGE, TEST_LOCATION ); - Actor actor = Actor::New(); + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); actor.SetSize( 200.0f, 200.0f ); Stage::GetCurrent().Add( actor ); - visual.SetSize( Vector2( 200.0f, 200.0f ) ); + visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.0f, 200.0f ) ); // Test SetOnStage(). - visual.SetOnStage( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); application.SendNotification(); application.Render(); // Test SetOffStage(). - visual.SetOffStage( actor ); + actor.Unparent(); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); END_TEST; @@ -1606,8 +2072,35 @@ int UtcDaliVisualFactoryGetBatchImageVisual3(void) // Create a property-map that enables batching. Property::Map propertyMap; - propertyMap.Insert( Dali::Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true ); + propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ; + propertyMap[ "desiredHeight" ] = 200; + propertyMap[ "desiredWidth" ] = 200; + propertyMap[ "batchingEnabled" ] = true; + + // Create an ImageView, passing the property-map in to instruct it to use batching. + Toolkit::ImageView imageView = Toolkit::ImageView::New(); + imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap ); + + imageView.SetSize( 200.0f, 200.0f ); + Stage::GetCurrent().Add( imageView ); + + END_TEST; +} + +int UtcDaliVisualFactoryGetBatchImageVisual4N(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliVisualFactoryGetBatchImageVisual4: Create an ImageView that uses a batched visual, with desired properties of the wrong type" ); + + VisualFactory factory = VisualFactory::Get(); + DALI_TEST_CHECK( factory ); + + // Create a property-map that enables batching. + Property::Map propertyMap; + propertyMap[ Dali::Toolkit::ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME ; + propertyMap[ "desiredHeight" ] = Vector2(100, 100); + propertyMap[ "desiredWidth" ] = Vector3(1, 1, 1); + propertyMap[ "batchingEnabled" ] = true; // Create an ImageView, passing the property-map in to instruct it to use batching. Toolkit::ImageView imageView = Toolkit::ImageView::New(); @@ -1618,3 +2111,149 @@ int UtcDaliVisualFactoryGetBatchImageVisual3(void) END_TEST; } + +int UtcDaliVisualFactoryGetAnimatedImageVisual1(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliVisualFactoryGetAnimatedImageVisual1: Request animated image visual with a gif url" ); + + VisualFactory factory = VisualFactory::Get(); + Visual::Base visual = factory.CreateVisual( TEST_GIF_FILE_NAME, ImageDimensions() ); + DALI_TEST_CHECK( visual ); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + actor.SetSize( 200.0f, 200.0f ); + Stage::GetCurrent().Add( actor ); + + application.SendNotification(); + application.Render(); + + // renderer is added to actor + DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); + + // test the uniforms which used to handle the atlas rect + // the four frames should be located inside atlas as follows: atlas size 100*100 + // ------------- + // | | | + // | 0 | 1 | + // ------------- + // | | | + // | 2 | 3 | + // ------------- + + Renderer renderer = actor.GetRendererAt( 0u ); + DALI_TEST_CHECK( renderer ); + + Property::Value atlasRectValue = renderer.GetProperty( renderer.GetPropertyIndex( "uAtlasRect" ) ); + // take into consideration the half pixel correction + DALI_TEST_EQUALS( atlasRectValue.Get(), Vector4(0.5f, 0.5f, 49.5f, 49.5f)/100.f, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + // waiting for the resource uploading + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + + // Force the timer used by the animatedImageVisual to tick, + Dali::Timer timer = Timer::New( 0 ); + timer.MockEmitSignal(); + application.SendNotification(); + application.Render(); + atlasRectValue = renderer.GetProperty( renderer.GetPropertyIndex( "uAtlasRect" ) ); + // take into consideration the half pixel correction + DALI_TEST_EQUALS( atlasRectValue.Get(), Vector4(50.5f, 0.5f, 99.5f, 49.5f)/100.f, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + // Force the timer used by the animatedImageVisual to tick, + timer.MockEmitSignal(); + application.SendNotification(); + application.Render(); + atlasRectValue = renderer.GetProperty( renderer.GetPropertyIndex( "uAtlasRect" ) ); + // take into consideration the half pixel correction + DALI_TEST_EQUALS( atlasRectValue.Get(), Vector4(0.5f, 50.5f, 49.5f, 99.5f)/100.f, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + // Force the timer used by the animatedImageVisual to tick, + timer.MockEmitSignal(); + application.SendNotification(); + application.Render(); + atlasRectValue = renderer.GetProperty( renderer.GetPropertyIndex( "uAtlasRect" ) ); + // take into consideration the half pixel correction + DALI_TEST_EQUALS( atlasRectValue.Get(), Vector4(50.5f, 50.5f, 99.5f, 99.5f)/100.f, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + // Test SetOffStage(). + actor.Unparent(); + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + + END_TEST; +} + +int UtcDaliVisualFactoryGetAnimatedImageVisual2(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliVisualFactoryGetAnimatedImageVisual2: Request animated image visual with a Property::Map, test custom wrap mode and pixel area" ); + + const Vector4 pixelArea(-0.5f, -0.5f, 2.f, 2.f); + Property::Map propertyMap; + propertyMap.Add( Visual::Property::TYPE, Visual::IMAGE ) + .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME ) + .Add( ImageVisual::Property::PIXEL_AREA, pixelArea ) + .Add( ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT ) + .Add( ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT ); + + Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap ); + DALI_TEST_CHECK( visual ); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TraceCallStack& texParameterTrace = gl.GetTexParameterTrace(); + texParameterTrace.Enable( true ); + + DummyControl actor = DummyControl::New(); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); + actor.SetSize( 200.0f, 200.0f ); + Stage::GetCurrent().Add( actor ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + + // For animated image visual, the wrapping is handled manually in shader, so the following gl function should not be called + std::stringstream out; + out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_S << ", " << GL_MIRRORED_REPEAT; + DALI_TEST_CHECK( !texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) ); + out.str(""); + out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_T << ", " << GL_REPEAT; + DALI_TEST_CHECK( !texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) ); + + // test the uniforms which used to handle the wrap mode + Renderer renderer = actor.GetRendererAt( 0u ); + DALI_TEST_CHECK( renderer ); + + Property::Value pixelAreaValue = renderer.GetProperty( renderer.GetPropertyIndex( "pixelArea" ) ); + DALI_TEST_EQUALS( pixelAreaValue.Get(), pixelArea, TEST_LOCATION ); + Vector4 pixelAreaUniform; + DALI_TEST_CHECK( gl.GetUniformValue( "pixelArea", pixelAreaUniform ) ); + DALI_TEST_EQUALS( pixelArea, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + Property::Value wrapModeValue = renderer.GetProperty( renderer.GetPropertyIndex( "wrapMode" ) ); + Vector2 wrapMode( WrapMode::MIRRORED_REPEAT-1, WrapMode::REPEAT-1 ); + DALI_TEST_EQUALS( wrapModeValue.Get(), wrapMode, TEST_LOCATION ); + Vector2 wrapModeUniform; + DALI_TEST_CHECK( gl.GetUniformValue( "wrapMode", wrapModeUniform ) ); + DALI_TEST_EQUALS( wrapMode, wrapModeUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION ); + + actor.Unparent( ); + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + + END_TEST; +}