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=706f8da98addf4c371c60a42c5295f175ae74913;hp=e07933afb01f4cb1dc348ff8c845362caaf19bc7;hb=5352461cce9d31badf2c916da4b8bceaacfbeb86;hpb=863460d5c6f88c007f0c14356a102b5b4a724d1c diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp index e07933a..706f8da 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp @@ -773,12 +773,15 @@ int UtcDaliImageVisualAnimateMixColor(void) Animation animation = dummyImpl.CreateTransition( transition ); - blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::ON, TEST_LOCATION ); - animation.AnimateTo( Property(actor, Actor::Property::COLOR), Color::WHITE ); animation.Play(); + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + glAbstraction.EnableEnableDisableCallTrace( true ); + TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace(); + std::ostringstream blendStr; + blendStr << GL_BLEND; + application.SendNotification(); application.Render(0); // Ensure animation starts application.Render(2000u); // Halfway point @@ -788,16 +791,21 @@ int UtcDaliImageVisualAnimateMixColor(void) DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue( "uColor", Vector4( 0.5f, 0.5f, 0.5f, 0.75f ) ), true, TEST_LOCATION ); DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue( "mixColor", testColor ), true, TEST_LOCATION ); + DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) ); + + glEnableStack.Reset(); + application.Render(2000u); // Halfway point between blue and white DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue( "uColor", Vector4( 1.0f, 1.0f, 1.0f, 0.5f ) ), true, TEST_LOCATION ); DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue( "mixColor", Vector3( TARGET_MIX_COLOR ) ), true, TEST_LOCATION ); - TestMixColor( visual, Visual::Property::MIX_COLOR, TARGET_MIX_COLOR ); + // GL_BLEND should not be changed: Keep enabled + DALI_TEST_CHECK( !glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) ); + DALI_TEST_CHECK( !glEnableStack.FindMethodAndParams( "Disable", blendStr.str().c_str() ) ); - blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::ON, TEST_LOCATION ); + TestMixColor( visual, Visual::Property::MIX_COLOR, TARGET_MIX_COLOR ); END_TEST; } @@ -828,9 +836,16 @@ int UtcDaliImageVisualAnimateOpacity(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); - Renderer renderer = actor.GetRendererAt(0); - Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::ON, TEST_LOCATION ); + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + glAbstraction.EnableEnableDisableCallTrace( true ); + TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace(); + std::ostringstream blendStr; + blendStr << GL_BLEND; + + application.SendNotification(); + application.Render(); + + DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) ); { tet_infoline( "Test that the opacity can be increased to full via animation, and that the blend mode is set appropriately at the start and end of the animation." ); @@ -849,6 +864,8 @@ int UtcDaliImageVisualAnimateOpacity(void) Animation animation = dummyImpl.CreateTransition( transition ); animation.Play(); + glEnableStack.Reset(); + application.SendNotification(); application.Render(0); // Ensure animation starts application.Render(2000u); // Halfway point through animation @@ -864,8 +881,8 @@ int UtcDaliImageVisualAnimateOpacity(void) DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) ); DALI_TEST_EQUALS( color.a, 1.0f, TEST_LOCATION ); - blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::AUTO, TEST_LOCATION ); + DALI_TEST_CHECK( !glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) ); + DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Disable", blendStr.str().c_str() ) ); } @@ -886,8 +903,7 @@ int UtcDaliImageVisualAnimateOpacity(void) Animation animation = dummyImpl.CreateTransition( transition ); animation.Play(); - blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::ON, TEST_LOCATION ); + glEnableStack.Reset(); application.SendNotification(); application.Render(0); // Ensure animation starts @@ -898,17 +914,21 @@ int UtcDaliImageVisualAnimateOpacity(void) DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) ); DALI_TEST_EQUALS( color.a, 0.55f, TEST_LOCATION ); + DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) ); + + glEnableStack.Reset(); + application.Render(2016u); // end application.SendNotification(); DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) ); DALI_TEST_EQUALS( color.a, 0.1f, TEST_LOCATION ); - blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::ON, TEST_LOCATION ); + // GL_BLEND should not be changed: Keep enabled + DALI_TEST_CHECK( !glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) ); + DALI_TEST_CHECK( !glEnableStack.FindMethodAndParams( "Disable", blendStr.str().c_str() ) ); } - END_TEST; } @@ -975,26 +995,32 @@ int UtcDaliImageVisualAnimateOpacity02(void) animation = dummyImpl.CreateTransition( transition ); animation.Play(); + TestGlAbstraction& glAbstraction = application.GetGlAbstraction(); + glAbstraction.EnableEnableDisableCallTrace( true ); + TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace(); + std::ostringstream blendStr; + blendStr << GL_BLEND; + application.SendNotification(); application.Render(0); // Ensure animation starts application.Render(2000u); // Halfway point through animation application.SendNotification(); // Handle any signals - blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::ON, TEST_LOCATION ); + DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) ); Vector4 color; DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) ); DALI_TEST_EQUALS( color.a, 0.5f, TEST_LOCATION ); + glEnableStack.Reset(); + application.Render(2001u); // end application.SendNotification(); // ensure animation finished signal is sent DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) ); DALI_TEST_EQUALS( color.a, 1.0f, TEST_LOCATION ); - blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( blendModeValue.Get(), (int)BlendMode::AUTO, TEST_LOCATION ); + DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Disable", blendStr.str().c_str() ) ); END_TEST; }