END_TEST;
}
+int UtcDaliVisualTextVisualDisableEnable(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliVisualTextVisualDisableEnable Ensure Text visible can be re-enabled" );
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert( Visual::Property::TYPE, DevelVisual::TEXT );
+ propertyMap.Insert( "mixColor", Color::WHITE );
+ propertyMap.Insert( "renderingBackend", static_cast<int>( Toolkit::Text::DEFAULT_RENDERING_BACKEND ) );
+ propertyMap.Insert( "enableMarkup", false );
+ propertyMap.Insert( "text", "Hello world" );
+ propertyMap.Insert( "fontFamily", "TizenSans" );
+
+ Property::Map fontStyleMapSet;
+ fontStyleMapSet.Insert( "weight", "bold" );
+ propertyMap.Insert( "fontStyle", fontStyleMapSet );
+
+ propertyMap.Insert( "pointSize", 12.f );
+ propertyMap.Insert( "multiLine", true );
+ propertyMap.Insert( "horizontalAlignment", "CENTER" );
+ propertyMap.Insert( "verticalAlignment", "CENTER" );
+ propertyMap.Insert( "textColor", Color::RED );
+ Visual::Base textVisual = factory.CreateVisual( propertyMap );
+ textVisual.SetDepthIndex( 1.f );
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
+ DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 0, TEST_LOCATION );
+
+ dummyControl.SetSize(200.f, 200.f);
+ dummyControl.SetParentOrigin( ParentOrigin::CENTER );
+
+ Stage::GetCurrent().Add( dummyControl );
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 1, TEST_LOCATION );
+
+ dummyImpl.EnableVisual( DummyControl::Property::TEST_VISUAL, false );
+
+ DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 0, TEST_LOCATION );
+
+ dummyImpl.EnableVisual( DummyControl::Property::TEST_VISUAL, true );
+
+ DALI_TEST_EQUALS( dummyControl.GetRendererCount(), 1, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliVisualPremultipliedAlpha(void)
{
ToolkitTestApplication application;
mImpl->mRenderer = Renderer::New( geometry, shader );
mImpl->mRenderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, Toolkit::DepthIndex::TEXT );
- UpdateRenderer();
+ UpdateRenderer( true ); // Renderer needs textures and to be added to control
}
void TextVisual::DoSetOffStage( Actor& actor )
void TextVisual::OnSetTransform()
{
- UpdateRenderer();
+ UpdateRenderer( false );
}
void TextVisual::DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue )
}
}
-void TextVisual::UpdateRenderer()
+void TextVisual::UpdateRenderer( bool initializeRendererAndTexture )
{
Actor control = mControl.GetHandle();
if( !control )
const Text::Controller::UpdateTextType updateTextType = mController->Relayout( relayoutSize );
- if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) )
+ if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) || initializeRendererAndTexture )
{
// Removes the texture set.
RemoveTextureSet();