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-ImageVisual.cpp;h=ddcbd5579ee8ed9cf94c02919302405482c9e10d;hp=3b885b85cde8e7e1ff2e80dd6b32ac3a52aa3da7;hb=5af3c7c9147d2697cf2324738d357c52ce9598b9;hpb=5e937a6322849b76d49d5b3f41cb5d91c94acd3e diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp index 3b885b8..ddcbd55 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp @@ -59,7 +59,7 @@ std::vector gReadyIds = {}; void ResourceReadySignal( Control control ) { gResourceReadySignalFired = true; - gReadyIds.push_back(control.GetId()); + gReadyIds.push_back(control.GetProperty< int >( Actor::Property::ID )); } void ClearReadyIds() { @@ -74,7 +74,7 @@ Actor CreateActorWithImageVisual(const Property::Map& map) Visual::Base visual = factory.CreateVisual( map ); DALI_TEST_CHECK( visual ); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); return actor; } @@ -112,7 +112,7 @@ void TestVisualRender( ToolkitTestApplication& application, application.GetPlatform().SetClosestImageSize( Vector2(imageDimensions.GetWidth(), imageDimensions.GetHeight()) ); } - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -181,7 +181,7 @@ int UtcDaliImageVisualPropertyMap(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -237,7 +237,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha01(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -294,7 +294,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -340,7 +340,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void) DummyControlImpl& newDummyImpl = static_cast< DummyControlImpl& >( newActor.GetImplementation() ); newDummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, newVisual ); - newActor.SetSize( 200.f, 200.f ); + newActor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( newActor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( newActor ); @@ -397,7 +397,7 @@ int UtcDaliImageVisualRemoteImageLoad(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -570,39 +570,6 @@ int UtcDaliImageVisualTextureReuse2(void) } -int UtcDaliImageVisualImageHandle(void) -{ - ToolkitTestApplication application; - tet_infoline( "Request image visual with an image handle" ); - - VisualFactory factory = VisualFactory::Get(); - DALI_TEST_CHECK( factory ); - - Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME); - Visual::Base visual = factory.CreateVisual( image ); - - // 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. - - const int width=512; - const int height=513; - - Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD ); - bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height,width, height ); - - TestGlAbstraction& gl = application.GetGlAbstraction(); - TraceCallStack& textureTrace = gl.GetTextureTrace(); - textureTrace.Enable(true); - - DummyControl actor = DummyControl::New(); - TestVisualRender( application, actor, visual, 1u, - ImageDimensions(width, height), - Integration::ResourcePointer(bitmap) ); - - DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); - END_TEST; -} - int UtcDaliImageVisualCustomWrapModePixelArea(void) { ToolkitTestApplication application; @@ -639,7 +606,7 @@ int UtcDaliImageVisualCustomWrapModePixelArea(void) DummyControl actor = DummyControl::New(); DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize(2000, 2000); + actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) ); actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); Stage::GetCurrent().Add( actor ); @@ -717,7 +684,7 @@ int UtcDaliImageVisualCustomWrapModeNoAtlas(void) DummyControl actor = DummyControl::New(); DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize(2000, 2000); + actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) ); actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); Stage::GetCurrent().Add( actor ); @@ -775,7 +742,7 @@ int UtcDaliImageVisualAnimateMixColor(void) Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual ); - actor.SetSize(2000, 2000); + actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) ); actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); actor.SetProperty( Actor::Property::COLOR,Color::BLACK); Stage::GetCurrent().Add(actor); @@ -855,7 +822,7 @@ int UtcDaliImageVisualAnimateOpacity(void) Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual ); - actor.SetSize(2000, 2000); + actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) ); actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); actor.SetProperty( Actor::Property::COLOR,Color::BLACK); Stage::GetCurrent().Add(actor); @@ -967,7 +934,7 @@ int UtcDaliImageVisualAnimateOpacity02(void) Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual ); - actor.SetSize(2000, 2000); + actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) ); actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); actor.SetProperty( Actor::Property::COLOR,Color::BLACK); @@ -1054,7 +1021,7 @@ int UtcDaliImageVisualAnimatePixelArea(void) Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual ); - actor.SetSize(2000, 2000); + actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) ); actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); actor.SetProperty( Actor::Property::COLOR,Color::BLACK); Stage::GetCurrent().Add(actor); @@ -1203,7 +1170,7 @@ int UtcDaliImageVisualSetInvalidAsyncImage(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -1247,7 +1214,7 @@ int UtcDaliImageVisualSetInvalidSyncImage(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -1288,7 +1255,7 @@ int UtcDaliImageVisualSetInvalidRemoteImage(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -1339,7 +1306,7 @@ int UtcDaliImageVisualAlphaMask(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION ); @@ -1394,7 +1361,7 @@ int UtcDaliImageVisualSynchronousLoadAlphaMask(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION ); @@ -1451,7 +1418,7 @@ int UtcDaliImageVisualRemoteAlphaMask(void) DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( actor ); @@ -1505,7 +1472,7 @@ int UtcDaliImageVisualAlphaMaskCrop(void) DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual ); - actor.SetSize( 200.f, 200.f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION ); DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION ); @@ -1548,7 +1515,7 @@ int UtcDaliImageVisualReleasePolicy01(void) dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); imageVisual.Reset(); - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); application.SendNotification(); application.Render(0); @@ -1598,7 +1565,7 @@ int UtcDaliImageVisualReleasePolicy02(void) dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive. - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); application.SendNotification(); application.Render(0); @@ -1649,7 +1616,7 @@ int UtcDaliImageVisualReleasePolicy03(void) dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive. - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); application.SendNotification(); application.Render(0); @@ -1704,7 +1671,7 @@ int UtcDaliImageVisualReleasePolicy04(void) imageVisualNever.Reset(); // reduce ref count so only the control keeps the visual alive. imageVisualDestroyed.Reset(); // reduce ref count so only the control keeps the visual alive. - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); // Test initially zero renderers application.SendNotification(); @@ -1788,7 +1755,7 @@ int UtcDaliImageVisualReleasePolicy06(void) dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive. - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); application.SendNotification(); application.Render(0); @@ -1854,7 +1821,7 @@ int UtcDaliImageVisualReleasePolicy07(void) imageVisualDestroyed.Reset(); // reduce ref count so only the control keeps the visual alive. imageVisualDetached.Reset(); // reduce ref count so only the control keeps the visual alive. - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); // Test initially zero renderers application.SendNotification(); @@ -1894,6 +1861,87 @@ int UtcDaliImageVisualReleasePolicy07(void) END_TEST; } +int UtcDaliImageVisualReleasePolicy08(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliImageVisualReleasePolicy08 Ensure TextureSet is same after detach/attach on stage when texture used the DESTROYED release policy" ); + + tet_infoline( "Create first visual with DESTROYED release policy" ); + Visual::Base imageVisualDestroyed = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::DESTROYED ); + + // Set up trace debug + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + + tet_infoline( "Register visuals with control and ensure it has the only handles" ); + DummyControl actor = DummyControl::New(true); + Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisualDestroyed ); + imageVisualDestroyed.Reset(); // reduce ref count so only the control keeps the visual alive. + + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); + + // Test initially zero renderers + application.SendNotification(); + application.Render(0); + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION ); + textureTrace.Reset(); + + Stage::GetCurrent().Add( actor ); + + // Wait for image to load + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + application.SendNotification(); + application.Render(0); + tet_infoline( "Ensure a texture is created" ); + DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); + textureTrace.Reset(); + + // Ensure TextureSet is same after detach/attach on stage when texture used the DESTROYED release policy + // 1. Get TextureSet + TextureSet textureSetBefore = actor.GetRendererAt( 0u ).GetTextures(); + + // 2.Remove actor from stage. In this case, renderer also is deleted. + tet_infoline( "Remove actor from stage" ); + Stage::GetCurrent().Remove( actor ); + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + application.SendNotification(); + application.Render(); + + tet_infoline( "Ensure a texture is not deleted as visual used the DESTROYED release policy" ); + DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION ); + textureTrace.Reset(); + + // 3.Add actor in stage. In this case, renderer is created. + tet_infoline( "Add actor in stage" ); + Stage::GetCurrent().Add( actor ); + DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); + application.SendNotification(); + application.Render(); + tet_infoline( "Ensure a texture is not created again" ); + DALI_TEST_EQUALS( textureTrace.CountMethod("GenTextures"), 0, TEST_LOCATION ); + textureTrace.Reset(); + + // 4.Compare Texture with before and after. textureSet need to be same because release policy is the DESTROYED. + tet_infoline( "Ensure a textureSet is not deleted because it is used the DESTROYED release policy" ); + TextureSet textureSetAfter = actor.GetRendererAt( 0u ).GetTextures(); + DALI_TEST_CHECK( textureSetBefore == textureSetAfter ); + textureSetBefore.Reset(); + textureSetAfter.Reset(); + + dummyImpl.UnregisterVisual( DummyControl::Property::TEST_VISUAL ); + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + application.SendNotification(); + application.Render(); + DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION ); + + END_TEST; +} + int UtcDaliImageVisualLoadPolicy01(void) { ToolkitTestApplication application; @@ -1937,7 +1985,7 @@ int UtcDaliImageVisualLoadPolicy01(void) dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive. - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); Stage::GetCurrent().Add( actor ); tet_infoline( "Ensure nothing triggers another load as texure already loaded" ); const unsigned int TIME_OUT_3_SECONDS = 3; @@ -1991,7 +2039,7 @@ int UtcDaliImageVisualLoadPolicy02(void) dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive. - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); Stage::GetCurrent().Add( actor ); tet_infoline( "Allow image time to load" ); DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); @@ -2031,7 +2079,7 @@ int UtcDaliImageVisualLoadPolicy03(void) DummyControl actor = DummyControl::New(true); actor.ResourceReadySignal().Connect( &ResourceReadySignal); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); tet_infoline( "Create visual with IMMEDIATE load policy" ); Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE ); @@ -2069,7 +2117,7 @@ int UtcDaliImageVisualLoadPolicy04(void) DummyControl actor = DummyControl::New(true); actor.ResourceReadySignal().Connect( &ResourceReadySignal); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); tet_infoline( "Create visual with IMMEDIATE load policy" ); Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE ); @@ -2098,7 +2146,7 @@ int UtcDaliImageVisualLoadPolicy04(void) tet_infoline( "Registering visual this should trigger the loading signal as is already image loaded for previous control" ); dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 ); imageVisual2.Reset(); // reduce ref count so only the control keeps the visual alive. - actor2.SetSize(200.f, 200.f); + actor2.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 0 ), true, TEST_LOCATION ); // Not expecting any further loading as texture is being reused. DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION ); @@ -2119,7 +2167,7 @@ int UtcDaliImageVisualLoadPolicy05(void) DummyControl actor = DummyControl::New(true); actor.ResourceReadySignal().Connect( &ResourceReadySignal); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); Stage::GetCurrent().Add( actor ); tet_infoline( "Create visual with ATTACHED load policy" ); @@ -2149,7 +2197,7 @@ int UtcDaliImageVisualLoadPolicy05(void) tet_infoline( "Registering visual this should trigger the loading signal as is already image loaded for previous control" ); dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 ); imageVisual2.Reset(); // reduce ref count so only the control keeps the visual alive. - actor2.SetSize(200.f, 200.f); + actor2.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 0 ), true, TEST_LOCATION ); // Not expecting any further loading as texture is being reused. DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION ); @@ -2239,7 +2287,7 @@ int UtcDaliImageVisualCustomShader(void) Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() ); dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual ); - dummy.SetSize( 200.f, 200.f ); + dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) ); dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Stage::GetCurrent().Add( dummy ); @@ -2271,7 +2319,7 @@ int UtcDaliImageVisualCustomShader(void) DummyControl dummy1 = DummyControl::New( true ); Impl::DummyControl& dummyImpl1 = static_cast< Impl::DummyControl& >( dummy1.GetImplementation() ); dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual1 ); - dummy1.SetSize( 200, 200 ); + dummy1.SetProperty( Actor::Property::SIZE, Vector2( 200, 200 ) ); dummy1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Stage::GetCurrent().Add( dummy1 ); @@ -2295,7 +2343,7 @@ void ResourceReadyLoadNext( Control control ) static int callNumber = 0; gResourceReadySignalFired = true; - gReadyIds.push_back(control.GetId()); + gReadyIds.push_back(control.GetProperty< int >( Actor::Property::ID )); if( callNumber == 0 ) { @@ -2328,10 +2376,10 @@ int UtcDaliImageVisualLoadReady01(void) tet_infoline( "Create a control and connect to resource ready signal" ); DummyControl actor = DummyControl::New(true); - int actor1Id = actor.GetId(); + int actor1Id = actor.GetProperty< int >( Actor::Property::ID ); actor.ResourceReadySignal().Connect( &ResourceReadySignal); Impl::DummyControl& dummyImpl = static_cast(actor.GetImplementation()); - actor.SetSize(200.f, 200.f); + actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); Stage::GetCurrent().Add(actor); tet_infoline( "Create visual with IMMEDIATE load policy" ); @@ -2359,14 +2407,14 @@ int UtcDaliImageVisualLoadReady01(void) Visual::Base imageVisual2 = CreateVisualWithPolicy( TEST_BROKEN_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE ); DummyControl actor2 = DummyControl::New(true); - int actor2Id = actor2.GetId(); + int actor2Id = actor2.GetProperty< int >( Actor::Property::ID ); Impl::DummyControl& dummyImpl2 = static_cast(actor2.GetImplementation()); actor2.ResourceReadySignal().Connect( &ResourceReadyLoadNext); tet_infoline( "Registering visual this should trigger the ready signal when the image fails to load" ); dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 ); - actor2.SetSize(200.f, 200.f); + actor2.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) ); Stage::GetCurrent().Add(actor2); tet_infoline( "Wait for loading thread to finish");