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
);
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() );
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() ),
}
mImpl->mRenderer = Renderer::New( geometry, shader );
- mImpl->mRenderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, Toolkit::DepthIndex::TEXT );
+ mImpl->mRenderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, Toolkit::DepthIndex::CONTENT );
UpdateRenderer( true ); // Renderer needs textures and to be added to control
}
case Toolkit::TextVisual::Property::POINT_SIZE:
{
const float pointSize = propertyValue.Get<float>();
- 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;
}
mImpl->mRenderer.SetTextures( textureSet );
control.AddRenderer( mImpl->mRenderer );
+
+ // Text rendered and ready to display
+ ResourceReady();
}
}
}