-int UtcDaliRenderableActorSetGetBlendEquation(void)
-{
- TestApplication application;
- TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
-
- tet_infoline("Testing Dali::RenderableActor::SetBlendEquation()");
-
- BufferImage img = BufferImage::New( 1,1 );
- ImageActor actor = ImageActor::New( img );
- Stage::GetCurrent().Add( actor );
- application.SendNotification();
- application.Render();
-
- // Test the defaults as documented int blending.h
- {
- BlendingEquation::Type equationRgb( BlendingEquation::SUBTRACT );
- BlendingEquation::Type equationAlpha( BlendingEquation::SUBTRACT );
- actor.GetBlendEquation( equationRgb, equationAlpha );
- DALI_TEST_EQUALS( BlendingEquation::ADD, equationRgb, TEST_LOCATION );
- DALI_TEST_EQUALS( BlendingEquation::ADD, equationAlpha, TEST_LOCATION );
- }
-
- // Test the single blending equation setting
- {
- actor.SetBlendEquation( BlendingEquation::REVERSE_SUBTRACT );
- BlendingEquation::Type equationRgba( BlendingEquation::SUBTRACT );
- actor.GetBlendEquation( equationRgba, equationRgba );
- DALI_TEST_EQUALS( BlendingEquation::REVERSE_SUBTRACT, equationRgba, TEST_LOCATION );
- }
-
- actor.SetBlendEquation( BlendingEquation::REVERSE_SUBTRACT, BlendingEquation::REVERSE_SUBTRACT );
-
- // Test that Set was successful
- {
- BlendingEquation::Type equationRgb( BlendingEquation::SUBTRACT );
- BlendingEquation::Type equationAlpha( BlendingEquation::SUBTRACT );
- actor.GetBlendEquation( equationRgb, equationAlpha );
- DALI_TEST_EQUALS( BlendingEquation::REVERSE_SUBTRACT, equationRgb, TEST_LOCATION );
- DALI_TEST_EQUALS( BlendingEquation::REVERSE_SUBTRACT, equationAlpha, TEST_LOCATION );
- }
-
- // Render & check GL commands
- application.SendNotification();
- application.Render();
- DALI_TEST_EQUALS( (GLenum)GL_FUNC_REVERSE_SUBTRACT, glAbstraction.GetLastBlendEquationRgb(), TEST_LOCATION );
- DALI_TEST_EQUALS( (GLenum)GL_FUNC_REVERSE_SUBTRACT, glAbstraction.GetLastBlendEquationAlpha(), TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliRenderableActorSetGetBlendColor(void)
-{
- TestApplication application;
- TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
-
- tet_infoline("Testing Dali::RenderableActor::SetBlendColor()");
-
- BufferImage img = BufferImage::New( 1,1 );
- ImageActor actor = ImageActor::New( img );
- Stage::GetCurrent().Add( actor );
- application.SendNotification();
- application.Render();
-
- // Test the defaults as documented int blending.h
- DALI_TEST_EQUALS( Vector4::ZERO, actor.GetBlendColor(), TEST_LOCATION );
-
- actor.SetBlendColor( Color::RED );
-
- // Test that Set was successful
- DALI_TEST_EQUALS( Color::RED, actor.GetBlendColor(), TEST_LOCATION );
-
- // Render & check GL commands
- application.SendNotification();
- application.Render();
- DALI_TEST_EQUALS( Color::RED, glAbstraction.GetLastBlendColor(), TEST_LOCATION );
- END_TEST;
-}
-