+ quadGeometry.SetIndexBuffer( &meshRecord.mMesh.mIndices[0], meshRecord.mMesh.mIndices.Size() );
+
+ TextureSet textureSet( mGlyphManager.GetTextures( meshRecord.mAtlasId ) );
+
+ // Choose the shader to use.
+ const bool isColorShader = ( STYLE_DROP_SHADOW != style ) && ( Pixel::BGRA8888 == mGlyphManager.GetPixelFormat( meshRecord.mAtlasId ) );
+ Shader shader;
+ if( isColorShader )
+ {
+ // The glyph is an emoji and is not a shadow.
+ if( !mShaderRgba )
+ {
+ mShaderRgba = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_RGBA );
+ }
+ shader = mShaderRgba;
+ }
+ else
+ {
+ // The glyph is text or a shadow.
+ if( !mShaderL8 )
+ {
+ mShaderL8 = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER_L8 );
+ }
+ shader = mShaderL8;
+ }
+
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "defaultColor[%f, %f, %f, %f ]\n", defaultColor.r, defaultColor.g, defaultColor.b, defaultColor.a );
+
+ Dali::Property::Index shaderTextColorIndex = shader.RegisterProperty( "textColorAnimatable", defaultColor );
+
+ if ( animatablePropertyIndex != Property::INVALID_INDEX )
+ {
+ // create constraint for the animatable text's color Property with textColorAnimatable in the shader.
+ if( shaderTextColorIndex )
+ {
+ Constraint constraint = Constraint::New<Vector4>( shader, shaderTextColorIndex, EqualToConstraint() );
+ constraint.AddSource( Source( textControl, animatablePropertyIndex ) );
+ constraint.Apply();
+ }
+ }
+ else
+ {
+ // If not animating the text colour then set to 1's so shader uses the current vertex color
+ shader.RegisterProperty( "textColorAnimatable", Vector4(1.0, 1.0, 1.0, 1.0 ) );
+ }
+
+ Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, shader );
+ renderer.SetTextures( textureSet );
+ renderer.SetProperty( Dali::Renderer::Property::BLEND_MODE, BlendMode::ON );
+ renderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, DepthIndex::CONTENT + mDepth );