#include <dali/devel-api/rendering/renderer.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/internal/controls/image-view/image-view-impl.h>
mNotifyEndOfScroll( false )
{
mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
- mQuadIndexFormat[ "indices" ] = Property::INTEGER;
- mHighlightMaterial = Material::New( Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ) );
-
+ mHighlightShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
SetupTouchEvents();
}
{
cursor = Control::New();
cursor.SetBackgroundColor( color );
- cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one.
+ cursor.SetParentOrigin( ParentOrigin::TOP_LEFT );
cursor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
}
mActiveLayer.SetParentOrigin( ParentOrigin::CENTER );
mActiveLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mActiveLayer.SetPositionInheritanceMode( USE_PARENT_POSITION );
// Add the active layer telling the controller it doesn't need clipping.
mController.AddDecoration( mActiveLayer, false );
if( !mHighlightQuadList.empty() )
{
Vector< Vector2 > vertices;
- Vector< unsigned int> indices;
+ Vector< unsigned short> indices;
Vector2 vertex;
std::vector<QuadCoordinates>::iterator iter = mHighlightQuadList.begin();
indices.PushBack( v + 3 );
}
- if( mQuadVertices )
- {
- mQuadVertices.SetSize( vertices.Size() );
- }
- else
- {
- mQuadVertices = PropertyBuffer::New( mQuadVertexFormat, vertices.Size() );
- }
-
- if( mQuadIndices )
- {
- mQuadIndices.SetSize( indices.Size() );
- }
- else
+ if( ! mQuadVertices )
{
- mQuadIndices = PropertyBuffer::New( mQuadIndexFormat, indices.Size() );
+ mQuadVertices = PropertyBuffer::New( mQuadVertexFormat );
}
- mQuadVertices.SetData( &vertices[ 0 ] );
- mQuadIndices.SetData( &indices[ 0 ] );
+ mQuadVertices.SetData( &vertices[ 0 ], vertices.Size() );
if( !mQuadGeometry )
{
mQuadGeometry = Geometry::New();
mQuadGeometry.AddVertexBuffer( mQuadVertices );
}
- mQuadGeometry.SetIndexBuffer( mQuadIndices );
+ mQuadGeometry.SetIndexBuffer( &indices[ 0 ], indices.Size() );
if( !mHighlightRenderer )
{
- mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightMaterial );
+ mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightShader );
mHighlightActor.AddRenderer( mHighlightRenderer );
}
}
if( mHighlightRenderer )
{
- mHighlightRenderer.SetDepthIndex( mTextDepth - 2u ); // text is rendered at mTextDepth and text's shadow at mTextDepth -1u.
+ mHighlightRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mTextDepth - 2 ); // text is rendered at mTextDepth and text's shadow at mTextDepth -1u.
}
}
}
Actor mHighlightActor; ///< Actor to display highlight
Renderer mHighlightRenderer;
- Material mHighlightMaterial; ///< Material used for highlight
+ Shader mHighlightShader; ///< Shader used for highlight
Property::Map mQuadVertexFormat;
- Property::Map mQuadIndexFormat;
PopupImpl mCopyPastePopup;
TextSelectionPopup::Buttons mEnabledPopupButtons; /// Bit mask of currently enabled Popup buttons
TextSelectionPopupCallbackInterface& mTextSelectionPopupCallbackInterface;
HandleImpl mHandle[HANDLE_TYPE_COUNT];
PropertyBuffer mQuadVertices;
- PropertyBuffer mQuadIndices;
Geometry mQuadGeometry;
QuadContainer mHighlightQuadList; ///< Sub-selections that combine to create the complete selection highlight