#include <dali-toolkit/internal/text/rendering/vector-based/vector-based-renderer.h>
// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/devel-api/rendering/renderer.h>
-#include <dali/devel-api/rendering/geometry.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/public-api/rendering/renderer.h>
#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/glyph-run.h>
vertices.PushBack( meshVertex );
}
-void AddTriangle( Vector<unsigned int>& indices, unsigned int v0, unsigned int v1, unsigned int v2 )
+void AddTriangle( Vector<unsigned short>& indices, unsigned int v0, unsigned int v1, unsigned int v2 )
{
indices.PushBack( v0 );
indices.PushBack( v1 );
VectorBlobAtlas& atlas,
Dali::TextAbstraction::FontClient& fontClient,
Vector< Vertex2D >& vertices,
- Vector< unsigned int >& indices,
+ Vector< unsigned short >& indices,
const Vector4* const colorsBuffer,
const ColorIndex* const colorIndicesBuffer,
const Vector4& defaultColor )
mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
mQuadVertexFormat[ "aTexCoord" ] = Property::VECTOR2;
mQuadVertexFormat[ "aColor" ] = Property::VECTOR4;
- mQuadIndexFormat[ "indices" ] = Property::INTEGER;
}
Actor mActor; ///< The actor parent which renders the text
TextAbstraction::FontClient mFontClient; ///> The font client used to supply glyph information
Property::Map mQuadVertexFormat; ///> Describes the vertex format for text
- Property::Map mQuadIndexFormat; ///> Describes the index format for text
Shader mShaderEffect;
return Text::RendererPtr( new VectorBasedRenderer() );
}
-Actor VectorBasedRenderer::Render( Text::ViewInterface& view, int /*depth*/ )
+Actor VectorBasedRenderer::Render( Text::ViewInterface& view,
+ Actor textControl,
+ Property::Index animatablePropertyIndex,
+ float& alignmentOffset,
+ int /*depth*/ )
{
UnparentAndReset( mImpl->mActor );
numberOfGlyphs = view.GetGlyphs( glyphs.Begin(),
positions.Begin(),
+ alignmentOffset,
0u,
numberOfGlyphs );
+
glyphs.Resize( numberOfGlyphs );
positions.Resize( numberOfGlyphs );
const Vector4& defaultColor = view.GetTextColor();
Vector< Vertex2D > vertices;
- Vector< unsigned int > indices;
+ Vector< unsigned short > indices;
const Vector2& controlSize = view.GetControlSize();
- float xOffset = controlSize.width * -0.5f;
+ float xOffset = -alignmentOffset + controlSize.width * -0.5f;
float yOffset = controlSize.height * -0.5f;
if( ! mImpl->mAtlas ||
if( 0 != vertices.Count() )
{
PropertyBuffer quadVertices = PropertyBuffer::New( mImpl->mQuadVertexFormat );
- PropertyBuffer quadIndices = PropertyBuffer::New( mImpl->mQuadIndexFormat );
quadVertices.SetData( &vertices[ 0 ], vertices.Size() );
- quadIndices.SetData( &indices[ 0 ], indices.Size() );
+
Geometry quadGeometry = Geometry::New();
quadGeometry.AddVertexBuffer( quadVertices );
- quadGeometry.SetIndexBuffer( quadIndices );
+ quadGeometry.SetIndexBuffer( &indices[ 0 ], indices.Size() );
TextureSet texture = mImpl->mAtlas->GetTextureSet();