- Actor actor = Actor::New();
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
- textureTrace.Enable(true);
- TraceCallStack& texParameterTrace = gl.GetTexParameterTrace();
- texParameterTrace.Enable( true );
-
- actor.SetSize( 200.f, 200.f );
- Stage::GetCurrent().Add( actor );
- visual.SetOnStage( 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<Vector4>(), pixelArea, TEST_LOCATION );
- Vector4 pixelAreaUniform;
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "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<Vector2>(), wrapMode, TEST_LOCATION );
- Vector2 wrapModeUniform;
- DALI_TEST_CHECK( gl.GetUniformValue<Vector2>( "wrapMode", wrapModeUniform ) );
- DALI_TEST_EQUALS( wrapMode, wrapModeUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION );
-
- visual.SetOffStage( actor );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
-
- END_TEST;
-}
-
-int UtcDaliVisualFactoryGetImageVisual4(void)