X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fdecorator%2Ftext-decorator.cpp;h=bb393ff811ac81fefd70390add5c8b6c1578fbbc;hp=bc27da3ae8ac0de33f9697c52d871d546584dfa4;hb=a2de9cf491172cd5da9dc9ed60b17683dab6d7bc;hpb=1ef48207a956ca5a78cad6f953074953fbcf9f60 diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index bc27da3..bb393ff 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -33,7 +33,6 @@ #include // INTERNAL INCLUDES -#include #include #include #include @@ -285,8 +284,7 @@ struct Decorator::Impl : public ConnectionTracker { 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(); } @@ -529,7 +527,7 @@ struct Decorator::Impl : public ConnectionTracker { 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 ); } @@ -637,7 +635,6 @@ struct Decorator::Impl : public ConnectionTracker 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 ); @@ -1049,26 +1046,18 @@ struct Decorator::Impl : public ConnectionTracker indices.PushBack( v + 3 ); } - if( mQuadVertices ) - { - mQuadVertices.SetSize( vertices.Size() ); - } - else + if( ! mQuadVertices ) { - mQuadVertices = PropertyBuffer::New( mQuadVertexFormat, vertices.Size() ); + mQuadVertices = PropertyBuffer::New( mQuadVertexFormat ); } - if( mQuadIndices ) - { - mQuadIndices.SetSize( indices.Size() ); - } - else + if( ! mQuadIndices ) { - mQuadIndices = PropertyBuffer::New( mQuadIndexFormat, indices.Size() ); + mQuadIndices = PropertyBuffer::New( mQuadIndexFormat ); } - mQuadVertices.SetData( &vertices[ 0 ] ); - mQuadIndices.SetData( &indices[ 0 ] ); + mQuadVertices.SetData( &vertices[ 0 ], vertices.Size() ); + mQuadIndices.SetData( &indices[ 0 ], indices.Size() ); if( !mQuadGeometry ) { @@ -1079,7 +1068,7 @@ struct Decorator::Impl : public ConnectionTracker if( !mHighlightRenderer ) { - mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightMaterial ); + mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightShader ); mHighlightActor.AddRenderer( mHighlightRenderer ); } } @@ -1091,7 +1080,7 @@ struct Decorator::Impl : public ConnectionTracker 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. } } } @@ -1663,7 +1652,7 @@ struct Decorator::Impl : public ConnectionTracker 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;