*/
// CLASS HEADER
-#include "border-renderer.h"
+#include "border-visual.h"
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
//INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/renderer-factory-impl.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
-#include <dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-factory-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-factory-cache.h>
+#include <dali-toolkit/internal/controls/renderers/visual-string-constants.h>
+#include <dali-toolkit/internal/controls/renderers/visual-data-impl.h>
namespace Dali
{
);
}
-BorderRenderer::BorderRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache ),
+BorderVisual::BorderVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache ),
mBorderColor( Color::TRANSPARENT ),
mBorderSize( 0.f ),
mBorderColorIndex( Property::INVALID_INDEX ),
{
}
-BorderRenderer::~BorderRenderer()
+BorderVisual::~BorderVisual()
{
}
-void BorderRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void BorderVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
Property::Value* color = propertyMap.Find( COLOR_NAME );
if( !( color && color->Get(mBorderColor) ) )
{
- DALI_LOG_ERROR( "Fail to provide a border color to the BorderRenderer object" );
+ DALI_LOG_ERROR( "Fail to provide a border color to the BorderVisual object" );
}
Property::Value* size = propertyMap.Find( SIZE_NAME );
if( !( size && size->Get(mBorderSize) ) )
{
- DALI_LOG_ERROR( "Fail to provide a border size to the BorderRenderer object" );
+ DALI_LOG_ERROR( "Fail to provide a border size to the BorderVisual object" );
}
Property::Value* antiAliasing = propertyMap.Find( ANTI_ALIASING );
}
}
-void BorderRenderer::SetClipRect( const Rect<int>& clipRect )
+void BorderVisual::SetClipRect( const Rect<int>& clipRect )
{
- ControlRenderer::SetClipRect( clipRect );
+ Visual::SetClipRect( clipRect );
//ToDo: renderer responds to the clipRect change
}
-void BorderRenderer::DoSetOnStage( Actor& actor )
+void BorderVisual::DoSetOnStage( Actor& actor )
{
InitializeRenderer();
mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( SIZE_NAME, mBorderSize );
}
-void BorderRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void BorderVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, BORDER_RENDERER );
map.Insert( SIZE_NAME, mBorderSize );
}
-void BorderRenderer::InitializeRenderer()
+void BorderVisual::InitializeRenderer()
{
- Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::BORDER_GEOMETRY );
+ Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::BORDER_GEOMETRY );
if( !geometry )
{
geometry = CreateBorderGeometry();
- mFactoryCache.SaveGeometry( RendererFactoryCache::BORDER_GEOMETRY, geometry );
+ mFactoryCache.SaveGeometry( VisualFactoryCache::BORDER_GEOMETRY, geometry );
}
}
-void BorderRenderer::SetBorderColor(const Vector4& color)
+void BorderVisual::SetBorderColor(const Vector4& color)
{
mBorderColor = color;
}
}
-void BorderRenderer::SetBorderSize( float size )
+void BorderVisual::SetBorderSize( float size )
{
mBorderSize = size;
}
}
-void BorderRenderer::RequireAntiAliasing( bool antiAliasing )
+void BorderVisual::RequireAntiAliasing( bool antiAliasing )
{
if( mAntiAliasing != antiAliasing )
{
}
}
-Shader BorderRenderer::GetBorderShader()
+Shader BorderVisual::GetBorderShader()
{
Shader shader;
if( mAntiAliasing )
{
- shader = mFactoryCache.GetShader( RendererFactoryCache::BORDER_SHADER_ANTI_ALIASING );
+ shader = mFactoryCache.GetShader( VisualFactoryCache::BORDER_SHADER_ANTI_ALIASING );
if( !shader )
{
shader = Shader::New( VERTEX_SHADER_ANTI_ALIASING, FRAGMENT_SHADER_ANTI_ALIASING );
- mFactoryCache.SaveShader( RendererFactoryCache::BORDER_SHADER_ANTI_ALIASING, shader );
+ mFactoryCache.SaveShader( VisualFactoryCache::BORDER_SHADER_ANTI_ALIASING, shader );
}
}
else
{
- shader = mFactoryCache.GetShader( RendererFactoryCache::BORDER_SHADER );
+ shader = mFactoryCache.GetShader( VisualFactoryCache::BORDER_SHADER );
if( !shader )
{
shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
- mFactoryCache.SaveShader( RendererFactoryCache::BORDER_SHADER, shader );
+ mFactoryCache.SaveShader( VisualFactoryCache::BORDER_SHADER, shader );
}
}
* |/ |/ | \|
* 12-13-14-15
*/
-Geometry BorderRenderer::CreateBorderGeometry()
+Geometry BorderVisual::CreateBorderGeometry()
{
const float halfWidth = 0.5f;
const float halfHeight = 0.5f;