X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-RendererFactory.cpp;h=6707da64305365fd65fa6c369b8b5ced253b20c4;hb=8e902a37f200809376dc5746e0bcb9d40dd79049;hp=a173f2105c540c3b114e9e552ac3adfc09604be6;hpb=6386529919293a632327b5f867ca25ce03fa94c8;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp index a173f21..6707da6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp @@ -572,6 +572,9 @@ int UtcDaliRendererFactoryGetImageRenderer1(void) const int width=512; const int height=513; + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD ); bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height,width, height ); @@ -580,10 +583,7 @@ int UtcDaliRendererFactoryGetImageRenderer1(void) ImageDimensions(width, height), Integration::ResourcePointer( bitmap ) ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); controlRenderer.SetOffStage( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); @@ -612,14 +612,15 @@ int UtcDaliRendererFactoryGetImageRenderer2(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 ); + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(width, height), Integration::ResourcePointer(bitmap) ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); END_TEST; } @@ -649,14 +650,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer1(void) DALI_TEST_CHECK( controlRenderer ); Actor actor = Actor::New(); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), ninePatchResource ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); } propertyMap.Insert( "borderOnly", true ); @@ -666,14 +669,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer1(void) DALI_TEST_CHECK( controlRenderer ); Actor actor = Actor::New(); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), ninePatchResource ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); } END_TEST; @@ -708,14 +713,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer2(void) DALI_TEST_CHECK( controlRenderer ); Actor actor = Actor::New(); + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), ninePatchResource ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); controlRenderer.SetOffStage( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); @@ -727,15 +734,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer2(void) ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap ); DALI_TEST_CHECK( controlRenderer ); + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); Actor actor = Actor::New(); TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), ninePatchResource ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); controlRenderer.SetOffStage( actor ); DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); @@ -764,14 +772,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer3(void) DALI_TEST_CHECK( controlRenderer ); Actor actor = Actor::New(); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), ninePatchResource ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); END_TEST; } @@ -801,14 +811,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer4(void) DALI_TEST_CHECK( controlRenderer ); Actor actor = Actor::New(); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(ninePatchImageWidth, ninePatchImageHeight), ninePatchResource ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); END_TEST; } @@ -831,14 +843,16 @@ int UtcDaliRendererFactoryGetNPatchRendererN1(void) //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 ); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(), Integration::ResourcePointer(bitmap) ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); END_TEST; } @@ -865,14 +879,16 @@ int UtcDaliRendererFactoryGetNPatchRendererN2(void) //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 ); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + TestControlRendererRender( application, actor, controlRenderer, 1u, ImageDimensions(), Integration::ResourcePointer(bitmap) ); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); END_TEST; } @@ -886,6 +902,10 @@ int UtcDaliRendererFactoryGetSvgRenderer(void) ControlRenderer controlRenderer = factory.GetControlRenderer( TEST_SVG_FILE_NAME ); DALI_TEST_CHECK( controlRenderer ); + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + Actor actor = Actor::New(); actor.SetSize( 200.f, 200.f ); Stage::GetCurrent().Add( actor ); @@ -907,14 +927,12 @@ int UtcDaliRendererFactoryGetSvgRenderer(void) DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); DALI_TEST_CHECK( actor.GetRendererAt(0u).GetMaterial().GetNumberOfTextures() == 1 ); + // waiting for the resource uploading application.SendNotification(); application.Render(); - TestGlAbstraction& gl = application.GetGlAbstraction(); - int textureUnit = -1; - DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) ); - DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); END_TEST; }