X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftext%2Ftext-visual.cpp;h=2b5215ac49e337d5390ce3cb67b96d2da59c4680;hp=280fac2132a8440e5c0a8c374a82c201f64cf8bf;hb=fb390b3f5e576e2fc11b3755f4dc9c3ff2150d90;hpb=139f1932acd42bbc9ad3c89c86d4f500052e1ef1 diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index 280fac2..2b5215a 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -128,12 +128,13 @@ const char* FRAGMENT_SHADER_ATLAS_CLAMP = DALI_COMPOSE_SHADER( uniform sampler2D sTexture;\n uniform mediump vec4 uAtlasRect;\n uniform lowp vec4 uColor;\n - uniform lowp vec4 mixColor;\n + uniform lowp vec3 mixColor;\n + uniform lowp float opacity;\n \n void main()\n {\n mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n - gl_FragColor = texture2D( sTexture, texCoord ) * uColor * mixColor;\n + gl_FragColor = texture2D( sTexture, texCoord ) * uColor * vec4( mixColor, opacity );\n }\n ); @@ -247,7 +248,7 @@ void TextVisual::DoCreatePropertyMap( Property::Map& map ) const GetFontStyleProperty( mController, value, Text::FontStyle::DEFAULT ); map.Insert( Toolkit::TextVisual::Property::FONT_STYLE, value ); - map.Insert( Toolkit::TextVisual::Property::POINT_SIZE, mController->GetDefaultPointSize() ); + map.Insert( Toolkit::TextVisual::Property::POINT_SIZE, mController->GetDefaultFontSize( Text::Controller::POINT_SIZE ) ); map.Insert( Toolkit::TextVisual::Property::MULTI_LINE, mController->IsMultiLineEnabled() ); @@ -260,6 +261,16 @@ void TextVisual::DoCreatePropertyMap( Property::Map& map ) const map.Insert( Toolkit::TextVisual::Property::ENABLE_MARKUP, mController->IsMarkupProcessorEnabled() ); } +void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const +{ + map.Clear(); + map.Insert( Toolkit::DevelVisual::Property::TYPE, Toolkit::DevelVisual::TEXT ); + std::string text; + mController->GetText( text ); + map.Insert( Toolkit::TextVisual::Property::TEXT, text ); +} + + TextVisual::TextVisual( VisualFactoryCache& factoryCache ) : Visual::Base( factoryCache ), mController( Text::Controller::New() ), @@ -368,9 +379,9 @@ void TextVisual::DoSetProperty( Dali::Property::Index index, const Dali::Propert case Toolkit::TextVisual::Property::POINT_SIZE: { const float pointSize = propertyValue.Get(); - if( !Equals( mController->GetDefaultPointSize(), pointSize ) ) + if( !Equals( mController->GetDefaultFontSize( Text::Controller::POINT_SIZE ), pointSize ) ) { - mController->SetDefaultPointSize( pointSize ); + mController->SetDefaultFontSize( pointSize, Text::Controller::POINT_SIZE ); } break; } @@ -446,6 +457,7 @@ void TextVisual::UpdateRenderer( bool initializeRendererAndTexture ) } // Nothing else to do if the relayout size is zero. + ResourceReady(); return; } @@ -499,6 +511,9 @@ void TextVisual::UpdateRenderer( bool initializeRendererAndTexture ) mImpl->mRenderer.SetTextures( textureSet ); control.AddRenderer( mImpl->mRenderer ); + + // Text rendered and ready to display + ResourceReady(); } } }