utc-Dali-SuperBlurView.cpp
utc-Dali-Toolkit.cpp
utc-Dali-Model3dView.cpp
- utc-Dali-ControlRenderer.cpp
- utc-Dali-RendererFactory.cpp
- utc-Dali-DebugRenderer.cpp
+ utc-Dali-Visual.cpp
+ utc-Dali-VisualFactory.cpp
+ utc-Dali-DebugVisual.cpp
utc-Dali-ImageAtlas.cpp
utc-Dali-VideoView.cpp
)
*/
#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/geometry.h>
const char* TEST_IMAGE_FILE_NAME = "image_01.jpg";
const char* TEST_NPATCH_FILE_NAME = "image_01.9.jpg";
-bool IsDebugRenderer( ControlRenderer& renderer )
+bool IsDebugVisual( Visual& renderer )
{
- bool isDebugRendererType = false;
+ bool isDebugVisualType = false;
bool isGeometryLineType = false;
Property::Map propertyMap;
Property::Value* typeValue = propertyMap.Find( "rendererType", Property::STRING );
if ( typeValue )
{
- isDebugRendererType = ( typeValue->Get<std::string>() == "DEBUG" );
+ isDebugVisualType = ( typeValue->Get<std::string>() == "DEBUG" );
}
Actor actor = Actor::New();
Geometry geometry = actor.GetRendererAt( 0 ).GetGeometry();
isGeometryLineType = ( geometry.GetGeometryType() == Geometry::LINES );
- return isDebugRendererType && isGeometryLineType;
+ return isDebugVisualType && isGeometryLineType;
}
}
test_return_value = TET_PASS;
}
-int UtcDaliDebugRendererGetRenderer1(void)
+int UtcDaliDebugVisualGetRenderer1(void)
{
EnvironmentVariable::SetTestingEnvironmentVariable(true);
ToolkitTestApplication application;
- tet_infoline( "UtcDaliDebugRendererGetRenderer1: Request renderer with a Property::Map" );
+ tet_infoline( "UtcDaliDebugVisualGetRenderer1: Request renderer with a Property::Map" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
// Test that color renderer is replaced with debug renderer
Property::Map propertyMap1;
propertyMap1.Insert("rendererType", "COLOR");
propertyMap1.Insert("mixColor", Color::BLUE);
- ControlRenderer colorRenderer = factory.CreateControlRenderer(propertyMap1);
+ Visual colorRenderer = factory.CreateVisual(propertyMap1);
DALI_TEST_CHECK( colorRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( colorRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( colorRenderer ) );
// Test that border renderer is replaced with debug renderer
Property::Map propertyMap2;
propertyMap2.Insert("rendererType", "BORDER");
propertyMap2.Insert("borderColor", Color::BLUE);
propertyMap2.Insert("borderSize", 2.f);
- ControlRenderer borderRenderer = factory.CreateControlRenderer(propertyMap2);
+ Visual borderRenderer = factory.CreateVisual(propertyMap2);
DALI_TEST_CHECK( borderRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( borderRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( borderRenderer ) );
// Test that gradient renderer is replaced with debug renderer
Property::Map propertyMap3;
stopColors.PushBack( Color::RED );
stopColors.PushBack( Color::GREEN );
propertyMap3.Insert("stopColor", stopColors);
- ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap3);
+ Visual gradientRenderer = factory.CreateVisual(propertyMap3);
DALI_TEST_CHECK( gradientRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( gradientRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( gradientRenderer ) );
// Test that image renderer is replaced with debug renderer
Property::Map propertyMap4;
propertyMap4.Insert( "rendererType", "IMAGE" );
propertyMap4.Insert( "url", TEST_IMAGE_FILE_NAME );
- ControlRenderer imageRenderer = factory.CreateControlRenderer( propertyMap4 );
+ Visual imageRenderer = factory.CreateVisual( propertyMap4 );
DALI_TEST_CHECK( imageRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( imageRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( imageRenderer ) );
// Test that n patch renderer is replaced with debug renderer
Property::Map propertyMap5;
propertyMap5.Insert( "rendererType", "IMAGE" );
propertyMap5.Insert( "url", TEST_NPATCH_FILE_NAME );
- ControlRenderer nPatchRenderer = factory.CreateControlRenderer( propertyMap4 );
+ Visual nPatchRenderer = factory.CreateVisual( propertyMap4 );
DALI_TEST_CHECK( nPatchRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( nPatchRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( nPatchRenderer ) );
EnvironmentVariable::SetTestingEnvironmentVariable(false);
END_TEST;
}
-int UtcDaliDebugRendererGetRenderer2(void)
+int UtcDaliDebugVisualGetRenderer2(void)
{
EnvironmentVariable::SetTestingEnvironmentVariable(true);
ToolkitTestApplication application;
- tet_infoline( "UtcDaliDebugRendererGetRenderer2: Request renderer with various parameters" );
+ tet_infoline( "UtcDaliDebugVisualGetRenderer2: Request renderer with various parameters" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
// Test that color renderer is replaced with debug renderer
map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = Color::CYAN;
- ControlRenderer colorRenderer = factory.CreateControlRenderer( map);
+ Visual colorRenderer = factory.CreateVisual( map);
DALI_TEST_CHECK( colorRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( colorRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( colorRenderer ) );
// Test that border renderer is replaced with debug renderer
map.Clear();
map[ "rendererType" ] = "BORDER";
map[ "borderColor" ] = Color::GREEN;
map[ "borderSize" ] = 2.f;
- ControlRenderer borderRenderer = factory.CreateControlRenderer( map );
+ Visual borderRenderer = factory.CreateVisual( map );
DALI_TEST_CHECK( borderRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( borderRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( borderRenderer ) );
// Test that image renderer is replaced with debug renderer
Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
- ControlRenderer imageRenderer = factory.CreateControlRenderer( image );
+ Visual imageRenderer = factory.CreateVisual( image );
DALI_TEST_CHECK( imageRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( imageRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( imageRenderer ) );
// Test that n patch renderer is replaced with debug renderer
- ControlRenderer nPatchRenderer = factory.CreateControlRenderer( TEST_NPATCH_FILE_NAME, ImageDimensions() );
+ Visual nPatchRenderer = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() );
DALI_TEST_CHECK( nPatchRenderer );
- DALI_TEST_CHECK( IsDebugRenderer( nPatchRenderer ) );
+ DALI_TEST_CHECK( IsDebugVisual( nPatchRenderer ) );
EnvironmentVariable::SetTestingEnvironmentVariable(false);
END_TEST;
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
using namespace Dali;
using namespace Toolkit;
{
Actor solidColorActor = Actor::New();
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Dali::Property::Map map;
map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = color;
- ControlRenderer colorRenderer = factory.CreateControlRenderer( map );
+ Visual colorRenderer = factory.CreateVisual( map );
colorRenderer.SetOnStage( solidColorActor );
return solidColorActor;
#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/texture-set.h>
#include <dali/public-api/rendering/shader.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
using namespace Dali;
using namespace Dali::Toolkit;
const char* TEST_RESOURCE_LOCATION = TEST_RESOURCE_DIR "/";
}
-void dali_control_renderer_startup(void)
+void dali_visual_startup(void)
{
test_return_value = TET_UNDEF;
}
-void dali_control_renderer_cleanup(void)
+void dali_visual_cleanup(void)
{
test_return_value = TET_PASS;
}
-int UtcDaliControlRendererCopyAndAssignment(void)
+int UtcDaliVisualCopyAndAssignment(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererCopyAndAssignment" );
+ tet_infoline( "UtcDaliVisualCopyAndAssignment" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual visual = factory.CreateVisual( propertyMap );
- ControlRenderer controlRendererCopy( controlRenderer );
- DALI_TEST_CHECK(controlRenderer == controlRendererCopy);
+ Visual visualCopy( visual );
+ DALI_TEST_CHECK(visual == visualCopy);
- ControlRenderer emptyControlRenderer;
- ControlRenderer emptyControlRendererCopy( emptyControlRenderer );
- DALI_TEST_CHECK(emptyControlRenderer == emptyControlRendererCopy);
+ Visual emptyVisual;
+ Visual emptyVisualCopy( emptyVisual );
+ DALI_TEST_CHECK(emptyVisual == emptyVisualCopy);
- ControlRenderer controlRendererEquals;
- controlRendererEquals = controlRenderer;
- DALI_TEST_CHECK(controlRenderer == controlRendererEquals);
+ Visual visualEquals;
+ visualEquals = visual;
+ DALI_TEST_CHECK(visual == visualEquals);
- ControlRenderer emptyControlRendererEquals;
- emptyControlRendererEquals = emptyControlRenderer;
- DALI_TEST_CHECK( emptyControlRenderer == emptyControlRendererEquals );
+ Visual emptyVisualEquals;
+ emptyVisualEquals = emptyVisual;
+ DALI_TEST_CHECK( emptyVisual == emptyVisualEquals );
//self assignment
- controlRenderer = controlRenderer;
- DALI_TEST_CHECK( controlRenderer = controlRendererCopy );
+ visual = visual;
+ DALI_TEST_CHECK( visual = visualCopy );
END_TEST;
}
-int UtcDaliControlRendererSetGetDepthIndex(void)
+int UtcDaliVisualSetGetDepthIndex(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererSetDepthIndex" );
+ tet_infoline( "UtcDaliVisualSetDepthIndex" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual visual = factory.CreateVisual( propertyMap );
- controlRenderer.SetDepthIndex( 1.f );
+ visual.SetDepthIndex( 1.f );
Actor actor = Actor::New();
actor.SetSize(200.f, 200.f);
Stage::GetCurrent().Add( actor );
- controlRenderer.SetOnStage( actor );
+ visual.SetOnStage( actor );
int depthIndex = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
DALI_TEST_EQUALS( depthIndex, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( controlRenderer.GetDepthIndex(), 1.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( visual.GetDepthIndex(), 1.f, TEST_LOCATION );
- controlRenderer.SetDepthIndex( -1.f );
+ visual.SetDepthIndex( -1.f );
depthIndex = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
DALI_TEST_EQUALS( depthIndex, -1, TEST_LOCATION );
- DALI_TEST_EQUALS( controlRenderer.GetDepthIndex(), -1.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( visual.GetDepthIndex(), -1.f, TEST_LOCATION );
END_TEST;
}
-int UtcDaliControlRendererSize(void)
+int UtcDaliVisualSize(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetNaturalSize" );
+ tet_infoline( "UtcDaliVisualGetNaturalSize" );
- RendererFactory factory = RendererFactory::Get();
- Vector2 rendererSize( 20.f, 30.f );
+ VisualFactory factory = VisualFactory::Get();
+ Vector2 visualSize( 20.f, 30.f );
Vector2 naturalSize;
- // color renderer
+ // color colorVisual
Dali::Property::Map map;
map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = Color::MAGENTA;
- ControlRenderer colorRenderer = factory.CreateControlRenderer( map );
- colorRenderer.SetSize( rendererSize );
- DALI_TEST_EQUALS( colorRenderer.GetSize(), rendererSize, TEST_LOCATION );
- colorRenderer.GetNaturalSize(naturalSize);
+ Visual colorVisual = factory.CreateVisual( map );
+ colorVisual.SetSize( visualSize );
+ DALI_TEST_EQUALS( colorVisual.GetSize(), visualSize, TEST_LOCATION );
+ colorVisual.GetNaturalSize(naturalSize);
DALI_TEST_EQUALS( naturalSize, Vector2::ZERO, TEST_LOCATION );
- // image renderer
+ // image visual
Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
- ControlRenderer imageRenderer = factory.CreateControlRenderer( image );
- imageRenderer.SetSize( rendererSize );
- DALI_TEST_EQUALS( imageRenderer.GetSize(), rendererSize, TEST_LOCATION );
- imageRenderer.GetNaturalSize(naturalSize);
+ Visual imageVisual = factory.CreateVisual( image );
+ imageVisual.SetSize( visualSize );
+ DALI_TEST_EQUALS( imageVisual.GetSize(), visualSize, TEST_LOCATION );
+ imageVisual.GetNaturalSize(naturalSize);
DALI_TEST_EQUALS( naturalSize, Vector2(100.f, 200.f), TEST_LOCATION );
- // n patch renderer
+ // n patch visual
TestPlatformAbstraction& platform = application.GetPlatform();
Vector2 testSize(80.f, 160.f);
platform.SetClosestImageSize(testSize);
image = ResourceImage::New(TEST_NPATCH_FILE_NAME);
- ControlRenderer nPatchRenderer = factory.CreateControlRenderer( image );
- nPatchRenderer.SetSize( rendererSize );
- DALI_TEST_EQUALS( nPatchRenderer.GetSize(), rendererSize, TEST_LOCATION );
- nPatchRenderer.GetNaturalSize(naturalSize);
+ Visual nPatchVisual = factory.CreateVisual( image );
+ nPatchVisual.SetSize( visualSize );
+ DALI_TEST_EQUALS( nPatchVisual.GetSize(), visualSize, TEST_LOCATION );
+ nPatchVisual.GetNaturalSize(naturalSize);
DALI_TEST_EQUALS( naturalSize, testSize, TEST_LOCATION );
- // border renderer
+ // border visual
float borderSize = 5.f;
map.Clear();
map[ "rendererType" ] = "BORDER";
map[ "borderColor" ] = Color::RED;
map[ "borderSize" ] = borderSize;
- ControlRenderer borderRenderer = factory.CreateControlRenderer( map );
- borderRenderer.SetSize( rendererSize );
- DALI_TEST_EQUALS( borderRenderer.GetSize(), rendererSize, TEST_LOCATION );
- borderRenderer.GetNaturalSize(naturalSize);
+ Visual borderVisual = factory.CreateVisual( map );
+ borderVisual.SetSize( visualSize );
+ DALI_TEST_EQUALS( borderVisual.GetSize(), visualSize, TEST_LOCATION );
+ borderVisual.GetNaturalSize(naturalSize);
DALI_TEST_EQUALS( naturalSize, Vector2::ZERO, TEST_LOCATION );
- // gradient renderer
+ // gradient gradientVisual
Property::Map propertyMap;
propertyMap.Insert("rendererType", "GRADIENT");
Vector2 start(-1.f, -1.f);
stopColors.PushBack( Color::RED );
stopColors.PushBack( Color::GREEN );
propertyMap.Insert("stopColor", stopColors);
- ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap);
- gradientRenderer.SetSize( rendererSize );
- DALI_TEST_EQUALS( gradientRenderer.GetSize(), rendererSize, TEST_LOCATION );
- gradientRenderer.GetNaturalSize(naturalSize);
+ Visual gradientVisual = factory.CreateVisual(propertyMap);
+ gradientVisual.SetSize( visualSize );
+ DALI_TEST_EQUALS( gradientVisual.GetSize(), visualSize, TEST_LOCATION );
+ gradientVisual.GetNaturalSize(naturalSize);
DALI_TEST_EQUALS( naturalSize, Vector2::ZERO,TEST_LOCATION );
- //svg renderer
- ControlRenderer svgRenderer = factory.CreateControlRenderer( TEST_SVG_FILE_NAME, ImageDimensions() );
- svgRenderer.SetSize( rendererSize );
- DALI_TEST_EQUALS( svgRenderer.GetSize(), rendererSize, TEST_LOCATION );
- svgRenderer.GetNaturalSize(naturalSize);
+ //svg visual
+ Visual svgVisual = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions() );
+ svgVisual.SetSize( visualSize );
+ DALI_TEST_EQUALS( svgVisual.GetSize(), visualSize, TEST_LOCATION );
+ svgVisual.GetNaturalSize(naturalSize);
// TEST_SVG_FILE:
// <svg width="100" height="100">
// <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
END_TEST;
}
-int UtcDaliControlRendererSetOnOffStage(void)
+int UtcDaliVisualSetOnOffStage(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererSetDepthIndex" );
+ tet_infoline( "UtcDaliVisualSetDepthIndex" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual visual = factory.CreateVisual( propertyMap );
Actor actor = Actor::New();
actor.SetSize(200.f, 200.f);
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
- controlRenderer.SetOnStage( actor );
+ visual.SetOnStage( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
-int UtcDaliControlRendererRemoveAndReset(void)
+int UtcDaliVisualRemoveAndReset(void)
{
ToolkitTestApplication application;
- tet_infoline( "intUtcDaliControlRendererRemoveAndReset" );
+ tet_infoline( "intUtcDaliVisualRemoveAndReset" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Actor actor = Actor::New();
actor.SetSize(200.f, 200.f);
Stage::GetCurrent().Add( actor );
- ControlRenderer imageRenderer;
+ Visual imageVisual;
// test calling RemoveAndReset with an empty handle
try
{
- imageRenderer.RemoveAndReset( actor );
+ imageVisual.RemoveAndReset( actor );
tet_result(TET_PASS);
}
catch (DaliException& exception)
}
Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
- imageRenderer = factory.CreateControlRenderer(image);
- DALI_TEST_CHECK( imageRenderer );
+ imageVisual = factory.CreateVisual(image);
+ DALI_TEST_CHECK( imageVisual );
- imageRenderer.SetOnStage( actor );
+ imageVisual.SetOnStage( actor );
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- imageRenderer.RemoveAndReset( actor );
+ imageVisual.RemoveAndReset( actor );
application.SendNotification();
application.Render(0);
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); // renderer is removed from actor
- DALI_TEST_CHECK( !imageRenderer ); // control renderer is reset
+ DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); // visual is removed from actor
+ DALI_TEST_CHECK( !imageVisual ); // visual is reset
END_TEST;
}
-int UtcDaliControlRendererGetPropertyMap1(void)
+int UtcDaliVisualGetPropertyMap1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap1: ColorRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap1: ColorVisual" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", Color::BLUE);
- ControlRenderer colorRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual colorVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
- colorRenderer.CreatePropertyMap( resultMap );
+ colorVisual.CreatePropertyMap( resultMap );
Property::Value* typeValue = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( typeValue );
// change the blend color
Actor actor;
- colorRenderer.RemoveAndReset( actor );
+ colorVisual.RemoveAndReset( actor );
propertyMap["mixColor"] = Color::CYAN;
- colorRenderer = factory.CreateControlRenderer( propertyMap );
- colorRenderer.CreatePropertyMap( resultMap );
+ colorVisual = factory.CreateVisual( propertyMap );
+ colorVisual.CreatePropertyMap( resultMap );
colorValue = resultMap.Find( "mixColor", Property::VECTOR4 );
DALI_TEST_CHECK( colorValue );
END_TEST;
}
-int UtcDaliControlRendererGetPropertyMap2(void)
+int UtcDaliVisualGetPropertyMap2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap2: BorderRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap2: BorderVisual" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert("rendererType", "BORDER");
propertyMap.Insert("borderColor", Color::BLUE);
propertyMap.Insert("borderSize", 5.f);
- ControlRenderer borderRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual borderVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
- borderRenderer.CreatePropertyMap( resultMap );
+ borderVisual.CreatePropertyMap( resultMap );
- // check the property values from the returned map from control renderer
+ // check the property values from the returned map from visual
Property::Value* typeValue = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( typeValue );
DALI_TEST_CHECK( typeValue->Get<std::string>() == "BORDER" );
propertyMap1[ "rendererType" ] = "BORDER";
propertyMap1[ "borderColor" ] = Color::CYAN;
propertyMap1[ "borderSize" ] = 10.0f;
- borderRenderer = factory.CreateControlRenderer( propertyMap1 );
- borderRenderer.CreatePropertyMap( resultMap );
+ borderVisual = factory.CreateVisual( propertyMap1 );
+ borderVisual.CreatePropertyMap( resultMap );
typeValue = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( typeValue );
END_TEST;
}
-int UtcDaliControlRendererGetPropertyMap3(void)
+int UtcDaliVisualGetPropertyMap3(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap3: linear GradientRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap3: linear GradientVisual" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
stopColors.PushBack( Color::GREEN );
propertyMap.Insert("stopColor", stopColors);
- ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap);
+ Visual gradientVisual = factory.CreateVisual(propertyMap);
Property::Map resultMap;
- gradientRenderer.CreatePropertyMap( resultMap );
+ gradientVisual.CreatePropertyMap( resultMap );
- // check the property values from the returned map from control renderer
+ // check the property values from the returned map from visual
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<std::string>() == "GRADIENT" );
END_TEST;
}
-int UtcDaliControlRendererGetPropertyMap4(void)
+int UtcDaliVisualGetPropertyMap4(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap4: radial GradientRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap4: radial GradientVisual" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
stopColors.PushBack( Color::GREEN );
propertyMap.Insert("stopColor", stopColors);
- ControlRenderer gradientRenderer = factory.CreateControlRenderer(propertyMap);
- DALI_TEST_CHECK( gradientRenderer );
+ Visual gradientVisual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( gradientVisual );
Property::Map resultMap;
- gradientRenderer.CreatePropertyMap( resultMap );
+ gradientVisual.CreatePropertyMap( resultMap );
- // check the property values from the returned map from control renderer
+ // check the property values from the returned map from visual
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<std::string>() == "GRADIENT" );
END_TEST;
}
-int UtcDaliControlRendererGetPropertyMap5(void)
+int UtcDaliVisualGetPropertyMap5(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap5: ImageRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap5: ImageVisual" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_IMAGE_FILE_NAME );
propertyMap.Insert( "samplingMode", "BOX_THEN_NEAREST" );
propertyMap.Insert( "synchronousLoading", true );
- ControlRenderer imageRenderer = factory.CreateControlRenderer(propertyMap);
- DALI_TEST_CHECK( imageRenderer );
+ Visual imageVisual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( imageVisual );
Property::Map resultMap;
- imageRenderer.CreatePropertyMap( resultMap );
+ imageVisual.CreatePropertyMap( resultMap );
- // check the property values from the returned map from control renderer
+ // check the property values from the returned map from visual
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<std::string>() == "IMAGE" );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<bool>() == true );
- // Get an image renderer with an image handle, and test the default property values
+ // Get an image visual with an image handle, and test the default property values
Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
- imageRenderer = factory.CreateControlRenderer(image);
- imageRenderer.CreatePropertyMap( resultMap );
+ imageVisual = factory.CreateVisual(image);
+ imageVisual.CreatePropertyMap( resultMap );
value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
END_TEST;
}
-int UtcDaliControlRendererGetPropertyMap6(void)
+int UtcDaliVisualGetPropertyMap6(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap6: NPatchRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap6: NPatchVisual" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_NPATCH_FILE_NAME );
propertyMap.Insert( "borderOnly", true );
- ControlRenderer nPatchRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual nPatchVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
- nPatchRenderer.CreatePropertyMap( resultMap );
+ nPatchVisual.CreatePropertyMap( resultMap );
- // check the property values from the returned map from control renderer
+ // check the property values from the returned map from visual
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<std::string>() == "IMAGE" );
END_TEST;
}
-int UtcDaliControlRendererGetPropertyMap7(void)
+int UtcDaliVisualGetPropertyMap7(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap7: SvgRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap7: SvgVisual" );
- // request SvgRenderer with a property map
- RendererFactory factory = RendererFactory::Get();
+ // request SvgVisual with a property map
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_SVG_FILE_NAME );
- ControlRenderer svgRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual svgVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
- svgRenderer.CreatePropertyMap( resultMap );
- // check the property values from the returned map from control renderer
+ svgVisual.CreatePropertyMap( resultMap );
+ // check the property values from the returned map from a visual
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<std::string>() == "IMAGE" );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<std::string>() == TEST_SVG_FILE_NAME );
- // request SvgRenderer with an URL
- ControlRenderer svgRenderer2 = factory.CreateControlRenderer( TEST_SVG_FILE_NAME, ImageDimensions() );
+ // request SvgVisual with an URL
+ Visual svgVisual2 = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions() );
resultMap.Clear();
- svgRenderer2.CreatePropertyMap( resultMap );
- // check the property values from the returned map from control renderer
+ svgVisual2.CreatePropertyMap( resultMap );
+ // check the property values from the returned map from a visual
value = resultMap.Find( "rendererType", Property::STRING );
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<std::string>() == "IMAGE" );
END_TEST;
}
-//Mesh renderer
-int UtcDaliControlRendererGetPropertyMap8(void)
+//Mesh visual
+int UtcDaliVisualGetPropertyMap8(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap8: MeshRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap8: MeshVisual" );
- //Request MeshRenderer using a property map.
- RendererFactory factory = RendererFactory::Get();
+ //Request MeshVisual using a property map.
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_LOCATION );
propertyMap.Insert( "shaderType", "TEXTURELESS" );
propertyMap.Insert( "lightPosition", Vector3( 5.0f, 10.0f, 15.0f) );
- ControlRenderer meshRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual meshVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
- meshRenderer.CreatePropertyMap( resultMap );
+ meshVisual.CreatePropertyMap( resultMap );
//Check values in the result map are identical to the initial map's values.
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
END_TEST;
}
-//Primitive shape renderer
-int UtcDaliControlRendererGetPropertyMap9(void)
+//Primitive shape visual
+int UtcDaliVisualGetPropertyMap9(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliControlRendererGetPropertyMap9: PrimitiveRenderer" );
+ tet_infoline( "UtcDaliVisualGetPropertyMap9: PrimitiveVisual" );
Vector4 color = Vector4( 1.0, 0.8, 0.6, 1.0);
Vector3 dimensions = Vector3( 1.0, 2.0, 3.0 );
- //Request PrimitiveRenderer using a property map.
- RendererFactory factory = RendererFactory::Get();
+ //Request PrimitiveVisual using a property map.
+ VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "CUBE" );
propertyMap.Insert( "bevelPercentage", 0.3f );
propertyMap.Insert( "bevelSmoothness", 0.6f );
propertyMap.Insert( "lightPosition", Vector3( 5.0f, 10.0f, 15.0f) );
- ControlRenderer primitiveRenderer = factory.CreateControlRenderer( propertyMap );
+ Visual primitiveVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
- primitiveRenderer.CreatePropertyMap( resultMap );
+ primitiveVisual.CreatePropertyMap( resultMap );
//Check values in the result map are identical to the initial map's values.
Property::Value* value = resultMap.Find( "rendererType", Property::STRING );
#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/texture-set.h>
#include <dali/public-api/rendering/shader.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
using namespace Dali;
using namespace Dali::Toolkit;
return resourcePtr;
}
-void TestControlRendererRender( ToolkitTestApplication& application,
+void TestVisualRender( ToolkitTestApplication& application,
Actor& actor,
- ControlRenderer& controlRenderer,
+ Visual& visual,
std::size_t expectedSamplers = 0,
ImageDimensions imageDimensions = ImageDimensions(),
Integration::ResourcePointer resourcePtr = Integration::ResourcePointer())
actor.SetSize( 200.f, 200.f );
Stage::GetCurrent().Add( actor );
- controlRenderer.SetSize( Vector2(200.f, 200.f) );
- controlRenderer.SetOnStage( actor );
+ visual.SetSize( Vector2(200.f, 200.f) );
+ visual.SetOnStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
} // namespace
-void dali_renderer_factory_startup(void)
+void dali_visual_factory_startup(void)
{
test_return_value = TET_UNDEF;
}
-void dali_renderer_factory_cleanup(void)
+void dali_visual_factory_cleanup(void)
{
test_return_value = TET_PASS;
}
-int UtcDaliRendererFactoryGet(void)
+int UtcDaliVisualFactoryGet(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactory" );
+ tet_infoline( "UtcDaliVisualFactory" );
//Register type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "RendererFactory" );
+ type = TypeRegistry::Get().GetTypeInfo( "VisualFactory" );
DALI_TEST_CHECK( type );
BaseHandle handle = type.CreateInstance();
DALI_TEST_CHECK( handle );
- RendererFactory factory;
- factory = RendererFactory::Get();
+ VisualFactory factory;
+ factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
- RendererFactory newFactory = RendererFactory::Get();
+ VisualFactory newFactory = VisualFactory::Get();
DALI_TEST_CHECK( newFactory );
// Check that renderer factory is a singleton
END_TEST;
}
-int UtcDaliRendererFactoryCopyAndAssignment(void)
+int UtcDaliVisualFactoryCopyAndAssignment(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryCopyAndAssignment" );
- RendererFactory factory = RendererFactory::Get();
+ tet_infoline( "UtcDaliVisualFactoryCopyAndAssignment" );
+ VisualFactory factory = VisualFactory::Get();
- RendererFactory factoryCopy( factory );
+ VisualFactory factoryCopy( factory );
DALI_TEST_CHECK(factory == factoryCopy);
- RendererFactory emptyFactory;
- RendererFactory emptyFactoryCopy( emptyFactory );
+ VisualFactory emptyFactory;
+ VisualFactory emptyFactoryCopy( emptyFactory );
DALI_TEST_CHECK(emptyFactory == emptyFactoryCopy);
- RendererFactory factoryEquals;
+ VisualFactory factoryEquals;
factoryEquals = factory;
DALI_TEST_CHECK(factory == factoryEquals);
- RendererFactory emptyFactoryEquals;
+ VisualFactory emptyFactoryEquals;
emptyFactoryEquals = emptyFactory;
DALI_TEST_CHECK( emptyFactory == emptyFactoryEquals );
END_TEST;
}
-int UtcDaliRendererFactoryGetColorRenderer1(void)
+int UtcDaliVisualFactoryGetColorVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetColorRenderer1: Request color renderer with a Property::Map" );
+ tet_infoline( "UtcDaliVisualFactoryGetColorVisual1: Request color visual with a Property::Map" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
propertyMap.Insert("rendererType", "COLOR");
propertyMap.Insert("mixColor", testColor);
- ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
- TestControlRendererRender( application, actor, controlRenderer );
+ TestVisualRender( application, actor, visual );
Vector4 actualValue(Vector4::ZERO);
TestGlAbstraction& gl = application.GetGlAbstraction();
END_TEST;
}
-int UtcDaliRendererFactoryGetColorRenderer2(void)
+int UtcDaliVisualFactoryGetColorVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetColorRenderer2: Request color renderer with a Vector4" );
+ tet_infoline( "UtcDaliVisualFactoryGetColorVisual2: Request color visual with a Vector4" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
Dali::Property::Map map;
map[ "rendererType" ] = "COLOR";
map[ "mixColor" ] = testColor;
- ControlRenderer controlRenderer = factory.CreateControlRenderer( map );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( map );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
- TestControlRendererRender( application, actor, controlRenderer );
+ TestVisualRender( application, actor, visual );
Vector4 actualValue(Vector4::ZERO);
TestGlAbstraction& gl = application.GetGlAbstraction();
DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
-int UtcDaliRendererFactoryGetBorderRenderer1(void)
+int UtcDaliVisualFactoryGetBorderVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetBorderRenderer1: Request border renderer with a Property::Map" );
+ tet_infoline( "UtcDaliVisualFactoryGetBorderVisual1: Request border visual with a Property::Map" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
propertyMap.Insert("borderColor", testColor);
propertyMap.Insert("borderSize", testSize);
- ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
actor.SetSize(200.f, 200.f);
Stage::GetCurrent().Add( actor );
- controlRenderer.SetSize(Vector2(200.f, 200.f));
- controlRenderer.SetOnStage( actor );
+ visual.SetSize(Vector2(200.f, 200.f));
+ visual.SetOnStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
DALI_TEST_CHECK( gl.GetUniformValue<float>( "borderSize", actualSize ) );
DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
-int UtcDaliRendererFactoryGetBorderRenderer2(void)
+int UtcDaliVisualFactoryGetBorderVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetBorderRenderer2: Request border renderer with a borderSize and a borderColor" );
+ tet_infoline( "UtcDaliVisualFactoryGetBorderVisual2: Request border visual with a borderSize and a borderColor" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Vector4 testColor( 1.f, 0.5f, 0.3f, 1.f );
propertyMap[ "rendererType" ] = "BORDER";
propertyMap[ "borderColor" ] = testColor;
propertyMap[ "borderSize" ] = testSize;
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
actor.SetSize(200.f, 200.f);
Stage::GetCurrent().Add( actor );
- controlRenderer.SetSize(Vector2(200.f, 200.f));
- controlRenderer.SetOnStage( actor );
+ visual.SetSize(Vector2(200.f, 200.f));
+ visual.SetOnStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
DALI_TEST_CHECK( gl.GetUniformValue<float>( "borderSize", actualSize ) );
DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
// enable the anti-aliasing
Dali::Property::Map map;
map[ "borderColor" ] = testColor;
map[ "borderSize" ] = testSize;
map[ "antiAliasing" ] = true;
- controlRenderer = factory.CreateControlRenderer( map );
- controlRenderer.SetOnStage( actor );
+ visual = factory.CreateVisual( map );
+ visual.SetOnStage( actor );
application.SendNotification();
application.Render(0);
END_TEST;
}
-int UtcDaliRendererFactoryGetLinearGradientRenderer(void)
+int UtcDaliVisualFactoryGetLinearGradientVisual(void)
{
ToolkitTestApplication application;
- tet_infoline("UtcDaliRendererFactoryGetRadialGradientRenderer");
+ tet_infoline("UtcDaliVisualFactoryGetRadialGradientVisual");
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
stopColors.PushBack( Color::GREEN );
propertyMap.Insert("stopColor", stopColors);
- ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( visual );
// A lookup texture is generated and pass to shader as sampler
Actor actor = Actor::New();
- TestControlRendererRender( application, actor, controlRenderer, 1u );
+ TestVisualRender( application, actor, visual, 1u );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
-int UtcDaliRendererFactoryGetRadialGradientRenderer(void)
+int UtcDaliVisualFactoryGetRadialGradientVisual(void)
{
ToolkitTestApplication application;
- tet_infoline("UtcDaliRendererFactoryGetRadialGradientRenderer");
+ tet_infoline("UtcDaliVisualFactoryGetRadialGradientVisual");
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
stopColors.PushBack( Color::GREEN );
propertyMap.Insert("stopColor", stopColors);
- ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( visual );
// A lookup texture is generated and pass to shader as sampler
Actor actor = Actor::New();
- TestControlRendererRender( application, actor, controlRenderer, 1u );
+ TestVisualRender( application, actor, visual, 1u );
Matrix3 alignMatrix( radius, 0.f, 0.f, 0.f, radius, 0.f, center.x, center.y, 1.f );
alignMatrix.Invert();
END_TEST;
}
-int UtcDaliRendererFactoryDefaultOffsetsGradientRenderer(void)
+int UtcDaliVisualFactoryDefaultOffsetsGradientVisual(void)
{
ToolkitTestApplication application;
- tet_infoline("UtcDaliRendererFactoryGetRadialGradientRenderer");
+ tet_infoline("UtcDaliVisualFactoryGetRadialGradientVisual");
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
stopColors.PushBack( Color::GREEN );
propertyMap.Insert("stopColor", stopColors);
- ControlRenderer controlRenderer = factory.CreateControlRenderer(propertyMap);
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK( visual );
// A lookup texture is generated and pass to shader as sampler
Actor actor = Actor::New();
- TestControlRendererRender( application, actor, controlRenderer, 1u );
+ TestVisualRender( application, actor, visual, 1u );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
-int UtcDaliRendererFactoryGetImageRenderer1(void)
+int UtcDaliVisualFactoryGetImageVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetImageRenderer1: Request image renderer with a Property::Map" );
+ tet_infoline( "UtcDaliVisualFactoryGetImageVisual1: Request image renderer with a Property::Map" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_IMAGE_FILE_NAME );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
// For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied.
Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height,width, height );
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(width, height),
Integration::ResourcePointer( bitmap ) );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
-int UtcDaliRendererFactoryGetImageRenderer2(void)
+int UtcDaliVisualFactoryGetImageVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetImageRenderer2: Request image renderer with an image handle" );
+ tet_infoline( "UtcDaliVisualFactoryGetImageVisual2: Request image renderer with an image handle" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
- ControlRenderer controlRenderer = factory.CreateControlRenderer( image );
+ Visual visual = factory.CreateVisual( image );
Actor actor = Actor::New();
// For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied.
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(width, height),
Integration::ResourcePointer(bitmap) );
END_TEST;
}
-int UtcDaliRendererFactoryGetNPatchRenderer1(void)
+int UtcDaliVisualFactoryGetNPatchVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetNPatchRenderer1: Request 9-patch renderer with a Property::Map" );
+ tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual1: Request 9-patch renderer with a Property::Map" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
const unsigned int ninePatchImageHeight = 18;
propertyMap.Insert( "url", TEST_NPATCH_FILE_NAME );
{
tet_infoline( "whole grid" );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
ninePatchResource );
propertyMap.Insert( "borderOnly", true );
{
tet_infoline( "border only" );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
ninePatchResource );
END_TEST;
}
-int UtcDaliRendererFactoryGetNPatchRenderer2(void)
+int UtcDaliVisualFactoryGetNPatchVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetNPatchRenderer2: Request n-patch renderer with a Property::Map" );
+ tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual2: Request n-patch renderer with a Property::Map" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
const unsigned int ninePatchImageWidth = 18;
propertyMap.Insert( "rendererType", "IMAGE" );
propertyMap.Insert( "url", TEST_NPATCH_FILE_NAME );
{
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
TestGlAbstraction& gl = application.GetGlAbstraction();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
ninePatchResource );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
}
propertyMap.Insert( "borderOnly", true );
{
tet_infoline( "border only" );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
TestGlAbstraction& gl = application.GetGlAbstraction();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
Actor actor = Actor::New();
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
ninePatchResource );
DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
}
END_TEST;
}
-int UtcDaliRendererFactoryGetNPatchRenderer3(void)
+int UtcDaliVisualFactoryGetNPatchVisual3(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetNPatchRenderer3: Request 9-patch renderer with an image url" );
+ tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual3: Request 9-patch renderer with an image url" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
const unsigned int ninePatchImageHeight = 18;
stretchRangesY.PushBack( Uint16Pair( 4, 5 ) );
Integration::ResourcePointer ninePatchResource = CustomizeNinePatch( application, ninePatchImageWidth, ninePatchImageHeight, stretchRangesX, stretchRangesY );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( TEST_NPATCH_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
ninePatchResource );
END_TEST;
}
-int UtcDaliRendererFactoryGetNPatchRenderer4(void)
+int UtcDaliVisualFactoryGetNPatchVisual4(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetNPatchRenderer4: Request n-patch renderer with an image url" );
+ tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual4: Request n-patch visual with an image url" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
const unsigned int ninePatchImageHeight = 18;
stretchRangesY.PushBack( Uint16Pair( 25, 27 ) );
Integration::ResourcePointer ninePatchResource = CustomizeNinePatch( application, ninePatchImageWidth, ninePatchImageHeight, stretchRangesX, stretchRangesY );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( TEST_NPATCH_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
ninePatchResource );
END_TEST;
}
-int UtcDaliRendererFactoryGetNPatchRendererN1(void)
+int UtcDaliVisualFactoryGetNPatchVisualN1(void)
{
//This should still load but display an error image
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetNPatchRendererN: Request n-patch renderer with an invalid image url" );
+ tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid image url" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( "ERROR.9.jpg", ImageDimensions() );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( "ERROR.9.jpg", ImageDimensions() );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(),
Integration::ResourcePointer(bitmap) );
END_TEST;
}
-int UtcDaliRendererFactoryGetNPatchRendererN2(void)
+int UtcDaliVisualFactoryGetNPatchVisualN2(void)
{
//This should still load but display an error image
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetNPatchRendererN: Request n-patch renderer with an invalid Property::Map" );
+ tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid Property::Map" );
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
Property::Map propertyMap;
propertyMap.Insert( "rendererType", 111 );
propertyMap.Insert( "url", "ERROR.9.jpg" );
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
Actor actor = Actor::New();
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- TestControlRendererRender( application, actor, controlRenderer, 1u,
+ TestVisualRender( application, actor, visual, 1u,
ImageDimensions(),
Integration::ResourcePointer(bitmap) );
END_TEST;
}
-int UtcDaliRendererFactoryGetSvgRenderer(void)
+int UtcDaliVisualFactoryGetSvgVisual(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetSvgRenderer: Request svg renderer with a svg url" );
+ tet_infoline( "UtcDaliVisualFactoryGetSvgVisual: Request svg visual with a svg url" );
- RendererFactory factory = RendererFactory::Get();
- ControlRenderer controlRenderer = factory.CreateControlRenderer( TEST_SVG_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( controlRenderer );
+ VisualFactory factory = VisualFactory::Get();
+ Visual visual = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions() );
+ DALI_TEST_CHECK( visual );
TestGlAbstraction& gl = application.GetGlAbstraction();
TraceCallStack& textureTrace = gl.GetTextureTrace();
Actor actor = Actor::New();
actor.SetSize( 200.f, 200.f );
Stage::GetCurrent().Add( actor );
- controlRenderer.SetSize( Vector2(200.f, 200.f) );
- controlRenderer.SetOnStage( actor );
+ visual.SetSize( Vector2(200.f, 200.f) );
+ visual.SetOnStage( actor );
application.SendNotification();
application.Render();
//Creates a mesh renderer from the given propertyMap and tries to load it on stage in the given application.
//This is expected to succeed, which will then pass the test.
-void MeshRendererLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application )
+void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application )
{
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
- //Create a mesh renderer.
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ //Create a mesh visual.
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
- //Create an actor on stage to house the renderer.
+ //Create an actor on stage to house the visual.
Actor actor = Actor::New();
actor.SetSize( 200.f, 200.f );
Stage::GetCurrent().Add( actor );
- controlRenderer.SetSize( Vector2( 200.f, 200.f ) );
- controlRenderer.SetOnStage( actor );
+ visual.SetSize( Vector2( 200.f, 200.f ) );
+ visual.SetOnStage( actor );
//Ensure set on stage.
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION );
//Finish by setting off stage, and ensuring this was successful.
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
}
-//Creates a mesh renderer from the given propertyMap and tries to load it on stage in the given application.
+//Creates a mesh visual from the given propertyMap and tries to load it on stage in the given application.
//This is expected to fail, which will then pass the test.
-void MeshRendererDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application )
+void MeshVisualDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application )
{
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
- //Create a mesh renderer.
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ //Create a mesh visual.
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
- //Create an actor on stage to house the renderer.
+ //Create an actor on stage to house the visual.
Actor actor = Actor::New();
actor.SetSize( 200.f, 200.f );
Stage::GetCurrent().Add( actor );
- controlRenderer.SetSize( Vector2( 200.f, 200.f ) );
- controlRenderer.SetOnStage( actor );
+ visual.SetSize( Vector2( 200.f, 200.f ) );
+ visual.SetOnStage( actor );
//Ensure set on stage.
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
DALI_TEST_CHECK( !application.GetGlAbstraction().GetUniformValue<Matrix>( "uObjectMatrix", scaleMatrix ) );
//Finish by setting off stage, and ensuring this was successful.
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
}
//Test if mesh loads correctly when supplied with only the bare minimum requirements, an object file.
-int UtcDaliRendererFactoryGetMeshRenderer1(void)
+int UtcDaliVisualFactoryGetMeshVisual1(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer1: Request mesh renderer with a valid object file only" );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual1: Request mesh visual with a valid object file only" );
+
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
END_TEST;
}
+
//Test if mesh loads correctly when supplied with an object file as well as a blank material file and images directory.
-int UtcDaliRendererFactoryGetMeshRenderer2(void)
+int UtcDaliVisualFactoryGetMeshVisual2(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer2: Request mesh renderer with blank material file and images directory" );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual2: Request mesh visual with blank material file and images directory" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "texturesPath", "" );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
END_TEST;
}
//Test if mesh loads correctly when supplied with all main parameters, an object file, a material file and a directory location.
-int UtcDaliRendererFactoryGetMeshRenderer3(void)
+int UtcDaliVisualFactoryGetMeshVisual3(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer3: Request mesh renderer with all parameters correct" );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual3: Request mesh visual with all parameters correct" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
END_TEST;
}
-//Test if mesh renderer can load a correctly supplied mesh without a normal map or gloss map in the material file.
-int UtcDaliRendererFactoryGetMeshRenderer4(void)
+//Test if mesh visual can load a correctly supplied mesh without a normal map or gloss map in the material file.
+int UtcDaliVisualFactoryGetMeshVisual4(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer4: Request mesh renderer with diffuse texture but not normal or gloss." );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual4: Request mesh visual with diffuse texture but not normal or gloss." );
- //Set up renderer properties.
+
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
+
END_TEST;
}
-//Test if mesh renderer can load when made to use diffuse textures only.
-int UtcDaliRendererFactoryGetMeshRenderer5(void)
+//Test if mesh visual can load when made to use diffuse textures only.
+int UtcDaliVisualFactoryGetMeshVisual5(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer5: Request mesh renderer and make it only use diffuse textures." );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual5: Request mesh visual and make it only use diffuse textures." );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "shaderType", "DIFFUSE_TEXTURE" );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
+
END_TEST;
}
-//Test if mesh renderer can load when made to not use the supplied textures.
-int UtcDaliRendererFactoryGetMeshRenderer6(void)
+//Test if mesh visual can load when made to not use the supplied textures.
+int UtcDaliVisualFactoryGetMeshVisual6(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer6: Request mesh renderer and make it not use any textures." );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual6: Request mesh visual and make it not use any textures." );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "shaderType", "TEXTURELESS" );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
END_TEST;
}
-//Test if mesh renderer loads correctly when light position is manually set.
-int UtcDaliRendererFactoryGetMeshRenderer7(void)
+//Test if mesh visual loads correctly when light position is manually set.
+int UtcDaliVisualFactoryGetMeshVisual7(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer7: Request mesh renderer with custom light position." );
- //Set up renderer properties.
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual7: Request mesh visual with custom light position." );
+
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "lightPosition", Vector3( 0.0, 1.0, 2.0 ) );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
END_TEST;
}
-//Test if mesh renderer loads correctly when supplied an object file without face normals or texture points.
+//Test if mesh visual loads correctly when supplied an object file without face normals or texture points.
//Note that this notably tests object loader functionality.
-int UtcDaliRendererFactoryGetMeshRenderer8(void)
+int UtcDaliVisualFactoryGetMeshVisual8(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRenderer5: Request mesh renderer with normal-less object file." );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisual5: Request mesh visual with normal-less object file." );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_SIMPLE_OBJ_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
//Test to see if mesh loads correctly.
- MeshRendererLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest( propertyMap, application );
END_TEST;
}
-//Test if mesh renderer handles the case of lacking an object file.
-int UtcDaliRendererFactoryGetMeshRendererN1(void)
+//Test if mesh visual handles the case of lacking an object file.
+int UtcDaliVisualFactoryGetMeshVisualN1(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRendererN1: Request mesh renderer without object file" );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisualN1: Request mesh visual without object file" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
//Test to see if mesh doesn't load with these properties, as expected.
- MeshRendererDoesNotLoadCorrectlyTest( propertyMap, application );
+ MeshVisualDoesNotLoadCorrectlyTest( propertyMap, application );
+
END_TEST;
}
-//Test if mesh renderer handles the case of being passed invalid material and images urls.
-int UtcDaliRendererFactoryGetMeshRendererN2(void)
+//Test if mesh visual handles the case of being passed invalid material and images urls.
+int UtcDaliVisualFactoryGetMeshVisualN2(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetMeshRendererN2: Request mesh renderer with invalid material and images urls" );
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisualN2: Request mesh visual with invalid material and images urls" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
propertyMap.Insert( "texturesPath", "also invalid" );
//Test to see if mesh doesn't load with these properties, as expected.
- MeshRendererDoesNotLoadCorrectlyTest( propertyMap, application );
+ MeshVisualDoesNotLoadCorrectlyTest( propertyMap, application );
+
END_TEST;
}
-//Test if mesh renderer handles the case of being passed an invalid object url
-int UtcDaliRendererFactoryGetMeshRendererN3(void)
+//Test if mesh visual handles the case of being passed an invalid object url
+int UtcDaliVisualFactoryGetMeshVisualN3(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
+ tet_infoline( "UtcDaliVisualFactoryGetMeshVisualN3: Request mesh visual with invalid object url" );
- tet_infoline( "UtcDaliRendererFactoryGetMeshRendererN3: Request mesh renderer with invalid object url" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "MESH" );
propertyMap.Insert( "objectUrl", "invalid" );
propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
//Test to see if mesh doesn't load with these properties, as expected.
- MeshRendererDoesNotLoadCorrectlyTest( propertyMap, application );
+ MeshVisualDoesNotLoadCorrectlyTest( propertyMap, application );
END_TEST;
}
-//Creates a primitive renderer with the given property map and tests to see if it correctly loads in the given application.
-void TestPrimitiveRendererWithProperties( Property::Map& propertyMap, ToolkitTestApplication& application )
+//Creates a primitive visual with the given property map and tests to see if it correctly loads in the given application.
+void TestPrimitiveVisualWithProperties( Property::Map& propertyMap, ToolkitTestApplication& application )
{
- RendererFactory factory = RendererFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
DALI_TEST_CHECK( factory );
- //Create a primitive renderer.
- ControlRenderer controlRenderer = factory.CreateControlRenderer( propertyMap );
- DALI_TEST_CHECK( controlRenderer );
+ //Create a primitive visual.
+ Visual visual = factory.CreateVisual( propertyMap );
+ DALI_TEST_CHECK( visual );
- //Create an actor on stage to house the renderer.
+ //Create an actor on stage to house the visual.
Actor actor = Actor::New();
actor.SetSize( 200.f, 200.f );
Stage::GetCurrent().Add( actor );
- controlRenderer.SetSize( Vector2( 200.f, 200.f ) );
- controlRenderer.SetOnStage( actor );
+ visual.SetSize( Vector2( 200.f, 200.f ) );
+ visual.SetOnStage( actor );
//Ensure set on stage.
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
- //Tell test application to load the renderer.
+ //Tell test application to load the visual.
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION );
//Finish by setting off stage, and ensuring this was successful.
- controlRenderer.SetOffStage( actor );
+ visual.SetOffStage( actor );
DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
}
//Test if primitive shape loads correctly when supplied with only the bare minimum requirements, the shape to use.
-int UtcDaliRendererFactoryGetPrimitiveRenderer1(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual1(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer1: Request primitive renderer with a shape only" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual1: Request primitive visual with a shape only" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "CUBE" );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape loads correctly when supplied with all possible parameters
-int UtcDaliRendererFactoryGetPrimitiveRenderer2(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual2(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer2: Request primitive renderer with everything" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual2: Request primitive visual with everything" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "CUBE" );
propertyMap.Insert( "lightPosition", Vector3( 0.9, 1.0, 1.1 ) );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape loads a sphere correctly.
-int UtcDaliRendererFactoryGetPrimitiveRenderer3(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual3(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer3: Request primitive renderer to display a sphere" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual3: Request primitive visual to display a sphere" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "SPHERE" );
propertyMap.Insert( "stacks", 20 );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape loads a conic section correctly.
-int UtcDaliRendererFactoryGetPrimitiveRenderer4(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual4(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer4: Request primitive renderer to display a conic section" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual4: Request primitive visual to display a conic section" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "CONICAL_FRUSTRUM" );
propertyMap.Insert( "scaleHeight", 50.0f );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape loads a bevelled cube correctly.
-int UtcDaliRendererFactoryGetPrimitiveRenderer5(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual5(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer5: Request primitive renderer to display a bevelled cube" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual5: Request primitive visual to display a bevelled cube" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "BEVELLED_CUBE" );
propertyMap.Insert( "bevelPercentage", 0.7f );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape loads an octahedron correctly.
-int UtcDaliRendererFactoryGetPrimitiveRenderer6(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual6(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer6: Request primitive renderer to display an octahedron" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual6: Request primitive visual to display an octahedron" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "OCTAHEDRON" );
propertyMap.Insert( "shapeColor", Vector4( 0.5, 0.5, 0.5, 1.0 ) );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape loads a cone correctly.
-int UtcDaliRendererFactoryGetPrimitiveRenderer7(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual7(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer7: Request primitive renderer to display a cone" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual7: Request primitive visual to display a cone" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "CONE" );
propertyMap.Insert( "scaleHeight", 50.0f );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape loads correctly when light position is manually set.
-int UtcDaliRendererFactoryGetPrimitiveRenderer8(void)
+int UtcDaliVisualFactoryGetPrimitiveVisual8(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRenderer8: Request primitive renderer with set light position" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual8: Request primitive visual with set light position" );
- //Set up renderer properties.
+ //Set up visual properties.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
propertyMap.Insert( "shape", "SPHERE" );
propertyMap.Insert( "lightPosition", Vector3( 0.0, 1.0, 2.0 ) );
//Test to see if shape loads correctly.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
//Test if primitive shape renderer handles the case of not being passed a specific shape to use.
-int UtcDaliRendererFactoryGetPrimitiveRendererN1(void)
+int UtcDaliVisualFactoryGetPrimitiveVisualN1(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliRendererFactoryGetPrimitiveRendererN1: Request primitive renderer without shape" );
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisualN1: Request primitive visual without shape" );
- //Set up renderer properties, without supplying shape.
+ //Set up visual properties, without supplying shape.
Property::Map propertyMap;
propertyMap.Insert( "rendererType", "PRIMITIVE" );
//Test to see if shape loads regardless of missing input.
- TestPrimitiveRendererWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties( propertyMap, application );
END_TEST;
}
develapibubbleemitterdir = $(develapicontrolsdir)/bubble-effect
develapieffectsviewdir = $(develapicontrolsdir)/effects-view
develapimagnifierdir = $(develapicontrolsdir)/magnifier
-develapirendererfactorydir = $(develapicontrolsdir)/renderer-factory
+develapivisualfactorydir = $(develapicontrolsdir)/visual-factory
develapipopupdir = $(develapicontrolsdir)/popup
develapishadowviewdir = $(develapicontrolsdir)/shadow-view
develapisuperblurviewdir = $(develapicontrolsdir)/super-blur-view
develapiimageatlas_HEADERS = $(devel_api_image_atlas_header_files)
develapimagnifier_HEADERS = $(devel_api_magnifier_header_files)
develapipopup_HEADERS = $(devel_api_popup_header_files)
-develapirendererfactory_HEADERS = $(devel_api_renderer_factory_header_files)
+develapivisualfactory_HEADERS = $(devel_api_visual_factory_header_files)
develapiscripting_HEADERS = $(devel_api_scripting_header_files)
develapishadowview_HEADERS = $(devel_api_shadow_view_header_files)
develapishadereffects_HEADERS = $(devel_api_shader_effects_header_files)
*/
// CLASS HEADER
-#include "renderer-factory.h"
+#include "visual-factory.h"
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/singleton-service.h>
#include <dali/devel-api/adaptor-framework/environment-variable.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/renderer-factory-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-factory-impl.h>
namespace Dali
{
const char * const DALI_DEBUG_RENDERING("DALI_DEBUG_RENDERING");
}
-RendererFactory RendererFactory::Get()
+VisualFactory VisualFactory::Get()
{
- RendererFactory factory;
+ VisualFactory factory;
- // Check whether the RendererFactory is already created
+ // Check whether the VisualFactory is already created
SingletonService singletonService( SingletonService::Get() );
if( singletonService )
{
- BaseHandle handle = singletonService.GetSingleton( typeid(RendererFactory) );
+ BaseHandle handle = singletonService.GetSingleton( typeid(VisualFactory) );
if( handle )
{
- //If so, downcast the handle of singleton to RendererFactory
- factory = RendererFactory( dynamic_cast<Internal::RendererFactory*>(handle.GetObjectPtr()) );
+ //If so, downcast the handle of singleton to VisualFactory
+ factory = VisualFactory( dynamic_cast<Internal::VisualFactory*>(handle.GetObjectPtr()) );
}
- if( !factory )// If not, create the RendererFactory and register it as a singleton
+ if( !factory )// If not, create the VisualFactory and register it as a singleton
{
// Check whether debug rendering is required
if( EnvironmentVariable::GetEnvironmentVariable( DALI_DEBUG_RENDERING ) )
{
- factory = RendererFactory( new Internal::RendererFactory(true) );
+ factory = VisualFactory( new Internal::VisualFactory(true) );
}
else
{
- factory = RendererFactory( new Internal::RendererFactory(false) );
+ factory = VisualFactory( new Internal::VisualFactory(false) );
}
- singletonService.Register( typeid(RendererFactory), factory );
+ singletonService.Register( typeid(VisualFactory), factory );
}
}
return factory;
}
-RendererFactory::RendererFactory()
+VisualFactory::VisualFactory()
{
}
-RendererFactory::~RendererFactory()
+VisualFactory::~VisualFactory()
{
}
-RendererFactory::RendererFactory( const RendererFactory& handle )
+VisualFactory::VisualFactory( const VisualFactory& handle )
: BaseHandle( handle )
{
}
-RendererFactory& RendererFactory::operator=( const RendererFactory& handle )
+VisualFactory& VisualFactory::operator=( const VisualFactory& handle )
{
BaseHandle::operator=( handle );
return *this;
}
-RendererFactory::RendererFactory(Internal::RendererFactory *impl)
+VisualFactory::VisualFactory(Internal::VisualFactory *impl)
: BaseHandle(impl)
{
}
-ControlRenderer RendererFactory::CreateControlRenderer( const Property::Map& propertyMap )
+Visual VisualFactory::CreateVisual( const Property::Map& propertyMap )
{
- return GetImplementation( *this ).CreateControlRenderer( propertyMap );
+ return GetImplementation( *this ).CreateVisual( propertyMap );
}
-ControlRenderer RendererFactory::CreateControlRenderer( const Image& image )
+Visual VisualFactory::CreateVisual( const Image& image )
{
- return GetImplementation( *this ).CreateControlRenderer( image );
+ return GetImplementation( *this ).CreateVisual( image );
}
-ControlRenderer RendererFactory::CreateControlRenderer( const std::string& url, ImageDimensions size )
+Visual VisualFactory::CreateVisual( const std::string& url, ImageDimensions size )
{
- return GetImplementation( *this ).CreateControlRenderer( url, size );
+ return GetImplementation( *this ).CreateVisual( url, size );
}
} // namespace Toolkit
#include <dali/public-api/images/image-operations.h>
#include <dali/public-api/object/property-map.h>
-// INTERNAK INCLUDES
-#include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/visual-factory/visual.h>
namespace Dali
{
namespace Internal DALI_INTERNAL
{
-class RendererFactory;
+class VisualFactory;
}
/**
- * @brief RendererFactory is a singleton object that provides and shares renderers for controls
+ * @brief VisualFactory is a singleton object that provides and shares renderers for controls
*
* By setting environment variable 'DALI_DEBUG_RENDERING', all concrete renderer is replaced with the debug renderer which renders a quad wireframe.
*
* |--------------------------|------------------|
* | rendererType | STRING |
*/
-class DALI_IMPORT_API RendererFactory : public BaseHandle
+class DALI_IMPORT_API VisualFactory : public BaseHandle
{
public:
/**
- * @brief Create or retrieve RendererFactory singleton.
+ * @brief Create or retrieve VisualFactory singleton.
*
- * @return A handle to the RendererFactory control.
+ * @return A handle to the VisualFactory control.
*/
- static RendererFactory Get();
+ static VisualFactory Get();
/**
- * @brief Create a RendererFactory handle.
+ * @brief Create a VisualFactory handle.
*
* Calling member functions with an uninitialised handle is not allowed.
*/
- RendererFactory();
+ VisualFactory();
/**
* @brief Destructor
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
- ~RendererFactory();
+ ~VisualFactory();
/**
* @brief This copy constructor is required for (smart) pointer semantics.
*
* @param[in] handle A reference to the copied handle.
*/
- RendererFactory( const RendererFactory& handle );
+ VisualFactory( const VisualFactory& handle );
/**
* @brief This assignment operator is required for (smart) pointer semantics.
* @param [in] handle A reference to the copied handle.
* @return A reference to this.
*/
- RendererFactory& operator=( const RendererFactory& handle );
+ VisualFactory& operator=( const VisualFactory& handle );
/**
* @brief Request the control renderer
* Depends on the content of the map, different kind of renderer would be returned.
* @return The pointer pointing to control renderer
*/
- ControlRenderer CreateControlRenderer( const Property::Map& propertyMap );
+ Visual CreateVisual( const Property::Map& propertyMap );
/**
* @brief Request the control renderer to render the image.
* @param[in] image The image to be rendered.
* @return The pointer pointing to the control renderer
*/
- ControlRenderer CreateControlRenderer( const Image& image );
+ Visual CreateVisual( const Image& image );
/**
* @brief Request the control renderer to render the given resource at the url.
* @param[in] size The width and height to fit the loaded image to.
* @return The pointer pointing to the control renderer
*/
- ControlRenderer CreateControlRenderer( const std::string& url, ImageDimensions size );
+ Visual CreateVisual( const std::string& url, ImageDimensions size );
private:
- explicit DALI_INTERNAL RendererFactory(Internal::RendererFactory *impl);
+ explicit DALI_INTERNAL VisualFactory(Internal::VisualFactory *impl);
};
/**
* @brief Template to allow discard old renderer, get new one and set it on stage if possible
*
- * @tparam ParameterType0 The type of first argument passed to the CreateControlRenderer()
- * @tparam ParameterType1 The type of second argument passed to the CreateControlRenderer()
+ * @tparam ParameterType0 The type of first argument passed to the CreateVisual()
+ * @tparam ParameterType1 The type of second argument passed to the CreateVisual()
* @SINCE_1_0.39
* @param[in] actor Actor for which the renderer will be replaced
* @param[in,out] renderer The renderer object to be replaced
* @param[in] param1 Second template based argument passed to the renderer factory
*/
template< class ParameterType0, class ParameterType1 >
-void InitializeControlRenderer( Actor& actor, ControlRenderer& renderer, ParameterType0& param0, ParameterType1& param1 )
+void InitializeVisual( Actor& actor, Visual& renderer, ParameterType0& param0, ParameterType1& param1 )
{
renderer.RemoveAndReset( actor );
- renderer = Toolkit::RendererFactory::Get().CreateControlRenderer( param0, param1 );
+ renderer = Toolkit::VisualFactory::Get().CreateVisual( param0, param1 );
if( renderer && actor && actor.OnStage() )
{
renderer.SetOnStage( actor );
/**
* @brief Template to allow discard old renderer, get new one and set it on stage if possible
*
- * @tparam ParameterType The type of argument passed to the CreateControlRenderer()
+ * @tparam ParameterType The type of argument passed to the CreateVisual()
* @SINCE_1_0.39
* @param[in] actor Actor for which the renderer will be replaced
* @param[in,out] renderer The renderer object to be replaced
* @param[in] param Template based argument passed to the renderer factory
*/
template< class ParameterType >
-void InitializeControlRenderer( Actor& actor, ControlRenderer& renderer, ParameterType& param )
+void InitializeVisual( Actor& actor, Visual& renderer, ParameterType& param )
{
renderer.RemoveAndReset( actor );
- renderer = Toolkit::RendererFactory::Get().CreateControlRenderer( param );
+ renderer = Toolkit::VisualFactory::Get().CreateVisual( param );
if( renderer && actor && actor.OnStage() )
{
renderer.SetOnStage( actor );
*/
// CLASS HEADER
-#include "control-renderer.h"
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
+#include "visual.h"
namespace Dali
{
namespace Toolkit
{
-ControlRenderer::ControlRenderer()
+Visual::Visual()
{
}
-ControlRenderer::~ControlRenderer()
+Visual::~Visual()
{
}
-ControlRenderer::ControlRenderer( const ControlRenderer& handle )
+Visual::Visual( const Visual& handle )
: BaseHandle( handle )
{
}
-ControlRenderer& ControlRenderer::operator=( const ControlRenderer& handle )
+Visual& Visual::operator=( const Visual& handle )
{
BaseHandle::operator=( handle );
return *this;
}
-ControlRenderer::ControlRenderer(Internal::ControlRenderer *impl)
+Visual::Visual(Internal::Visual *impl)
: BaseHandle( impl )
{
}
-void ControlRenderer::SetSize( const Vector2& size )
+void Visual::SetSize( const Vector2& size )
{
GetImplementation( *this ).SetSize( size );
}
-const Vector2& ControlRenderer::GetSize() const
+const Vector2& Visual::GetSize() const
{
return GetImplementation( *this ).GetSize();
}
-void ControlRenderer::GetNaturalSize(Vector2& naturalSize ) const
+void Visual::GetNaturalSize(Vector2& naturalSize ) const
{
GetImplementation( *this ).GetNaturalSize( naturalSize );
}
-void ControlRenderer::SetDepthIndex( float index )
+void Visual::SetDepthIndex( float index )
{
GetImplementation( *this ).SetDepthIndex( index );
}
-float ControlRenderer::GetDepthIndex() const
+float Visual::GetDepthIndex() const
{
return GetImplementation( *this ).GetDepthIndex();
}
-void ControlRenderer::SetOnStage( Actor& actor )
+void Visual::SetOnStage( Actor& actor )
{
GetImplementation( *this ).SetOnStage( actor );
}
-void ControlRenderer::SetOffStage( Actor& actor )
+void Visual::SetOffStage( Actor& actor )
{
GetImplementation( *this ).SetOffStage( actor );
}
-void ControlRenderer::RemoveAndReset( Actor& actor )
+void Visual::RemoveAndReset( Actor& actor )
{
if( actor && *this )
{
Reset();
}
-void ControlRenderer::CreatePropertyMap( Property::Map& map ) const
+void Visual::CreatePropertyMap( Property::Map& map ) const
{
GetImplementation( *this ).CreatePropertyMap( map );
}
namespace Internal DALI_INTERNAL
{
-class ControlRenderer;
+class Visual;
}
/**
- * @brief ControlRenderer provides renderer for rendering the controls. A control may have multiple ControlRenders.
+ * @brief Visual provides renderer for rendering the controls. A control may have multiple ControlRenders.
*
- * ControlRenderers reuses geometry, shader etc. across controls and manages the renderer and texture sets to exist only when control is on-stage.
+ * Visuals reuses geometry, shader etc. across controls and manages the renderer and texture sets to exist only when control is on-stage.
* It also responds to actor size and color change, and provides the clipping at the renderer level.
* Note: The control renderer responds to the the Actor::COLOR by blending it with the 'Multiply' operator.
*/
-class DALI_IMPORT_API ControlRenderer : public BaseHandle
+class DALI_IMPORT_API Visual : public BaseHandle
{
public:
/**
- * @brief Create an empty ControlRenderer Handle
+ * @brief Create an empty Visual Handle
*/
- ControlRenderer();
+ Visual();
/**
* @brief Destructor
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
- ~ControlRenderer();
+ ~Visual();
/**
* @brief This copy constructor is required for (smart) pointer semantics.
*
* @param[in] handle A reference to the copied handle.
*/
- ControlRenderer( const ControlRenderer& handle );
+ Visual( const Visual& handle );
/**
* @brief This assignment operator is required for (smart) pointer semantics.
* @param [in] handle A reference to the copied handle.
* @return A reference to this.
*/
- ControlRenderer& operator=( const ControlRenderer& handle );
+ Visual& operator=( const Visual& handle );
/**
* @brief Set the size of the painting area.
public: // Not intended for application developers
- explicit DALI_INTERNAL ControlRenderer(Internal::ControlRenderer *impl);
+ explicit DALI_INTERNAL Visual(Internal::Visual *impl);
};
$(devel_api_src_dir)/controls/magnifier/magnifier.cpp \
$(devel_api_src_dir)/controls/popup/confirmation-popup.cpp \
$(devel_api_src_dir)/controls/popup/popup.cpp \
- $(devel_api_src_dir)/controls/renderer-factory/renderer-factory.cpp \
- $(devel_api_src_dir)/controls/renderer-factory/control-renderer.cpp \
+ $(devel_api_src_dir)/controls/visual-factory/visual-factory.cpp \
+ $(devel_api_src_dir)/controls/visual-factory/visual.cpp \
$(devel_api_src_dir)/controls/shadow-view/shadow-view.cpp \
$(devel_api_src_dir)/controls/super-blur-view/super-blur-view.cpp \
$(devel_api_src_dir)/controls/text-controls/text-selection-popup.cpp \
$(devel_api_src_dir)/controls/popup/confirmation-popup.h \
$(devel_api_src_dir)/controls/popup/popup.h
-devel_api_renderer_factory_header_files = \
- $(devel_api_src_dir)/controls/renderer-factory/renderer-factory.h \
- $(devel_api_src_dir)/controls/renderer-factory/control-renderer.h
+devel_api_visual_factory_header_files = \
+ $(devel_api_src_dir)/controls/visual-factory/visual-factory.h \
+ $(devel_api_src_dir)/controls/visual-factory/visual.h
devel_api_shadow_view_header_files = \
$(devel_api_src_dir)/controls/shadow-view/shadow-view.h
* "uObjectFadeStart" - The displacement from the centre of the actor that the actor will start to fade towards its
* edges. This is used to prevent an unsightly hard edge between the blurred actor and the scene.
* Depends on the values of the vertices in the vertex stream. When the actor is at rest this is
- * not applied. Default 0.25, which is half way towards the edge for an ImageRenderer::QUAD.
+ * not applied. Default 0.25, which is half way towards the edge for an ImageVisual::QUAD.
* "uObjectFadeEnd" - The displacement from the centre of the actor that the actor will finish fading towards its
* edges. This is used to prevent an unsightly hard edge between the blurred actor and the scene.
* Depends on the values of the vertices in the vertex stream. When the actor is at rest this is
- * not applied.Default 0.5, which is all the way towards the edge for an ImageRenderer::QUAD.
+ * not applied.Default 0.5, which is all the way towards the edge for an ImageVisual::QUAD.
* "uAlphaScale" - Global scaler applied to the alpha of the actor. Used to make the blurred actor a bit more subtle
* (helps to hide discontinuities due to limited number of texture samples) and reveal a bit of the
* background behind it as it moves. When the actor is at rest this is not applied. Default 0.75.
* its edges. This is used to prevent an unsightly hard edge between the stretched actor and
* the scene. Depends on the values of the vertices in the vertex stream. When the actor is at
* rest this is not applied. Default Vector2(0.25, 0.25), which is half way towards the edge for
- * an ImageRenderer::QUAD.
+ * an ImageVisual::QUAD.
* "uObjectFadeEnd" - The displacement from the centre of the actor that the actor will finish fading towards its edges.
* This is used to prevent an unsightly hard edge between the stretched actor and the scene. Depends
* on the values of the vertices in the vertex stream. When the actor is at rest this is not applied.
- * Default 0.5, which is all the way towards the edge for an ImageRenderer::QUAD.
+ * Default 0.5, which is all the way towards the edge for an ImageVisual::QUAD.
* "uAlphaScale" - Global scaler applied to the alpha of the actor. Used to make the stretched actor a bit more subtle
* and reveal a bit of the background behind it as it moves. When the actor is at rest this is not
* applied. Default 0.75.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
/**
* Button states and contents
{
// If there is no existing content, create a new actor to use for flat color.
Actor placementActor = Actor::New();
- Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
- Toolkit::ControlRenderer colorRenderer;
+ Toolkit::VisualFactory rendererFactory = Toolkit::VisualFactory::Get();
+ Toolkit::Visual colorRenderer;
Property::Map map;
map["rendererType"] = "COLOR";
map["mixColor"] = color;
- colorRenderer = rendererFactory.CreateControlRenderer( map );
+ colorRenderer = rendererFactory.CreateVisual( map );
colorRenderer.SetOnStage( placementActor );
SetupContent( *contentActor, placementActor ); //
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
#include <dali-toolkit/internal/filters/blur-two-pass-filter.h>
#include <dali-toolkit/internal/filters/emboss-filter.h>
#include <dali-toolkit/internal/filters/spread-filter.h>
customShader[ "vertexShader" ] = EFFECTS_VIEW_VERTEX_SOURCE;
customShader[ "fragmentShader" ] = EFFECTS_VIEW_FRAGMENT_SOURCE;
rendererMap[ "shader" ] = customShader;
- InitializeControlRenderer( self, mRendererPostFilter, rendererMap );
+ InitializeVisual( self, mRendererPostFilter, rendererMap );
mEffectType = type;
}
Actor self( Self() );
mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
- InitializeControlRenderer( self, mRendererForChildren, mImageForChildren );
+ InitializeVisual( self, mRendererForChildren, mImageForChildren );
mRendererForChildren.SetDepthIndex( DepthIndex::CONTENT+1 );
mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat, Dali::Image::UNUSED );
#include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
namespace Dali
{
/////////////////////////////////////////////////////////////
// for rendering all user added children to offscreen target
FrameBufferImage mImageForChildren;
- Toolkit::ControlRenderer mRendererForChildren;
+ Toolkit::Visual mRendererForChildren;
RenderTask mRenderTaskForChildren;
CameraActor mCameraForChildren;
Actor mChildrenRoot; // for creating a subtree for all user added child actors
/////////////////////////////////////////////////////////////
// post blur image
FrameBufferImage mImagePostFilter;
- Toolkit::ControlRenderer mRendererPostFilter;
+ Toolkit::Visual mRendererPostFilter;
Vector<ImageFilter*> mFilters;
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/controls/renderers/visual-string-constants.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
namespace Dali
{
mImage = image;
Actor self( Self() );
- InitializeControlRenderer( self, mRenderer, image );
+ InitializeVisual( self, mRenderer, image );
mImageSize = image ? ImageDimensions( image.GetWidth(), image.GetHeight() ) : ImageDimensions( 0, 0 );
RelayoutRequest();
mPropertyMap = map;
Actor self( Self() );
- InitializeControlRenderer( self, mRenderer, mPropertyMap );
+ InitializeVisual( self, mRenderer, mPropertyMap );
Property::Value* widthValue = mPropertyMap.Find( "width" );
if( widthValue )
}
Actor self( Self() );
- InitializeControlRenderer( self, mRenderer, url, size );
+ InitializeVisual( self, mRenderer, url, size );
mRenderer.SetSize( mSizeSet );
Property::Map shaderMap;
if( shaderValue->Get( shaderMap ) )
{
- Internal::ControlRenderer& renderer = GetImplementation( impl.mRenderer );
+ Internal::Visual& renderer = GetImplementation( impl.mRenderer );
renderer.SetCustomShader( shaderMap );
if( imageView.OnStage() )
{
#include <dali/public-api/object/property-map.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/image/image-renderer.h>
+#include <dali-toolkit/internal/controls/renderers/image/image-visual.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
ImageView& operator=( const ImageView& );
private:
- Toolkit::ControlRenderer mRenderer;
+ Toolkit::Visual mRenderer;
ImageDimensions mImageSize;
Vector2 mSizeSet;
#include <dali/public-api/object/property-map.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/controls/renderers/visual-string-constants.h>
namespace Dali
{
Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f);
mFrame.SetSizeModeFactor( sizeOffset );
- Toolkit::RendererFactory rendererFactory = Toolkit::RendererFactory::Get();
+ Toolkit::VisualFactory rendererFactory = Toolkit::VisualFactory::Get();
Property::Map map;
map[ RENDERER_TYPE ] = BORDER_RENDERER;
map[ "borderColor" ] = Color::WHITE;
map[ "borderSize" ] = IMAGE_BORDER_INDENT;
- Toolkit::ControlRenderer borderRenderer = rendererFactory.CreateControlRenderer( map );
+ Toolkit::Visual borderRenderer = rendererFactory.CreateVisual( map );
borderRenderer.SetOnStage( mFrame );
Constraint constraint = Constraint::New<Vector3>( mFrame, Actor::Property::POSITION, EqualToConstraint() );
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h>
#include <dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
+#include <dali-toolkit/internal/controls/renderers/visual-factory-cache.h>
using namespace Dali;
// create the grid geometry for pages
uint16_t width = static_cast<uint16_t>(mPageSize.width / DEFAULT_GRID_DENSITY + 0.5f);
uint16_t height = static_cast<uint16_t>(mPageSize.height / DEFAULT_GRID_DENSITY + 0.5f);
- mGeometry = RendererFactoryCache::CreateGridGeometry( Uint16Pair( width, height ) );
+ mGeometry = VisualFactoryCache::CreateGridGeometry( Uint16Pair( width, height ) );
mPages.reserve( NUMBER_OF_CACHED_PAGES );
for( int i = 0; i < NUMBER_OF_CACHED_PAGES; i++ )
*/
// 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;
#include <dali/public-api/rendering/geometry.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
namespace Dali
{
* | antiAliasing | BOOLEAN |
*/
-class BorderRenderer : public ControlRenderer
+class BorderVisual : public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- BorderRenderer( RendererFactoryCache& factoryCache );
+ BorderVisual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- virtual ~BorderRenderer();
+ virtual ~BorderVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::SetClipRect
+ * @copydoc Visual::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
Geometry CreateBorderGeometry();
// Undefined
- BorderRenderer( const BorderRenderer& borderRenderer );
+ BorderVisual( const BorderVisual& borderRenderer );
// Undefined
- BorderRenderer& operator=( const BorderRenderer& borderRenderer );
+ BorderVisual& operator=( const BorderVisual& borderRenderer );
private:
*/
// CLASS HEADER
-#include "color-renderer.h"
+#include "color-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
{
);
}
-ColorRenderer::ColorRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache ),
+ColorVisual::ColorVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache ),
mMixColorIndex( Property::INVALID_INDEX )
{
}
-ColorRenderer::~ColorRenderer()
+ColorVisual::~ColorVisual()
{
}
-void ColorRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void ColorVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
Property::Value* color = propertyMap.Find( COLOR_NAME );
if( !( color && color->Get(mMixColor) ) )
{
- DALI_LOG_ERROR( "Fail to provide a color to the ColorRenderer object" );
+ DALI_LOG_ERROR( "Fail to provide a color to the ColorVisual object" );
}
}
-void ColorRenderer::SetSize( const Vector2& size )
+void ColorVisual::SetSize( const Vector2& size )
{
- ControlRenderer::SetSize( size );
+ Visual::SetSize( size );
// ToDo: renderer responds to the size change
}
-void ColorRenderer::SetClipRect( const Rect<int>& clipRect )
+void ColorVisual::SetClipRect( const Rect<int>& clipRect )
{
- ControlRenderer::SetClipRect( clipRect );
+ Visual::SetClipRect( clipRect );
//ToDo: renderer responds to the clipRect change
}
-void ColorRenderer::SetOffset( const Vector2& offset )
+void ColorVisual::SetOffset( const Vector2& offset )
{
//ToDo: renderer applies the offset
}
-void ColorRenderer::DoSetOnStage( Actor& actor )
+void ColorVisual::DoSetOnStage( Actor& actor )
{
InitializeRenderer();
}
-void ColorRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void ColorVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, COLOR_RENDERER );
map.Insert( COLOR_NAME, mMixColor );
}
-void ColorRenderer::InitializeRenderer()
+void ColorVisual::InitializeRenderer()
{
- Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
+ Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
if( !geometry )
{
- geometry = RendererFactoryCache::CreateQuadGeometry();
- mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
+ geometry = VisualFactoryCache::CreateQuadGeometry();
+ mFactoryCache.SaveGeometry( VisualFactoryCache::QUAD_GEOMETRY, geometry );
}
- Shader shader = mFactoryCache.GetShader( RendererFactoryCache::COLOR_SHADER );
+ Shader shader = mFactoryCache.GetShader( VisualFactoryCache::COLOR_SHADER );
if( !shader )
{
shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
- mFactoryCache.SaveShader( RendererFactoryCache::COLOR_SHADER, shader );
+ mFactoryCache.SaveShader( VisualFactoryCache::COLOR_SHADER, shader );
}
mImpl->mRenderer = Renderer::New( geometry, shader );
}
}
-void ColorRenderer::SetColor(const Vector4& color)
+void ColorVisual::SetColor(const Vector4& color)
{
mMixColor = color;
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
namespace Dali
{
* |-----------------|-------------|
* | mixColor | VECTOR4 |
*/
-class ColorRenderer: public ControlRenderer
+class ColorVisual: public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- ColorRenderer( RendererFactoryCache& factoryCache );
+ ColorVisual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- virtual ~ColorRenderer();
+ virtual ~ColorVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::SetSize
+ * @copydoc Visual::SetSize
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc ControlRenderer::SetClipRect
+ * @copydoc Visual::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
/**
- * @copydoc ControlRenderer::SetOffset
+ * @copydoc Visual::SetOffset
*/
virtual void SetOffset( const Vector2& offset );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
private:
// Undefined
- ColorRenderer( const ColorRenderer& colorRenderer );
+ ColorVisual( const ColorVisual& colorRenderer );
// Undefined
- ColorRenderer& operator=( const ColorRenderer& colorRenderer );
+ ColorVisual& operator=( const ColorVisual& colorRenderer );
private:
// CLASS HEADER
-#include "debug-renderer.h"
+#include "debug-visual.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/control-renderer-data-impl.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.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-data-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-string-constants.h>
namespace Dali
{
}
-DebugRenderer::DebugRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache )
+DebugVisual::DebugVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache )
{
}
-DebugRenderer::~DebugRenderer()
+DebugVisual::~DebugVisual()
{}
-void DebugRenderer::DoSetOnStage( Actor& actor )
+void DebugVisual::DoSetOnStage( Actor& actor )
{
InitializeRenderer();
}
-void DebugRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void DebugVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, DEBUG_RENDERER );
}
-void DebugRenderer::InitializeRenderer()
+void DebugVisual::InitializeRenderer()
{
- mImpl->mRenderer = mFactoryCache.GetDebugRenderer();
+ mImpl->mRenderer = mFactoryCache.GetDebugVisual();
if( !mImpl->mRenderer )
{
Geometry geometry = CreateQuadWireframeGeometry();
Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mImpl->mRenderer = Renderer::New( geometry, shader);
- mFactoryCache.CacheDebugRenderer( mImpl->mRenderer );
+ mFactoryCache.CacheDebugVisual( mImpl->mRenderer );
}
}
-Geometry DebugRenderer::CreateQuadWireframeGeometry()
+Geometry DebugVisual::CreateQuadWireframeGeometry()
{
const float halfWidth = 0.5f;
const float halfHeight = 0.5f;
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
namespace Dali
{
* The renderer which renders a wireframe outline to the control's quad for debugging
*
*/
-class DebugRenderer: public ControlRenderer
+class DebugVisual: public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- DebugRenderer( RendererFactoryCache& factoryCache );
+ DebugVisual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- virtual ~DebugRenderer();
+ virtual ~DebugVisual();
protected:
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
private:
// Undefined
- DebugRenderer( const DebugRenderer& debugRenderer );
+ DebugVisual( const DebugVisual& debugRenderer );
// Undefined
- DebugRenderer& operator=( const DebugRenderer& debugRenderer );
+ DebugVisual& operator=( const DebugVisual& debugRenderer );
};
*/
// CLASS HEADER
-#include "gradient-renderer.h"
+#include "gradient-visual.h"
// EXTERNAL INCLUDES
#include <typeinfo>
#include <dali/public-api/object/property-array.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/control-renderer-data-impl.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.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-data-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-string-constants.h>
#include <dali-toolkit/internal/controls/renderers/gradient/linear-gradient.h>
#include <dali-toolkit/internal/controls/renderers/gradient/radial-gradient.h>
const unsigned int DEFAULT_OFFSET_MINIMUM = 0.0f;
const unsigned int DEFAULT_OFFSET_MAXIMUM = 1.0f;
-RendererFactoryCache::ShaderType GetShaderType( GradientRenderer::Type type, Gradient::GradientUnits units)
+VisualFactoryCache::ShaderType GetShaderType( GradientVisual::Type type, Gradient::GradientUnits units)
{
- if( type==GradientRenderer::LINEAR )
+ if( type==GradientVisual::LINEAR )
{
if( units == Gradient::USER_SPACE_ON_USE )
{
- return RendererFactoryCache::GRADIENT_SHADER_LINEAR_USER_SPACE;
+ return VisualFactoryCache::GRADIENT_SHADER_LINEAR_USER_SPACE;
}
- return RendererFactoryCache::GRADIENT_SHADER_LINEAR_BOUNDING_BOX;
+ return VisualFactoryCache::GRADIENT_SHADER_LINEAR_BOUNDING_BOX;
}
else if( units == Gradient::USER_SPACE_ON_USE )
{
- return RendererFactoryCache::GRADIENT_SHADER_RADIAL_USER_SPACE;
+ return VisualFactoryCache::GRADIENT_SHADER_RADIAL_USER_SPACE;
}
- return RendererFactoryCache::GRADIENT_SHADER_RADIAL_BOUNDING_BOX;
+ return VisualFactoryCache::GRADIENT_SHADER_RADIAL_BOUNDING_BOX;
}
const char* VERTEX_SHADER[] =
}
-GradientRenderer::GradientRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache ),
+GradientVisual::GradientVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache ),
mGradientType( LINEAR )
{
mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
}
-GradientRenderer::~GradientRenderer()
+GradientVisual::~GradientVisual()
{
}
-void GradientRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void GradientVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
Gradient::GradientUnits gradientUnits = Gradient::OBJECT_BOUNDING_BOX;
Property::Value* unitsValue = propertyMap.Find( UNITS_NAME );
}
else
{
- DALI_LOG_ERROR( "Fail to provide valid properties to create a GradientRenderer object" );
+ DALI_LOG_ERROR( "Fail to provide valid properties to create a GradientVisual object" );
}
}
-void GradientRenderer::SetSize( const Vector2& size )
+void GradientVisual::SetSize( const Vector2& size )
{
- ControlRenderer::SetSize( size );
+ Visual::SetSize( size );
}
-void GradientRenderer::SetClipRect( const Rect<int>& clipRect )
+void GradientVisual::SetClipRect( const Rect<int>& clipRect )
{
- ControlRenderer::SetClipRect( clipRect );
+ Visual::SetClipRect( clipRect );
//ToDo: renderer responds to the clipRect change
}
-void GradientRenderer::SetOffset( const Vector2& offset )
+void GradientVisual::SetOffset( const Vector2& offset )
{
//ToDo: renderer applies the offset
}
-void GradientRenderer::DoSetOnStage( Actor& actor )
+void GradientVisual::DoSetOnStage( Actor& actor )
{
InitializeRenderer();
}
-void GradientRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void GradientVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, GRADIENT_RENDERER );
}
}
-void GradientRenderer::InitializeRenderer()
+void GradientVisual::InitializeRenderer()
{
- Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
+ Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
if( !geometry )
{
- geometry = RendererFactoryCache::CreateQuadGeometry();
- mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
+ geometry = VisualFactoryCache::CreateQuadGeometry();
+ mFactoryCache.SaveGeometry( VisualFactoryCache::QUAD_GEOMETRY, geometry );
}
Gradient::GradientUnits gradientUnits = mGradient->GetGradientUnits();
- RendererFactoryCache::ShaderType shaderType = GetShaderType( mGradientType, gradientUnits );
+ VisualFactoryCache::ShaderType shaderType = GetShaderType( mGradientType, gradientUnits );
Shader shader = mFactoryCache.GetShader( shaderType );
if( !shader )
{
mImpl->mRenderer.RegisterProperty( UNIFORM_ALIGNMENT_MATRIX_NAME, mGradientTransform );
}
-bool GradientRenderer::NewGradient(Type gradientType, const Property::Map& propertyMap)
+bool GradientVisual::NewGradient(Type gradientType, const Property::Map& propertyMap)
{
if( gradientType==LINEAR )
{
return true;
}
-void GradientRenderer::GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets)
+void GradientVisual::GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets)
{
if ( value ) // Only check valve type if a valid Property has been passed in
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
#include <dali-toolkit/internal/controls/renderers/gradient/gradient.h>
namespace Dali
* Valid values for spreadMethod are 'pad', 'repeat' and 'reflect.'
* If not provided, 'objectBoundingBox' is used as default gradient units, and 'pad' is used as default spread method.
*/
-class GradientRenderer: public ControlRenderer
+class GradientVisual: public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- GradientRenderer( RendererFactoryCache& factoryCache );
+ GradientVisual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- ~GradientRenderer();
+ ~GradientVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::SetSize
+ * @copydoc Visual::SetSize
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc ControlRenderer::SetClipRect
+ * @copydoc Visual::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
/**
- * @copydoc ControlRenderer::SetOffset
+ * @copydoc Visual::SetOffset
*/
virtual void SetOffset( const Vector2& offset );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
static void GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);
// Undefined
- GradientRenderer( const GradientRenderer& gradientRenderer );
+ GradientVisual( const GradientVisual& gradientRenderer );
// Undefined
- GradientRenderer& operator=( const GradientRenderer& gradientRenderer );
+ GradientVisual& operator=( const GradientVisual& gradientRenderer );
private:
{
/**
- * The manager for automatic image atlasing. Owned by RendererFactory
+ * The manager for automatic image atlasing. Owned by VisualFactory
*/
class ImageAtlasManager : public RefObject
{
*/
// CLASS HEADER
-#include "image-renderer.h"
+#include "image-visual.h"
// EXTERNAL HEADER
#include <cstring> // for strncasecmp
#include <dali/integration-api/debug.h>
// INTERNAL HEADER
-#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
-#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/control-renderer-impl.h>
-#include <dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-string-constants.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-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-data-impl.h>
#include <dali-toolkit/internal/controls/renderers/image-atlas-manager.h>
namespace Dali
}\n
);
-Geometry CreateGeometry( RendererFactoryCache& factoryCache, ImageDimensions gridSize )
+Geometry CreateGeometry( VisualFactoryCache& factoryCache, ImageDimensions gridSize )
{
Geometry geometry;
if( gridSize == ImageDimensions( 1, 1 ) )
{
- geometry = factoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
+ geometry = factoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
if( !geometry )
{
- geometry = RendererFactoryCache::CreateQuadGeometry();
- factoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
+ geometry = VisualFactoryCache::CreateQuadGeometry();
+ factoryCache.SaveGeometry( VisualFactoryCache::QUAD_GEOMETRY, geometry );
}
}
else
{
- geometry = RendererFactoryCache::CreateGridGeometry( gridSize );
+ geometry = VisualFactoryCache::CreateGridGeometry( gridSize );
}
return geometry;
} //unnamed namespace
-ImageRenderer::ImageRenderer( RendererFactoryCache& factoryCache, ImageAtlasManager& atlasManager )
-: ControlRenderer( factoryCache ),
+ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageAtlasManager& atlasManager )
+: Visual( factoryCache ),
mAtlasManager( atlasManager ),
mDesiredSize(),
mFittingMode( FittingMode::DEFAULT ),
{
}
-ImageRenderer::~ImageRenderer()
+ImageVisual::~ImageVisual()
{
}
-void ImageRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void ImageVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
std::string oldImageUrl = mImageUrl;
}
}
-void ImageRenderer::SetSize( const Vector2& size )
+void ImageVisual::SetSize( const Vector2& size )
{
- ControlRenderer::SetSize( size );
+ Visual::SetSize( size );
}
-void ImageRenderer::GetNaturalSize( Vector2& naturalSize ) const
+void ImageVisual::GetNaturalSize( Vector2& naturalSize ) const
{
if(mImage)
{
naturalSize = Vector2::ZERO;
}
-void ImageRenderer::SetClipRect( const Rect<int>& clipRect )
+void ImageVisual::SetClipRect( const Rect<int>& clipRect )
{
- ControlRenderer::SetClipRect( clipRect );
+ Visual::SetClipRect( clipRect );
}
-void ImageRenderer::SetOffset( const Vector2& offset )
+void ImageVisual::SetOffset( const Vector2& offset )
{
}
-Renderer ImageRenderer::CreateRenderer() const
+Renderer ImageVisual::CreateRenderer() const
{
Geometry geometry;
Shader shader;
// Renderer can't be shared between NativeImage and other image types.
if( !mNativeFragmentShaderCode.empty() )
{
- return CreateNativeImageRenderer();
+ return CreateNativeImageVisual();
}
if( !mImpl->mCustomShader )
return renderer;
}
-Renderer ImageRenderer::CreateNativeImageRenderer() const
+Renderer ImageVisual::CreateNativeImageVisual() const
{
Geometry geometry;
Shader shader;
}
-bool ImageRenderer::IsSynchronousResourceLoading() const
+bool ImageVisual::IsSynchronousResourceLoading() const
{
return mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
}
-void ImageRenderer::DoSynchronousResourceLoading()
+void ImageVisual::DoSynchronousResourceLoading()
{
if( !mImageUrl.empty() )
{
}
}
-Image ImageRenderer::LoadImage( const std::string& url, bool synchronousLoading )
+Image ImageVisual::LoadImage( const std::string& url, bool synchronousLoading )
{
if( synchronousLoading )
{
if( !mPixels )
{
// use broken image
- return RendererFactory::GetBrokenRendererImage();
+ return VisualFactory::GetBrokenRendererImage();
}
Atlas image = Atlas::New( mPixels.GetWidth(), mPixels.GetHeight(), mPixels.GetPixelFormat() );
image.Upload( mPixels, 0, 0 );
else
{
ResourceImage resourceImage = Dali::ResourceImage::New( url, mDesiredSize, mFittingMode, mSamplingMode );
- resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+ resourceImage.LoadingFinishedSignal().Connect( this, &ImageVisual::OnImageLoaded );
return resourceImage;
}
}
-TextureSet ImageRenderer::CreateTextureSet( Vector4& textureRect, const std::string& url, bool synchronousLoading )
+TextureSet ImageVisual::CreateTextureSet( Vector4& textureRect, const std::string& url, bool synchronousLoading )
{
TextureSet textureSet;
textureRect = FULL_TEXTURE_RECT;
{
// use broken image
textureSet = TextureSet::New();
- TextureSetImage( textureSet, 0u, RendererFactory::GetBrokenRendererImage() );
+ TextureSetImage( textureSet, 0u, VisualFactory::GetBrokenRendererImage() );
}
else
{
if( !textureSet ) // big image, no atlasing
{
ResourceImage resourceImage = Dali::ResourceImage::New( url, mDesiredSize, mFittingMode, mSamplingMode );
- resourceImage.LoadingFinishedSignal().Connect( this, &ImageRenderer::OnImageLoaded );
+ resourceImage.LoadingFinishedSignal().Connect( this, &ImageVisual::OnImageLoaded );
textureSet = TextureSet::New();
TextureSetImage( textureSet, 0u, resourceImage );
}
return textureSet;
}
-void ImageRenderer::InitializeRenderer( const std::string& imageUrl )
+void ImageVisual::InitializeRenderer( const std::string& imageUrl )
{
if( imageUrl.empty() )
{
}
}
-void ImageRenderer::InitializeRenderer( const Image& image )
+void ImageVisual::InitializeRenderer( const Image& image )
{
mImpl->mFlags &= ~Impl::IS_FROM_CACHE;
}
-void ImageRenderer::DoSetOnStage( Actor& actor )
+void ImageVisual::DoSetOnStage( Actor& actor )
{
if( !mImageUrl.empty() )
{
}
-void ImageRenderer::DoSetOffStage( Actor& actor )
+void ImageVisual::DoSetOffStage( Actor& actor )
{
//If we own the image then make sure we release it when we go off stage
if( !mImageUrl.empty() )
}
}
-void ImageRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void ImageVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, IMAGE_RENDERER );
}
}
-Shader ImageRenderer::GetImageShader( RendererFactoryCache& factoryCache )
+Shader ImageVisual::GetImageShader( VisualFactoryCache& factoryCache )
{
- Shader shader = factoryCache.GetShader( RendererFactoryCache::IMAGE_SHADER );
+ Shader shader = factoryCache.GetShader( VisualFactoryCache::IMAGE_SHADER );
if( !shader )
{
shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
- factoryCache.SaveShader( RendererFactoryCache::IMAGE_SHADER, shader );
+ factoryCache.SaveShader( VisualFactoryCache::IMAGE_SHADER, shader );
shader.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, FULL_TEXTURE_RECT );
shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
}
return shader;
}
-void ImageRenderer::SetImage( Actor& actor, const std::string& imageUrl, ImageDimensions size, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode )
+void ImageVisual::SetImage( Actor& actor, const std::string& imageUrl, ImageDimensions size, Dali::FittingMode::Type fittingMode, Dali::SamplingMode::Type samplingMode )
{
if( mImageUrl != imageUrl )
{
}
}
-void ImageRenderer::SetImage( Actor& actor, const Image& image )
+void ImageVisual::SetImage( Actor& actor, const Image& image )
{
if( mImage != image )
{
}
}
-void ImageRenderer::ApplyImageToSampler( const Image& image )
+void ImageVisual::ApplyImageToSampler( const Image& image )
{
if( image )
{
}
}
-void ImageRenderer::OnImageLoaded( ResourceImage image )
+void ImageVisual::OnImageLoaded( ResourceImage image )
{
if( image.GetLoadingState() == Dali::ResourceLoadingFailed )
{
- Image brokenImage = RendererFactory::GetBrokenRendererImage();
+ Image brokenImage = VisualFactory::GetBrokenRendererImage();
if( mImpl->mRenderer )
{
ApplyImageToSampler( brokenImage );
}
}
-void ImageRenderer::CleanCache(const std::string& url)
+void ImageVisual::CleanCache(const std::string& url)
{
TextureSet textureSet = mImpl->mRenderer.GetTextures();
}
}
-void ImageRenderer::SetNativeFragmentShaderCode( Dali::NativeImage& nativeImage )
+void ImageVisual::SetNativeFragmentShaderCode( Dali::NativeImage& nativeImage )
{
const char* fragmentPreFix = nativeImage.GetCustomFragmentPreFix();
const char* customSamplerTypename = nativeImage.GetCustomSamplerTypename();
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
#include <dali-toolkit/internal/controls/renderers/image-atlas-manager.h>
// EXTERNAL INCLUDES
namespace Internal
{
-class ImageRenderer;
-typedef IntrusivePtr< ImageRenderer > ImageRendererPtr;
+class ImageVisual;
+typedef IntrusivePtr< ImageVisual > ImageVisualPtr;
/**
* The renderer which renders an image to the control's quad
* "DEFAULT"
*
*/
-class ImageRenderer: public ControlRenderer, public ConnectionTracker
+class ImageVisual: public Visual, public ConnectionTracker
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache The RendererFactoryCache object
+ * @param[in] factoryCache The VisualFactoryCache object
* @param[in] atlasManager The atlasManager object
*/
- ImageRenderer( RendererFactoryCache& factoryCache, ImageAtlasManager& atlasManager );
+ ImageVisual( VisualFactoryCache& factoryCache, ImageAtlasManager& atlasManager );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- ~ImageRenderer();
+ ~ImageVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::SetSize
+ * @copydoc Visual::SetSize
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc ControlRenderer::GetNaturalSize
+ * @copydoc Visual::GetNaturalSize
*/
virtual void GetNaturalSize( Vector2& naturalSize ) const;
/**
- * @copydoc ControlRenderer::SetClipRect
+ * @copydoc Visual::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
/**
- * @copydoc ControlRenderer::SetOffset
+ * @copydoc Visual::SetOffset
*/
virtual void SetOffset( const Vector2& offset );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
/**
- * @copydoc ControlRenderer::DoSetOffStage
+ * @copydoc Visual::DoSetOffStage
*/
virtual void DoSetOffStage( Actor& actor );
/**
* Get the standard image rendering shader.
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- static Shader GetImageShader( RendererFactoryCache& factoryCache );
+ static Shader GetImageShader( VisualFactoryCache& factoryCache );
/**
* @brief Sets the image of this renderer to the resource at imageUrl
/**
* @brief Initializes the Dali::Renderer from an image url string
*
- * @param[in] imageUrl The image url string to intialize this ImageRenderer from
+ * @param[in] imageUrl The image url string to intialize this ImageVisual from
*/
void InitializeRenderer( const std::string& imageUrl );
/**
* @brief Initializes the Dali::Renderer from an image handle
*
- * @param[in] image The image handle to intialize this ImageRenderer from
+ * @param[in] image The image handle to intialize this ImageVisual from
*/
void InitializeRenderer( const Image& image );
*
* @return Returns the created Dali::Renderer
*/
- Renderer CreateNativeImageRenderer() const;
+ Renderer CreateNativeImageVisual() const;
/**
* @brief Query whether resources requires to be loaded synchronously.
*/
// CLASS HEADER
-#include "mesh-renderer.h"
+#include "mesh-visual.h"
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <fstream>
//INTERNAL INCLUDES
-#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-string-constants.h>
+#include <dali-toolkit/internal/controls/renderers/visual-data-impl.h>
namespace Dali
{
} // namespace
-MeshRenderer::MeshRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache ),
+MeshVisual::MeshVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache ),
mShaderType( ALL_TEXTURES ),
mUseTexture( true ),
mUseMipmapping( true ),
{
}
-MeshRenderer::~MeshRenderer()
+MeshVisual::~MeshVisual()
{
}
-void MeshRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void MeshVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
Property::Value* objectUrl = propertyMap.Find( OBJECT_URL );
if( !objectUrl || !objectUrl->Get( mObjectUrl ) )
{
- DALI_LOG_ERROR( "Fail to provide object URL to the MeshRenderer object.\n" );
+ DALI_LOG_ERROR( "Fail to provide object URL to the MeshVisual object.\n" );
}
Property::Value* materialUrl = propertyMap.Find( MATERIAL_URL );
}
else
{
- DALI_LOG_ERROR( "Unknown shader type provided to the MeshRenderer object.\n");
+ DALI_LOG_ERROR( "Unknown shader type provided to the MeshVisual object.\n");
}
}
}
}
}
-void MeshRenderer::SetSize( const Vector2& size )
+void MeshVisual::SetSize( const Vector2& size )
{
- ControlRenderer::SetSize( size );
+ Visual::SetSize( size );
// ToDo: renderer responds to the size change
}
-void MeshRenderer::SetClipRect( const Rect<int>& clipRect )
+void MeshVisual::SetClipRect( const Rect<int>& clipRect )
{
- ControlRenderer::SetClipRect( clipRect );
+ Visual::SetClipRect( clipRect );
//ToDo: renderer responds to the clipRect change
}
-void MeshRenderer::SetOffset( const Vector2& offset )
+void MeshVisual::SetOffset( const Vector2& offset )
{
//ToDo: renderer applies the offset
}
-void MeshRenderer::DoSetOnStage( Actor& actor )
+void MeshVisual::DoSetOnStage( Actor& actor )
{
InitializeRenderer();
}
-void MeshRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void MeshVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, MESH_RENDERER );
map.Insert( LIGHT_POSITION_UNIFORM_NAME, mLightPosition );
}
-void MeshRenderer::InitializeRenderer()
+void MeshVisual::InitializeRenderer()
{
//Try to load the geometry from the file.
if( !LoadGeometry() )
mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
}
-void MeshRenderer::SupplyEmptyGeometry()
+void MeshVisual::SupplyEmptyGeometry()
{
mGeometry = Geometry::New();
mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER );
DALI_LOG_ERROR( "Initialisation error in mesh renderer.\n" );
}
-void MeshRenderer::UpdateShaderUniforms()
+void MeshVisual::UpdateShaderUniforms()
{
Stage stage = Stage::GetCurrent();
float width = stage.GetSize().width;
mShader.RegisterProperty( OBJECT_MATRIX_UNIFORM_NAME, scaleMatrix );
}
-void MeshRenderer::CreateShader()
+void MeshVisual::CreateShader()
{
if( mShaderType == ALL_TEXTURES )
{
UpdateShaderUniforms();
}
-bool MeshRenderer::CreateGeometry()
+bool MeshVisual::CreateGeometry()
{
//Determine if we need to use a simpler shader to handle the provided data
if( !mUseTexture || !mObjLoader.IsDiffuseMapPresent() )
return false;
}
-bool MeshRenderer::LoadGeometry()
+bool MeshVisual::LoadGeometry()
{
std::streampos fileSize;
Dali::Vector<char> fileContent;
return false;
}
-bool MeshRenderer::LoadMaterial()
+bool MeshVisual::LoadMaterial()
{
std::streampos fileSize;
Dali::Vector<char> fileContent;
return false;
}
-bool MeshRenderer::LoadTextures()
+bool MeshVisual::LoadTextures()
{
mTextureSet = TextureSet::New();
#include <string.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
#include <dali-toolkit/internal/controls/model3d-view/obj-loader.h>
namespace Dali
* | useSoftNormals | BOOLEAN | If true, average normals at points for smooth textures. Default true. |
* | lightPosition | VECTOR3 | The position (on stage) of the light |
*/
-class MeshRenderer: public ControlRenderer
+class MeshVisual: public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- MeshRenderer( RendererFactoryCache& factoryCache );
+ MeshVisual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- virtual ~MeshRenderer();
+ virtual ~MeshVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::SetSize
+ * @copydoc Visual::SetSize
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc ControlRenderer::SetClipRect
+ * @copydoc Visual::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
/**
- * @copydoc ControlRenderer::SetOffset
+ * @copydoc Visual::SetOffset
*/
virtual void SetOffset( const Vector2& offset );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
private:
// Undefined
- MeshRenderer( const MeshRenderer& meshRenderer );
+ MeshVisual( const MeshVisual& meshRenderer );
// Undefined
- MeshRenderer& operator=( const MeshRenderer& meshRenderer );
+ MeshVisual& operator=( const MeshVisual& meshRenderer );
private:
*/
// CLASS HEADER
-#include "npatch-renderer.h"
+#include "npatch-visual.h"
// EXTERNAL INCLUDES
#include <dali/integration-api/platform-abstraction.h>
#include <dali/devel-api/images/texture-set-image.h>
// INTERNAL IINCLUDES
-#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-impl.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-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-data-impl.h>
namespace Dali
} //unnamed namespace
-/////////////////NPatchRenderer////////////////
+/////////////////NPatchVisual////////////////
-NPatchRenderer::NPatchRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache ),
+NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache ),
mBorderOnly( false )
{
}
-NPatchRenderer::~NPatchRenderer()
+NPatchVisual::~NPatchVisual()
{
}
-void NPatchRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void NPatchVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
Property::Value* imageURLValue = propertyMap.Find( IMAGE_URL_NAME );
if( imageURLValue )
}
}
-void NPatchRenderer::GetNaturalSize( Vector2& naturalSize ) const
+void NPatchVisual::GetNaturalSize( Vector2& naturalSize ) const
{
if( mImage )
{
}
}
-void NPatchRenderer::SetClipRect( const Rect<int>& clipRect )
+void NPatchVisual::SetClipRect( const Rect<int>& clipRect )
{
- ControlRenderer::SetClipRect( clipRect );
+ Visual::SetClipRect( clipRect );
//ToDo: renderer responds to the clipRect change
}
-void NPatchRenderer::SetOffset( const Vector2& offset )
+void NPatchVisual::SetOffset( const Vector2& offset )
{
//ToDo: renderer applies the offset
}
-Geometry NPatchRenderer::CreateGeometry()
+Geometry NPatchVisual::CreateGeometry()
{
Geometry geometry;
if( mStretchPixelsX.Size() == 1 && mStretchPixelsY.Size() == 1 )
{
if( !mBorderOnly )
{
- geometry = mFactoryCache.GetGeometry( RendererFactoryCache::NINE_PATCH_GEOMETRY );
+ geometry = mFactoryCache.GetGeometry( VisualFactoryCache::NINE_PATCH_GEOMETRY );
if( !geometry )
{
geometry = CreateGeometry( Uint16Pair( 3, 3 ) );
- mFactoryCache.SaveGeometry( RendererFactoryCache::NINE_PATCH_GEOMETRY, geometry );
+ mFactoryCache.SaveGeometry( VisualFactoryCache::NINE_PATCH_GEOMETRY, geometry );
}
}
else
{
- geometry = mFactoryCache.GetGeometry( RendererFactoryCache::NINE_PATCH_BORDER_GEOMETRY );
+ geometry = mFactoryCache.GetGeometry( VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY );
if( !geometry )
{
geometry = CreateGeometryBorder( Uint16Pair( 3, 3 ) );
- mFactoryCache.SaveGeometry( RendererFactoryCache::NINE_PATCH_BORDER_GEOMETRY, geometry );
+ mFactoryCache.SaveGeometry( VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY, geometry );
}
}
}
return geometry;
}
-Shader NPatchRenderer::CreateShader()
+Shader NPatchVisual::CreateShader()
{
Shader shader;
if( !mImpl->mCustomShader )
{
if( mStretchPixelsX.Size() == 1 && mStretchPixelsY.Size() == 1 )
{
- shader = mFactoryCache.GetShader( RendererFactoryCache::NINE_PATCH_SHADER );
+ shader = mFactoryCache.GetShader( VisualFactoryCache::NINE_PATCH_SHADER );
if( !shader )
{
shader = Shader::New( VERTEX_SHADER_3X3, FRAGMENT_SHADER );
- mFactoryCache.SaveShader( RendererFactoryCache::NINE_PATCH_SHADER, shader );
+ mFactoryCache.SaveShader( VisualFactoryCache::NINE_PATCH_SHADER, shader );
}
}
else if( mStretchPixelsX.Size() > 0 || mStretchPixelsY.Size() > 0)
return shader;
}
-void NPatchRenderer::InitializeRenderer()
+void NPatchVisual::InitializeRenderer()
{
Geometry geometry = CreateGeometry();
Shader shader = CreateShader();
}
-void NPatchRenderer::DoSetOnStage( Actor& actor )
+void NPatchVisual::DoSetOnStage( Actor& actor )
{
if( !mCroppedImage )
{
}
}
-void NPatchRenderer::DoSetOffStage( Actor& actor )
+void NPatchVisual::DoSetOffStage( Actor& actor )
{
mCroppedImage.Reset();
actor.RemoveRenderer( mImpl->mRenderer );
mImpl->mRenderer.Reset();
}
-void NPatchRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void NPatchVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, IMAGE_RENDERER );
map.Insert( BORDER_ONLY, mBorderOnly );
}
-void NPatchRenderer::ChangeRenderer( bool oldBorderOnly, size_t oldGridX, size_t oldGridY )
+void NPatchVisual::ChangeRenderer( bool oldBorderOnly, size_t oldGridX, size_t oldGridY )
{
//check to see if the border style has changed
}
}
-void NPatchRenderer::SetImage( const std::string& imageUrl, bool borderOnly )
+void NPatchVisual::SetImage( const std::string& imageUrl, bool borderOnly )
{
bool oldBorderOnly = mBorderOnly;
size_t oldGridX = mStretchPixelsX.Size();
}
}
-void NPatchRenderer::SetImage( NinePatchImage image, bool borderOnly )
+void NPatchVisual::SetImage( NinePatchImage image, bool borderOnly )
{
bool oldBorderOnly = mBorderOnly;
size_t oldGridX = mStretchPixelsX.Size();
}
}
-void NPatchRenderer::InitializeFromImage( NinePatchImage nPatch )
+void NPatchVisual::InitializeFromImage( NinePatchImage nPatch )
{
mCroppedImage = nPatch.CreateCroppedBufferImage();
if( !mCroppedImage )
mStretchPixelsY = nPatch.GetStretchPixelsY();
}
-void NPatchRenderer::InitializeFromBrokenImage()
+void NPatchVisual::InitializeFromBrokenImage()
{
- mCroppedImage = RendererFactory::GetBrokenRendererImage();
+ mCroppedImage = VisualFactory::GetBrokenRendererImage();
mImageSize = ImageDimensions( mCroppedImage.GetWidth(), mCroppedImage.GetHeight() );
mStretchPixelsX.Clear();
mStretchPixelsY.PushBack( Uint16Pair( 0, mImageSize.GetHeight() ) );
}
-void NPatchRenderer::ApplyImageToSampler()
+void NPatchVisual::ApplyImageToSampler()
{
TextureSet textureSet = mImpl->mRenderer.GetTextures();
if( textureSet )
}
}
-Geometry NPatchRenderer::CreateGeometry( Uint16Pair gridSize )
+Geometry NPatchVisual::CreateGeometry( Uint16Pair gridSize )
{
uint16_t gridWidth = gridSize.GetWidth();
uint16_t gridHeight = gridSize.GetHeight();
return GenerateGeometry( vertices, indices );
}
-Geometry NPatchRenderer::CreateGeometryBorder( Uint16Pair gridSize )
+Geometry NPatchVisual::CreateGeometryBorder( Uint16Pair gridSize )
{
uint16_t gridWidth = gridSize.GetWidth();
uint16_t gridHeight = gridSize.GetHeight();
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
// EXTERNAL INCLUDES
#include <dali/public-api/images/image.h>
* | borderOnly | BOOLEAN
*
*/
-class NPatchRenderer: public ControlRenderer
+class NPatchVisual: public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- NPatchRenderer( RendererFactoryCache& factoryCache );
+ NPatchVisual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- ~NPatchRenderer();
+ ~NPatchVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::GetNaturalSize
+ * @copydoc Visual::GetNaturalSize
*/
virtual void GetNaturalSize( Vector2& naturalSize ) const;
/**
- * @copydoc ControlRenderer::SetClipRect
+ * @copydoc Visual::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
/**
- * @copydoc ControlRenderer::SetOffset
+ * @copydoc Visual::SetOffset
*/
virtual void SetOffset( const Vector2& offset );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
/**
- * @copydoc ControlRenderer::DoSetOffStage
+ * @copydoc Visual::DoSetOffStage
*/
virtual void DoSetOffStage( Actor& actor );
*/
// CLASS HEADER
-#include "primitive-renderer.h"
+#include "primitive-visual.h"
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/public-api/common/constants.h>
//INTERNAL INCLUDES
-#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-string-constants.h>
+#include <dali-toolkit/internal/controls/renderers/visual-data-impl.h>
namespace Dali
{
} // namespace
-PrimitiveRenderer::PrimitiveRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache ),
+PrimitiveVisual::PrimitiveVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache ),
mColor( DEFAULT_COLOR ),
mScaleDimensions( Vector3::ONE ),
mScaleTopRadius( DEFAULT_SCALE_TOP_RADIUS ),
{
}
-PrimitiveRenderer::~PrimitiveRenderer()
+PrimitiveVisual::~PrimitiveVisual()
{
}
-void PrimitiveRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void PrimitiveVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
//Find out which shape to renderer.
Property::Value* primitiveType = propertyMap.Find( PRIMITIVE_SHAPE );
}
else
{
- DALI_LOG_ERROR( "No known shape in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "No known shape in PrimitiveVisual.\n" );
}
}
else
{
- DALI_LOG_ERROR( "Invalid type for shape in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for shape in PrimitiveVisual.\n" );
}
}
else
{
- DALI_LOG_ERROR( "Fail to provide shape to the PrimitiveRenderer object.\n" );
+ DALI_LOG_ERROR( "Fail to provide shape to the PrimitiveVisual object.\n" );
}
//Read in other potential properties.
Property::Value* color = propertyMap.Find( SHAPE_COLOR );
if( color && !color->Get( mColor ) )
{
- DALI_LOG_ERROR( "Invalid type for color in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for color in PrimitiveVisual.\n" );
}
Property::Value* slices = propertyMap.Find( SLICES );
}
else
{
- DALI_LOG_ERROR( "Invalid type for slices in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for slices in PrimitiveVisual.\n" );
}
}
}
else
{
- DALI_LOG_ERROR( "Invalid type for stacks in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for stacks in PrimitiveVisual.\n" );
}
}
Property::Value* scaleTop = propertyMap.Find( SCALE_TOP_RADIUS );
if( scaleTop && !scaleTop->Get( mScaleTopRadius ) )
{
- DALI_LOG_ERROR( "Invalid type for scale top radius in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for scale top radius in PrimitiveVisual.\n" );
}
Property::Value* scaleBottom = propertyMap.Find( SCALE_BOTTOM_RADIUS );
if( scaleBottom && !scaleBottom->Get( mScaleBottomRadius ) )
{
- DALI_LOG_ERROR( "Invalid type for scale bottom radius in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for scale bottom radius in PrimitiveVisual.\n" );
}
Property::Value* scaleHeight = propertyMap.Find( SCALE_HEIGHT );
if( scaleHeight && !scaleHeight->Get( mScaleHeight ) )
{
- DALI_LOG_ERROR( "Invalid type for scale height in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for scale height in PrimitiveVisual.\n" );
}
Property::Value* scaleRadius = propertyMap.Find( SCALE_RADIUS );
if( scaleRadius && !scaleRadius->Get( mScaleRadius ) )
{
- DALI_LOG_ERROR( "Invalid type for scale radius in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for scale radius in PrimitiveVisual.\n" );
}
Property::Value* dimensions = propertyMap.Find( SCALE_DIMENSIONS );
}
else
{
- DALI_LOG_ERROR( "Invalid type for scale dimensions in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for scale dimensions in PrimitiveVisual.\n" );
}
}
}
else
{
- DALI_LOG_ERROR( "Invalid type for bevel percentage in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for bevel percentage in PrimitiveVisual.\n" );
}
}
}
else
{
- DALI_LOG_ERROR( "Invalid type for bevel smoothness in PrimitiveRenderer.\n" );
+ DALI_LOG_ERROR( "Invalid type for bevel smoothness in PrimitiveVisual.\n" );
}
}
{
if( !lightPosition->Get( mLightPosition ) )
{
- DALI_LOG_ERROR( "Invalid value passed for light position in MeshRenderer object.\n" );
+ DALI_LOG_ERROR( "Invalid value passed for light position in MeshVisual object.\n" );
mLightPosition = Vector3::ZERO;
}
}
}
}
-void PrimitiveRenderer::SetSize( const Vector2& size )
+void PrimitiveVisual::SetSize( const Vector2& size )
{
- ControlRenderer::SetSize( size );
+ Visual::SetSize( size );
// ToDo: renderer responds to the size change
}
-void PrimitiveRenderer::SetClipRect( const Rect<int>& clipRect )
+void PrimitiveVisual::SetClipRect( const Rect<int>& clipRect )
{
- ControlRenderer::SetClipRect( clipRect );
+ Visual::SetClipRect( clipRect );
//ToDo: renderer responds to the clipRect change
}
-void PrimitiveRenderer::SetOffset( const Vector2& offset )
+void PrimitiveVisual::SetOffset( const Vector2& offset )
{
//ToDo: renderer applies the offset
}
-void PrimitiveRenderer::DoSetOnStage( Actor& actor )
+void PrimitiveVisual::DoSetOnStage( Actor& actor )
{
InitializeRenderer();
}
-void PrimitiveRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void PrimitiveVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, RENDERER_TYPE_VALUE );
map.Insert( LIGHT_POSITION_UNIFORM_NAME, mLightPosition );
}
-void PrimitiveRenderer::InitializeRenderer()
+void PrimitiveVisual::InitializeRenderer()
{
if( !mGeometry )
{
mImpl->mRenderer = Renderer::New( mGeometry, mShader );
}
-void PrimitiveRenderer::UpdateShaderUniforms()
+void PrimitiveVisual::UpdateShaderUniforms()
{
Stage stage = Stage::GetCurrent();
float width = stage.GetSize().width;
mShader.RegisterProperty( OBJECT_DIMENSIONS_UNIFORM_NAME, mObjectDimensions );
}
-void PrimitiveRenderer::CreateShader()
+void PrimitiveVisual::CreateShader()
{
mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
UpdateShaderUniforms();
}
-void PrimitiveRenderer::CreateGeometry()
+void PrimitiveVisual::CreateGeometry()
{
Dali::Vector<Vertex> vertices;
Dali::Vector<unsigned short> indices;
mGeometry.SetIndexBuffer( &indices[0], indices.Size() );
}
-void PrimitiveRenderer::CreateSphere( Vector<Vertex>& vertices, Vector<unsigned short>& indices, int slices, int stacks )
+void PrimitiveVisual::CreateSphere( Vector<Vertex>& vertices, Vector<unsigned short>& indices, int slices, int stacks )
{
ComputeSphereVertices( vertices, slices, stacks );
FormSphereTriangles( indices, slices, stacks );
mObjectDimensions = Vector3::ONE;
}
-void PrimitiveRenderer::CreateConic( Vector<Vertex>& vertices, Vector<unsigned short>& indices, float scaleTopRadius,
+void PrimitiveVisual::CreateConic( Vector<Vertex>& vertices, Vector<unsigned short>& indices, float scaleTopRadius,
float scaleBottomRadius, float scaleHeight, int slices )
{
ComputeConicVertices( vertices, scaleTopRadius, scaleBottomRadius, scaleHeight, slices );
xDimension / largestDimension );
}
-void PrimitiveRenderer::CreateBevelledCube( Vector<Vertex>& vertices, Vector<unsigned short>& indices,
+void PrimitiveVisual::CreateBevelledCube( Vector<Vertex>& vertices, Vector<unsigned short>& indices,
Vector3 dimensions, float bevelPercentage, float bevelSmoothness )
{
dimensions.Normalize();
mObjectDimensions = dimensions;
}
-void PrimitiveRenderer::ComputeCircleTables( Vector<float>& sinTable, Vector<float>& cosTable, int divisions,
+void PrimitiveVisual::ComputeCircleTables( Vector<float>& sinTable, Vector<float>& cosTable, int divisions,
bool halfCircle )
{
if( divisions < 0 )
}
}
-void PrimitiveRenderer::ComputeSphereVertices( Vector<Vertex>& vertices, int slices, int stacks )
+void PrimitiveVisual::ComputeSphereVertices( Vector<Vertex>& vertices, int slices, int stacks )
{
//Tables for calculating slices angles and stacks angles, respectively.
Vector<float> sinTable1;
vertices[vertexIndex].normal = Vector3( 0.0, -1.0, 0.0 );
}
-void PrimitiveRenderer::FormSphereTriangles( Vector<unsigned short>& indices, int slices, int stacks )
+void PrimitiveVisual::FormSphereTriangles( Vector<unsigned short>& indices, int slices, int stacks )
{
if( stacks <= 1 )
{
}
}
-void PrimitiveRenderer::ComputeConicVertices( Vector<Vertex>& vertices, float scaleTopRadius,
+void PrimitiveVisual::ComputeConicVertices( Vector<Vertex>& vertices, float scaleTopRadius,
float scaleBottomRadius, float scaleHeight, int slices )
{
int vertexIndex = 0; //Track progress through vertices.
vertexIndex++;
}
-void PrimitiveRenderer::FormConicTriangles( Vector<unsigned short>& indices, float scaleTopRadius,
+void PrimitiveVisual::FormConicTriangles( Vector<unsigned short>& indices, float scaleTopRadius,
float scaleBottomRadius, int slices )
{
int indiceIndex = 0; //Track progress through indices.
}
}
-void PrimitiveRenderer::ComputeCubeVertices( Vector<Vertex>& vertices, Vector3 dimensions )
+void PrimitiveVisual::ComputeCubeVertices( Vector<Vertex>& vertices, Vector3 dimensions )
{
int numVertices = 4 * 6; //Four per face.
int vertexIndex = 0; //Tracks progress through vertices.
}
-void PrimitiveRenderer::FormCubeTriangles( Vector<unsigned short>& indices )
+void PrimitiveVisual::FormCubeTriangles( Vector<unsigned short>& indices )
{
int numTriangles = 12;
int triangleIndex = 0; //Track progress through indices.
indices[triangleIndex + 5] = 20;
}
-void PrimitiveRenderer::ComputeOctahedronVertices( Vector<Vertex>& vertices, Vector3 dimensions, float smoothness )
+void PrimitiveVisual::ComputeOctahedronVertices( Vector<Vertex>& vertices, Vector3 dimensions, float smoothness )
{
int numVertices = 3 * 8; //Three per face
int vertexIndex = 0; //Tracks progress through vertices.
}
}
-void PrimitiveRenderer::FormOctahedronTriangles( Vector<unsigned short>& indices )
+void PrimitiveVisual::FormOctahedronTriangles( Vector<unsigned short>& indices )
{
int numTriangles = 8;
int numIndices = numTriangles * 3;
}
}
-void PrimitiveRenderer::ComputeBevelledCubeVertices( Vector<Vertex>& vertices, Vector3 dimensions,
+void PrimitiveVisual::ComputeBevelledCubeVertices( Vector<Vertex>& vertices, Vector3 dimensions,
float bevelPercentage, float bevelSmoothness )
{
int numPositions = 24;
normalIndex++;
}
-void PrimitiveRenderer::FormBevelledCubeTriangles( Vector<unsigned short>& indices )
+void PrimitiveVisual::FormBevelledCubeTriangles( Vector<unsigned short>& indices )
{
int numTriangles = 44; //(Going from top to bottom, that's 2 + 12 + 16 + 12 + 2)
int indiceIndex = 0; //Track progress through indices.
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
namespace Dali
{
* |-----------------|-------------|-----------------------------------------|
* | lightPosition | VECTOR3 | The position (on stage) of the light |
*/
-class PrimitiveRenderer: public ControlRenderer
+class PrimitiveVisual: public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- PrimitiveRenderer( RendererFactoryCache& factoryCache );
+ PrimitiveVisual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- virtual ~PrimitiveRenderer();
+ virtual ~PrimitiveVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::SetSize
+ * @copydoc Visual::SetSize
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc ControlRenderer::SetClipRect
+ * @copydoc Visual::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
/**
- * @copydoc ControlRenderer::SetOffset
+ * @copydoc Visual::SetOffset
*/
virtual void SetOffset( const Vector2& offset );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
private:
// Undefined
- PrimitiveRenderer( const PrimitiveRenderer& PrimitiveRenderer );
+ PrimitiveVisual( const PrimitiveVisual& PrimitiveVisual );
// Undefined
- PrimitiveRenderer& operator=( const PrimitiveRenderer& PrimitiveRenderer );
+ PrimitiveVisual& operator=( const PrimitiveVisual& PrimitiveVisual );
private:
Shader mShader;
// INTERNAL INCLUDES
#include <dali-toolkit/third-party/nanosvg/nanosvgrast.h>
-#include <dali-toolkit/internal/controls/renderers/svg/svg-renderer.h>
+#include <dali-toolkit/internal/controls/renderers/svg/svg-visual.h>
namespace Dali
{
namespace Internal
{
-RasterizingTask::RasterizingTask( SvgRenderer* svgRenderer, NSVGimage* parsedSvg, unsigned int width, unsigned int height )
-: mSvgRenderer( svgRenderer ),
+RasterizingTask::RasterizingTask( SvgVisual* svgRenderer, NSVGimage* parsedSvg, unsigned int width, unsigned int height )
+: mSvgVisual( svgRenderer ),
mParsedSvg( parsedSvg ),
mWidth( width ),
mHeight( height )
}
}
-SvgRenderer* RasterizingTask::GetSvgRenderer() const
+SvgVisual* RasterizingTask::GetSvgVisual() const
{
- return mSvgRenderer.Get();
+ return mSvgVisual.Get();
}
PixelData RasterizingTask::GetPixelData() const
// Older task which waiting to rasterize and apply the svg to the same renderer is expired.
for( std::vector< RasterizingTaskPtr >::iterator it = mRasterizeTasks.begin(), endIt = mRasterizeTasks.end(); it != endIt; ++it )
{
- if( (*it) && (*it)->GetSvgRenderer() == task->GetSvgRenderer() )
+ if( (*it) && (*it)->GetSvgVisual() == task->GetSvgVisual() )
{
mRasterizeTasks.erase( it );
break;
return nextTask;
}
-void SvgRasterizeThread::RemoveTask( SvgRenderer* renderer )
+void SvgRasterizeThread::RemoveTask( SvgVisual* renderer )
{
// Lock while remove task from the queue
ConditionalWait::ScopedLock lock( mConditionalWait );
{
for( std::vector< RasterizingTaskPtr >::iterator it = mRasterizeTasks.begin(), endIt = mRasterizeTasks.end(); it != endIt; ++it )
{
- if( (*it) && (*it)->GetSvgRenderer() == renderer )
+ if( (*it) && (*it)->GetSvgVisual() == renderer )
{
mRasterizeTasks.erase( it );
break;
namespace Internal
{
-class SvgRenderer;
-typedef IntrusivePtr< SvgRenderer > SvgRendererPtr;
+class SvgVisual;
+typedef IntrusivePtr< SvgVisual > SvgVisualPtr;
class RasterizingTask;
typedef IntrusivePtr< RasterizingTask > RasterizingTaskPtr;
* The svg rasterizing tasks to be processed in the worker thread.
*
* Life cycle of a rasterizing task is as follows:
- * 1. Created by SvgRenderer in the main thread
+ * 1. Created by SvgVisual in the main thread
* 2. Queued in the worked thread waiting to be processed.
* 3. If this task gets its turn to do the rasterization, it triggers main thread to apply the rasterized image to material then been deleted in main thread call back
* Or if this task is been removed ( new image/size set to the renderer or actor off stage) before its turn to be processed, it then been deleted in the worker thread.
* @param[in] width The rasterization width.
* @param[in] height The rasterization height.
*/
- RasterizingTask( SvgRenderer* svgRenderer, NSVGimage* parsedSvg, unsigned int width, unsigned int height );
+ RasterizingTask( SvgVisual* svgRenderer, NSVGimage* parsedSvg, unsigned int width, unsigned int height );
/**
* Do the rasterization with the given rasterizer.
/**
* Get the svg renderer
*/
- SvgRenderer* GetSvgRenderer() const;
+ SvgVisual* GetSvgVisual() const;
/**
* Get the rasterization result.
RasterizingTask& operator=( const RasterizingTask& task );
private:
- SvgRendererPtr mSvgRenderer;
+ SvgVisualPtr mSvgVisual;
PixelData mPixelData;
NSVGimage* mParsedSvg;
unsigned int mWidth;
*
* @param[in] renderer The renderer pointer.
*/
- void RemoveTask( SvgRenderer* renderer );
+ void RemoveTask( SvgVisual* renderer );
/**
* Delete the parsed SVG image, called by main thread.
*/
// CLASS HEADER
-#include "svg-renderer.h"
+#include "svg-visual.h"
// EXTERNAL INCLUDES
#include <dali/public-api/images/buffer-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/third-party/nanosvg/nanosvg.h>
#include <dali-toolkit/internal/controls/renderers/svg/svg-rasterize-thread.h>
-#include <dali-toolkit/internal/controls/renderers/image/image-renderer.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/image/image-visual.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
namespace Internal
{
-SvgRenderer::SvgRenderer( RendererFactoryCache& factoryCache, ImageAtlasManager& atlasManager )
-: ControlRenderer( factoryCache ),
+SvgVisual::SvgVisual( VisualFactoryCache& factoryCache, ImageAtlasManager& atlasManager )
+: Visual( factoryCache ),
mAtlasRect( FULL_TEXTURE_RECT ),
mAtlasManager( atlasManager ),
mParsedImage( NULL )
mImpl->mFlags |= Impl::IS_PREMULTIPLIED_ALPHA;
}
-SvgRenderer::~SvgRenderer()
+SvgVisual::~SvgVisual()
{
if( mParsedImage )
{
}
}
-bool SvgRenderer::IsSvgUrl( const std::string& url )
+bool SvgVisual::IsSvgUrl( const std::string& url )
{
return url.substr( url.find_last_of(".") + 1 ) == "svg";
}
-void SvgRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void SvgVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
{
Property::Value* imageURLValue = propertyMap.Find( IMAGE_URL_NAME );
if( imageURLValue )
}
}
-void SvgRenderer::DoSetOnStage( Actor& actor )
+void SvgVisual::DoSetOnStage( Actor& actor )
{
- Shader shader = ImageRenderer::GetImageShader( mFactoryCache );
- Geometry geometry = mFactoryCache.GetGeometry( RendererFactoryCache::QUAD_GEOMETRY );
+ Shader shader = ImageVisual::GetImageShader( mFactoryCache );
+ Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
if( !geometry )
{
geometry = mFactoryCache.CreateQuadGeometry();
- mFactoryCache.SaveGeometry( RendererFactoryCache::QUAD_GEOMETRY, geometry );
+ mFactoryCache.SaveGeometry( VisualFactoryCache::QUAD_GEOMETRY, geometry );
}
TextureSet textureSet = TextureSet::New();
mImpl->mRenderer = Renderer::New( geometry, shader );
}
}
-void SvgRenderer::DoSetOffStage( Actor& actor )
+void SvgVisual::DoSetOffStage( Actor& actor )
{
mFactoryCache.GetSVGRasterizationThread()->RemoveTask( this );
mImpl->mRenderer.Reset();
}
-void SvgRenderer::GetNaturalSize( Vector2& naturalSize ) const
+void SvgVisual::GetNaturalSize( Vector2& naturalSize ) const
{
if( mParsedImage )
{
}
}
-void SvgRenderer::SetSize( const Vector2& size )
+void SvgVisual::SetSize( const Vector2& size )
{
if(mImpl->mSize != size && mParsedImage && GetIsOnStage() )
{
mImpl->mSize = size;
}
-void SvgRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void SvgVisual::DoCreatePropertyMap( Property::Map& map ) const
{
map.Clear();
map.Insert( RENDERER_TYPE, IMAGE_RENDERER );
}
}
-void SvgRenderer::SetImage( const std::string& imageUrl, ImageDimensions size )
+void SvgVisual::SetImage( const std::string& imageUrl, ImageDimensions size )
{
if( mImageUrl != imageUrl )
{
}
}
-void SvgRenderer::AddRasterizationTask( const Vector2& size )
+void SvgVisual::AddRasterizationTask( const Vector2& size )
{
if( mImpl->mRenderer && mParsedImage )
{
}
}
-void SvgRenderer::ApplyRasterizedImage( PixelData rasterizedPixelData )
+void SvgVisual::ApplyRasterizedImage( PixelData rasterizedPixelData )
{
if( GetIsOnStage() )
{
*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
#include <dali-toolkit/internal/controls/renderers/image-atlas-manager.h>
struct NSVGimage;
* | url | STRING |
*
*/
-class SvgRenderer: public ControlRenderer
+class SvgVisual: public Visual
{
public:
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- SvgRenderer( RendererFactoryCache& factoryCache, ImageAtlasManager& atlasManager );
+ SvgVisual( VisualFactoryCache& factoryCache, ImageAtlasManager& atlasManager );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- ~SvgRenderer();
+ ~SvgVisual();
-public: // from ControlRenderer
+public: // from Visual
/**
- * @copydoc ControlRenderer::GetNaturalSize
+ * @copydoc Visual::GetNaturalSize
*/
virtual void GetNaturalSize( Vector2& naturalSize ) const;
/**
- * @copydoc ControlRenderer::SetSize
+ * @copydoc Visual::SetSize
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc ControlRenderer::CreatePropertyMap
+ * @copydoc Visual::CreatePropertyMap
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const;
protected:
/**
- * @copydoc ControlRenderer::DoInitialize
+ * @copydoc Visual::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc ControlRenderer::DoSetOnStage
+ * @copydoc Visual::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
/**
- * @copydoc ControlRenderer::DoSetOffStage
+ * @copydoc Visual::DoSetOffStage
*/
virtual void DoSetOffStage( Actor& actor );
// Undefined
- SvgRenderer( const SvgRenderer& svgRenderer );
+ SvgVisual( const SvgVisual& svgRenderer );
// Undefined
- SvgRenderer& operator=( const SvgRenderer& svgRenderer );
+ SvgVisual& operator=( const SvgVisual& svgRenderer );
private:
Vector4 mAtlasRect;
*/
// CLASS HEADER
-#include "control-renderer-data-impl.h"
+#include "visual-data-impl.h"
// EXTERNAL HEADER
#include <dali/public-api/common/dali-common.h>
}// unnamed namespace
-Internal::ControlRenderer::Impl::Impl()
+Internal::Visual::Impl::Impl()
: mCustomShader(NULL),
mDepthIndex( 0.0f ),
mFlags( 0 )
{
}
-Internal::ControlRenderer::Impl::~Impl()
+Internal::Visual::Impl::~Impl()
{
delete mCustomShader;
}
-Internal::ControlRenderer::Impl::CustomShader::CustomShader( const Property::Map& map )
+Internal::Visual::Impl::CustomShader::CustomShader( const Property::Map& map )
: mGridSize( 1, 1 ),
mHints( Shader::HINT_NONE )
{
SetPropertyMap( map );
}
-void Internal::ControlRenderer::Impl::CustomShader::SetPropertyMap( const Property::Map& shaderMap )
+void Internal::Visual::Impl::CustomShader::SetPropertyMap( const Property::Map& shaderMap )
{
mVertexShader.clear();
mFragmentShader.clear();
}
}
-void Internal::ControlRenderer::Impl::CustomShader::CreatePropertyMap( Property::Map& map ) const
+void Internal::Visual::Impl::CustomShader::CreatePropertyMap( Property::Map& map ) const
{
if( !mVertexShader.empty() || !mFragmentShader.empty() )
{
#include <dali/public-api/rendering/renderer.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
namespace Dali
{
namespace Internal
{
-struct Internal::ControlRenderer::Impl
+struct Internal::Visual::Impl
{
enum Flags
{
*/
// CLASS HEADER
-#include "renderer-factory-cache.h"
+#include "visual-factory-cache.h"
// EXTERNAL HEADER
#include <dali/devel-api/common/hash.h>
// INTERNAL HEADER
-#include <dali-toolkit/internal/controls/renderers/color/color-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/svg/svg-renderer.h>
+#include <dali-toolkit/internal/controls/renderers/color/color-visual.h>
+#include <dali-toolkit/internal/controls/renderers/svg/svg-visual.h>
namespace Dali
{
namespace Internal
{
-RendererFactoryCache::RendererFactoryCache()
+VisualFactoryCache::VisualFactoryCache()
: mSvgRasterizeThread( NULL )
{
}
-RendererFactoryCache::~RendererFactoryCache()
+VisualFactoryCache::~VisualFactoryCache()
{
SvgRasterizeThread::TerminateThread( mSvgRasterizeThread );
}
-Geometry RendererFactoryCache::GetGeometry( GeometryType type )
+Geometry VisualFactoryCache::GetGeometry( GeometryType type )
{
return mGeometry[type];
}
-void RendererFactoryCache::SaveGeometry( GeometryType type, Geometry geometry )
+void VisualFactoryCache::SaveGeometry( GeometryType type, Geometry geometry )
{
mGeometry[type] = geometry;
}
-Shader RendererFactoryCache::GetShader( ShaderType type )
+Shader VisualFactoryCache::GetShader( ShaderType type )
{
return mShader[type];
}
-void RendererFactoryCache::SaveShader( ShaderType type, Shader shader )
+void VisualFactoryCache::SaveShader( ShaderType type, Shader shader )
{
mShader[type] = shader;
}
-int RendererFactoryCache::FindRenderer( const std::string& key ) const
+int VisualFactoryCache::FindRenderer( const std::string& key ) const
{
int hash = Dali::CalculateHash( key );
return -1;
}
-Renderer RendererFactoryCache::GetRenderer( const std::string& key ) const
+Renderer VisualFactoryCache::GetRenderer( const std::string& key ) const
{
int index = FindRenderer( key );
if( index != -1 )
}
}
-void RendererFactoryCache::SaveRenderer( const std::string& key, Renderer& renderer )
+void VisualFactoryCache::SaveRenderer( const std::string& key, Renderer& renderer )
{
int hash = Dali::CalculateHash( key );
const CachedRenderer* cachedRenderer = new CachedRenderer( key, renderer );
}
}
-bool RendererFactoryCache::CleanRendererCache( const std::string& key )
+bool VisualFactoryCache::CleanRendererCache( const std::string& key )
{
int index = FindRenderer( key );
if( index != -1 )
return false;
}
-void RendererFactoryCache::CacheDebugRenderer( Renderer& renderer )
+void VisualFactoryCache::CacheDebugVisual( Renderer& renderer )
{
- mDebugRenderer = renderer;
+ mDebugVisual = renderer;
}
-Renderer RendererFactoryCache::GetDebugRenderer()
+Renderer VisualFactoryCache::GetDebugVisual()
{
- return mDebugRenderer;
+ return mDebugVisual;
}
-Geometry RendererFactoryCache::CreateQuadGeometry()
+Geometry VisualFactoryCache::CreateQuadGeometry()
{
const float halfWidth = 0.5f;
const float halfHeight = 0.5f;
return geometry;
}
-SvgRasterizeThread* RendererFactoryCache::GetSVGRasterizationThread()
+SvgRasterizeThread* VisualFactoryCache::GetSVGRasterizationThread()
{
if( !mSvgRasterizeThread )
{
- mSvgRasterizeThread = new SvgRasterizeThread( new EventThreadCallback( MakeCallback( this, &RendererFactoryCache::ApplyRasterizedSVGToSampler ) ) );
+ mSvgRasterizeThread = new SvgRasterizeThread( new EventThreadCallback( MakeCallback( this, &VisualFactoryCache::ApplyRasterizedSVGToSampler ) ) );
mSvgRasterizeThread->Start();
}
return mSvgRasterizeThread;
}
-void RendererFactoryCache::ApplyRasterizedSVGToSampler()
+void VisualFactoryCache::ApplyRasterizedSVGToSampler()
{
while( RasterizingTaskPtr task = mSvgRasterizeThread->NextCompletedTask() )
{
- task->GetSvgRenderer()->ApplyRasterizedImage( task->GetPixelData() );
+ task->GetSvgVisual()->ApplyRasterizedImage( task->GetPixelData() );
}
}
-Geometry RendererFactoryCache::CreateGridGeometry( Uint16Pair gridSize )
+Geometry VisualFactoryCache::CreateGridGeometry( Uint16Pair gridSize )
{
uint16_t gridWidth = gridSize.GetWidth();
uint16_t gridHeight = gridSize.GetHeight();
{
/**
- * Caches shaders and geometries. Owned by RenderFactory.
+ * Caches shaders and geometries. Owned by VisualFactory.
*/
-class RendererFactoryCache : public RefObject
+class VisualFactoryCache : public RefObject
{
public:
/**
* @brief Constructor
*/
- RendererFactoryCache();
+ VisualFactoryCache();
/**
* Request geometry of the given type.
/**
* @brief Cache the debug renderer
*/
- void CacheDebugRenderer( Renderer& renderer );
+ void CacheDebugVisual( Renderer& renderer );
/**
* @brief Request the debug renderer;
*/
- Renderer GetDebugRenderer();
+ Renderer GetDebugVisual();
/**
* Get the SVG rasterization thread.
/**
* A reference counted object may only be deleted by calling Unreference()
*/
- virtual ~RendererFactoryCache();
+ virtual ~VisualFactoryCache();
/**
* Undefined copy constructor.
*/
- RendererFactoryCache(const RendererFactoryCache&);
+ VisualFactoryCache(const VisualFactoryCache&);
/**
* Undefined assignment operator.
*/
- RendererFactoryCache& operator=(const RendererFactoryCache& rhs);
+ VisualFactoryCache& operator=(const VisualFactoryCache& rhs);
private:
struct CachedRenderer
HashVector mRendererHashes;
CachedRenderers mRenderers;
- Renderer mDebugRenderer;
+ Renderer mDebugVisual;
SvgRasterizeThread* mSvgRasterizeThread;
};
*/
// CLASS HEADER
-#include <dali-toolkit/internal/controls/renderers/renderer-factory-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-factory-impl.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/border/border-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/color/color-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/debug/debug-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/npatch/npatch-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/image/image-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/svg/svg-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/mesh/mesh-renderer.h>
-#include <dali-toolkit/internal/controls/renderers/primitive/primitive-renderer.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/border/border-visual.h>
+#include <dali-toolkit/internal/controls/renderers/color/color-visual.h>
+#include <dali-toolkit/internal/controls/renderers/debug/debug-visual.h>
+#include <dali-toolkit/internal/controls/renderers/gradient/gradient-visual.h>
+#include <dali-toolkit/internal/controls/renderers/npatch/npatch-visual.h>
+#include <dali-toolkit/internal/controls/renderers/image/image-visual.h>
+#include <dali-toolkit/internal/controls/renderers/svg/svg-visual.h>
+#include <dali-toolkit/internal/controls/renderers/mesh/mesh-visual.h>
+#include <dali-toolkit/internal/controls/renderers/primitive/primitive-visual.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/image-atlas-manager.h>
namespace
BaseHandle Create()
{
- BaseHandle handle = Toolkit::RendererFactory::Get();
+ BaseHandle handle = Toolkit::VisualFactory::Get();
return handle;
}
-DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::RendererFactory, Dali::BaseHandle, Create, true )
+DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::VisualFactory, Dali::BaseHandle, Create, true )
DALI_TYPE_REGISTRATION_END()
} // namespace
-RendererFactory::RendererFactory( bool debugEnabled )
+VisualFactory::VisualFactory( bool debugEnabled )
:mDebugEnabled( debugEnabled )
{
}
-RendererFactory::~RendererFactory()
+VisualFactory::~VisualFactory()
{
}
-RendererFactory::RendererType RendererFactory::GetRendererType( const Property::Map& propertyMap )
+VisualFactory::RendererType VisualFactory::GetRendererType( const Property::Map& propertyMap )
{
RendererType rendererType = UNDEFINED;
{
rendererType = N_PATCH;
}
- else if( SvgRenderer::IsSvgUrl( imageUrl ) )
+ else if( SvgVisual::IsSvgUrl( imageUrl ) )
{
rendererType = SVG;
}
return rendererType;
}
-Toolkit::ControlRenderer RendererFactory::CreateControlRenderer( const Property::Map& propertyMap )
+Toolkit::Visual VisualFactory::CreateVisual( const Property::Map& propertyMap )
{
- ControlRenderer* rendererPtr = NULL;
+ Visual* rendererPtr = NULL;
RendererType type = GetRendererType( propertyMap );
if( type != UNDEFINED)
{
if( !mFactoryCache )
{
- mFactoryCache = new RendererFactoryCache();
+ mFactoryCache = new VisualFactoryCache();
}
if( mDebugEnabled )
{
- return Toolkit::ControlRenderer( new DebugRenderer( *( mFactoryCache.Get() ) ) );
+ return Toolkit::Visual( new DebugVisual( *( mFactoryCache.Get() ) ) );
}
}
{
case COLOR:
{
- rendererPtr = new ColorRenderer( *( mFactoryCache.Get() ) );
+ rendererPtr = new ColorVisual( *( mFactoryCache.Get() ) );
break;
}
case GRADIENT:
{
- rendererPtr = new GradientRenderer( *( mFactoryCache.Get() ) );
+ rendererPtr = new GradientVisual( *( mFactoryCache.Get() ) );
break;
}
case BORDER:
{
- rendererPtr = new BorderRenderer( *( mFactoryCache.Get() ) );
+ rendererPtr = new BorderVisual( *( mFactoryCache.Get() ) );
break;
}
case IMAGE:
{
CreateAtlasManager();
- rendererPtr = new ImageRenderer( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ rendererPtr = new ImageVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
break;
}
case N_PATCH:
{
- rendererPtr = new NPatchRenderer( *( mFactoryCache.Get() ) );
+ rendererPtr = new NPatchVisual( *( mFactoryCache.Get() ) );
break;
}
case SVG:
{
CreateAtlasManager();
- rendererPtr = new SvgRenderer( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ rendererPtr = new SvgVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
break;
}
case MESH:
{
- rendererPtr = new MeshRenderer( *( mFactoryCache.Get() ) );
+ rendererPtr = new MeshVisual( *( mFactoryCache.Get() ) );
break;
}
case PRIMITIVE:
{
- rendererPtr = new PrimitiveRenderer( *( mFactoryCache.Get() ) );
+ rendererPtr = new PrimitiveVisual( *( mFactoryCache.Get() ) );
break;
}
case UNDEFINED:
DALI_LOG_ERROR( "Renderer type unknown" );
}
- return Toolkit::ControlRenderer( rendererPtr );
+ return Toolkit::Visual( rendererPtr );
}
-Toolkit::ControlRenderer RendererFactory::CreateControlRenderer( const Image& image )
+Toolkit::Visual VisualFactory::CreateVisual( const Image& image )
{
if( !mFactoryCache )
{
- mFactoryCache = new RendererFactoryCache();
+ mFactoryCache = new VisualFactoryCache();
}
if( mDebugEnabled )
{
- return Toolkit::ControlRenderer( new DebugRenderer( *( mFactoryCache.Get() ) ) );
+ return Toolkit::Visual( new DebugVisual( *( mFactoryCache.Get() ) ) );
}
NinePatchImage npatchImage = NinePatchImage::DownCast( image );
if( npatchImage )
{
- NPatchRenderer* rendererPtr = new NPatchRenderer( *( mFactoryCache.Get() ) );
+ NPatchVisual* rendererPtr = new NPatchVisual( *( mFactoryCache.Get() ) );
rendererPtr->SetImage( npatchImage );
- return Toolkit::ControlRenderer( rendererPtr );
+ return Toolkit::Visual( rendererPtr );
}
else
{
CreateAtlasManager();
- ImageRenderer* rendererPtr = new ImageRenderer( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ ImageVisual* rendererPtr = new ImageVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
Actor actor;
rendererPtr->SetImage( actor, image );
- return Toolkit::ControlRenderer( rendererPtr );
+ return Toolkit::Visual( rendererPtr );
}
}
-Toolkit::ControlRenderer RendererFactory::CreateControlRenderer( const std::string& url, ImageDimensions size )
+Toolkit::Visual VisualFactory::CreateVisual( const std::string& url, ImageDimensions size )
{
if( !mFactoryCache )
{
- mFactoryCache = new RendererFactoryCache();
+ mFactoryCache = new VisualFactoryCache();
}
if( mDebugEnabled )
{
- return Toolkit::ControlRenderer( new DebugRenderer( *( mFactoryCache.Get() ) ) );
+ return Toolkit::Visual( new DebugVisual( *( mFactoryCache.Get() ) ) );
}
if( NinePatchImage::IsNinePatchUrl( url ) )
{
- NPatchRenderer* rendererPtr = new NPatchRenderer( *( mFactoryCache.Get() ) );
+ NPatchVisual* rendererPtr = new NPatchVisual( *( mFactoryCache.Get() ) );
rendererPtr->SetImage( url );
- return Toolkit::ControlRenderer( rendererPtr );
+ return Toolkit::Visual( rendererPtr );
}
- else if( SvgRenderer::IsSvgUrl( url ) )
+ else if( SvgVisual::IsSvgUrl( url ) )
{
CreateAtlasManager();
- SvgRenderer* rendererPtr = new SvgRenderer( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ SvgVisual* rendererPtr = new SvgVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
rendererPtr->SetImage( url, size );
- return Toolkit::ControlRenderer( rendererPtr );
+ return Toolkit::Visual( rendererPtr );
}
else
{
CreateAtlasManager();
- ImageRenderer* rendererPtr = new ImageRenderer( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
+ ImageVisual* rendererPtr = new ImageVisual( *( mFactoryCache.Get() ), *( mAtlasManager.Get() ) );
Actor actor;
rendererPtr->SetImage( actor, url, size );
- return Toolkit::ControlRenderer( rendererPtr );
+ return Toolkit::Visual( rendererPtr );
}
}
-Image RendererFactory::GetBrokenRendererImage()
+Image VisualFactory::GetBrokenRendererImage()
{
return ResourceImage::New( BROKEN_RENDERER_IMAGE_URL );
}
-void RendererFactory::CreateAtlasManager()
+void VisualFactory::CreateAtlasManager()
{
if( !mAtlasManager )
{
- Shader shader = ImageRenderer::GetImageShader( *( mFactoryCache.Get() ) );
+ Shader shader = ImageVisual::GetImageShader( *( mFactoryCache.Get() ) );
mAtlasManager = new ImageAtlasManager();
mAtlasManager->SetBrokenImage( BROKEN_RENDERER_IMAGE_URL );
}
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
+#include "../../../devel-api/controls/visual-factory/visual.h"
namespace Dali
{
namespace Internal
{
-class RendererFactoryCache;
-typedef IntrusivePtr<RendererFactoryCache> RendererFactoryCachePtr;
+class VisualFactoryCache;
+typedef IntrusivePtr<VisualFactoryCache> VisualFactoryCachePtr;
class ImageAtlasManager;
typedef IntrusivePtr<ImageAtlasManager> ImageAtlasManagerPtr;
/**
- * @copydoc Toolkit::RendererFactory
+ * @copydoc Toolkit::VisualFactory
*/
-class RendererFactory : public BaseObject
+class VisualFactory : public BaseObject
{
public:
*
* @param[in] debugEnabled If true, use debug renderer to replace all the concrete renderer.
*/
- RendererFactory( bool debugEnabled );
+ VisualFactory( bool debugEnabled );
/**
- * @copydoc Toolkit::RenderFactory::CreateControlRenderer( const Property::Map& )
+ * @copydoc Toolkit::RenderFactory::CreateVisual( const Property::Map& )
*/
- Toolkit::ControlRenderer CreateControlRenderer( const Property::Map& propertyMap );
+ Toolkit::Visual CreateVisual( const Property::Map& propertyMap );
/**
- * @copydoc Toolkit::RenderFactory::CreateControlRenderer( const Image& )
+ * @copydoc Toolkit::RenderFactory::CreateVisual( const Image& )
*/
- Toolkit::ControlRenderer CreateControlRenderer( const Image& image );
+ Toolkit::Visual CreateVisual( const Image& image );
/**
- * @copydoc Toolkit::RenderFactory::CreateControlRenderer( const std::string&, ImageDimensions )
+ * @copydoc Toolkit::RenderFactory::CreateVisual( const std::string&, ImageDimensions )
*/
- Toolkit::ControlRenderer CreateControlRenderer( const std::string& image, ImageDimensions size );
+ Toolkit::Visual CreateVisual( const std::string& image, ImageDimensions size );
public:
/**
/**
* A reference counted object may only be deleted by calling Unreference()
*/
- virtual ~RendererFactory();
+ virtual ~VisualFactory();
private:
/**
- * Get the renderer type from the property map.
+ * Get the visual type from the property map.
*
- * @param[in] propertyMap The map contains the properties of the control renderer
+ * @param[in] propertyMap The map contains the properties of the visual
* @return The rendererType
*/
RendererType GetRendererType( const Property::Map& propertyMap );
/**
* Undefined copy constructor.
*/
- RendererFactory(const RendererFactory&);
+ VisualFactory(const VisualFactory&);
/**
* Undefined assignment operator.
*/
- RendererFactory& operator=(const RendererFactory& rhs);
+ VisualFactory& operator=(const VisualFactory& rhs);
private:
- RendererFactoryCachePtr mFactoryCache;
+ VisualFactoryCachePtr mFactoryCache;
ImageAtlasManagerPtr mAtlasManager;
bool mDebugEnabled;
};
} // namespace Internal
-inline const Internal::RendererFactory& GetImplementation(const Toolkit::RendererFactory& factory)
+inline const Internal::VisualFactory& GetImplementation(const Toolkit::VisualFactory& factory)
{
- DALI_ASSERT_ALWAYS( factory && "RendererFactory handle is empty" );
+ DALI_ASSERT_ALWAYS( factory && "VisualFactory handle is empty" );
const BaseObject& handle = factory.GetBaseObject();
- return static_cast<const Internal::RendererFactory&>(handle);
+ return static_cast<const Internal::VisualFactory&>(handle);
}
-inline Internal::RendererFactory& GetImplementation(Toolkit::RendererFactory& factory)
+inline Internal::VisualFactory& GetImplementation(Toolkit::VisualFactory& factory)
{
- DALI_ASSERT_ALWAYS( factory && "RendererFactory handle is empty" );
+ DALI_ASSERT_ALWAYS( factory && "VisualFactory handle is empty" );
BaseObject& handle = factory.GetBaseObject();
- return static_cast<Internal::RendererFactory&>(handle);
+ return static_cast<Internal::VisualFactory&>(handle);
}
} // namespace Toolkit
*/
// CLASS HEADER
-#include "control-renderer-impl.h"
+#include "visual-impl.h"
// EXTERNAL HEADER
#include <dali/public-api/common/dali-common.h>
#include <dali/integration-api/debug.h>
//INTERNAL HEARDER
-#include <dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-data-impl.h>
namespace
{
namespace Internal
{
-ControlRenderer::ControlRenderer( RendererFactoryCache& factoryCache )
+Visual::Visual( VisualFactoryCache& factoryCache )
: mImpl( new Impl() ),
mFactoryCache( factoryCache )
{
}
-ControlRenderer::~ControlRenderer()
+Visual::~Visual()
{
delete mImpl;
}
-void ControlRenderer::SetCustomShader( const Property::Map& shaderMap )
+void Visual::SetCustomShader( const Property::Map& shaderMap )
{
if( mImpl->mCustomShader )
{
}
}
-void ControlRenderer::Initialize( Actor& actor, const Property::Map& propertyMap )
+void Visual::Initialize( Actor& actor, const Property::Map& propertyMap )
{
Property::Value* customShaderValue = propertyMap.Find( CUSTOM_SHADER );
if( customShaderValue )
DoInitialize( actor, propertyMap );
}
-void ControlRenderer::SetSize( const Vector2& size )
+void Visual::SetSize( const Vector2& size )
{
mImpl->mSize = size;
}
-const Vector2& ControlRenderer::GetSize() const
+const Vector2& Visual::GetSize() const
{
return mImpl->mSize;
}
-void ControlRenderer::GetNaturalSize( Vector2& naturalSize ) const
+void Visual::GetNaturalSize( Vector2& naturalSize ) const
{
naturalSize = Vector2::ZERO;
}
-void ControlRenderer::SetClipRect( const Rect<int>& clipRect )
+void Visual::SetClipRect( const Rect<int>& clipRect )
{
}
-void ControlRenderer::SetOffset( const Vector2& offset )
+void Visual::SetOffset( const Vector2& offset )
{
mImpl->mOffset = offset;
}
-void ControlRenderer::SetDepthIndex( float index )
+void Visual::SetDepthIndex( float index )
{
mImpl->mDepthIndex = index;
if( mImpl->mRenderer )
}
}
-float ControlRenderer::GetDepthIndex() const
+float Visual::GetDepthIndex() const
{
return mImpl->mDepthIndex;
}
-void ControlRenderer::SetOnStage( Actor& actor )
+void Visual::SetOnStage( Actor& actor )
{
DoSetOnStage( actor );
mImpl->mFlags |= Impl::IS_ON_STAGE;
}
-void ControlRenderer::SetOffStage( Actor& actor )
+void Visual::SetOffStage( Actor& actor )
{
if( GetIsOnStage() )
{
}
}
-void ControlRenderer::EnablePreMultipliedAlpha( bool preMultipled )
+void Visual::EnablePreMultipliedAlpha( bool preMultipled )
{
if(preMultipled)
{
}
}
-bool ControlRenderer::IsPreMultipliedAlphaEnabled() const
+bool Visual::IsPreMultipliedAlphaEnabled() const
{
return mImpl->mFlags & Impl::IS_PREMULTIPLIED_ALPHA;
}
-void ControlRenderer::DoSetOnStage( Actor& actor )
+void Visual::DoSetOnStage( Actor& actor )
{
}
-void ControlRenderer::DoSetOffStage( Actor& actor )
+void Visual::DoSetOffStage( Actor& actor )
{
actor.RemoveRenderer( mImpl->mRenderer );
mImpl->mRenderer.Reset();
}
-void ControlRenderer::CreatePropertyMap( Property::Map& map ) const
+void Visual::CreatePropertyMap( Property::Map& map ) const
{
DoCreatePropertyMap( map );
}
}
-bool ControlRenderer::GetIsOnStage() const
+bool Visual::GetIsOnStage() const
{
return mImpl->mFlags & Impl::IS_ON_STAGE;
}
-bool ControlRenderer::GetIsFromCache() const
+bool Visual::GetIsFromCache() const
{
return mImpl->mFlags & Impl::IS_FROM_CACHE;
}
-#ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
-#define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
+#ifndef DALI_TOOLKIT_INTERNAL_VISUAL_H
+#define DALI_TOOLKIT_INTERNAL_VISUAL_H
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd.
#include <dali/public-api/rendering/shader.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
-#include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
+#include <dali-toolkit/devel-api/controls/visual-factory/visual-factory.h>
+#include <dali-toolkit/internal/controls/renderers/visual-factory-cache.h>
+#include "../../../devel-api/controls/visual-factory/visual.h"
namespace Dali
{
{
/**
- * Base class for all Control rendering logic. A control may have multiple control renderers.
+ * Base class for all Control rendering logic. A control may have multiple visuals.
*
- * Note: The control renderer responds to the the Actor::COLOR by blending it with the 'Multiply' operator.
+ * Note: The visual responds to the the Actor::COLOR by blending it with the 'Multiply' operator.
*
* The following properties are optional
*
* | subdivideGridY | INT |
* | shaderHints | INT |
*/
-class ControlRenderer : public BaseObject
+class Visual : public BaseObject
{
public:
/**
- * Initialisation of the renderer, this API should only called by the RendererFactory:
+ * Initialisation of the visual, this API should only called by the VisualFactory:
* request the geometry and shader from the cache, if not available, create and save to the cache for sharing;
* record the property values.
*
- * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
- * @param[in] propertyMap The properties for the requested ControlRenderer object.
+ * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor
+ * @param[in] propertyMap The properties for the requested Visual object.
*/
void Initialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc Toolkit::ControlRenderer::SetSize
+ * @copydoc Toolkit::Visual::SetSize
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc Toolkit::ControlRenderer::GetSize
+ * @copydoc Toolkit::Visual::GetSize
*/
const Vector2& GetSize() const;
/**
- * @copydoc Toolkit::ControlRenderer::GetNaturalSize
+ * @copydoc Toolkit::Visual::GetNaturalSize
*/
virtual void GetNaturalSize( Vector2& naturalSize ) const;
/**
- * ToDo: Add this function to Toolkit::ControlRenderer when it is fully implemented.
+ * ToDo: Add this function to Toolkit::Visual when it is fully implemented.
*
- * Set the clip rectangular of this renderer.
- * The contents of the renderer will not be visible outside this rectangular.
+ * Set the clip rectangular of this visual.
+ * The contents of the visual will not be visible outside this rectangular.
*
* @param [in] clipRect The clipping rectangular.
*/
virtual void SetClipRect( const Rect<int>& clipRect );
/**
- *ToDo: Add this function to Toolkit::ControlRenderer when it is fully implemented.
+ *ToDo: Add this function to Toolkit::Visual when it is fully implemented.
*
- * Reposition this renderer with a 2D offset.
+ * Reposition this visual with a 2D offset.
*
- * @param[in] offset The offset to reposition the renderer.
+ * @param[in] offset The offset to reposition the visual.
*/
virtual void SetOffset( const Vector2& offset );
/**
- * @copydoc Toolkit::ControlRenderer::SetDepthIndex
+ * @copydoc Toolkit::Visual::SetDepthIndex
*/
void SetDepthIndex( float index );
/**
- * @copydoc Toolkit::ControlRenderer::GetDepthIndex
+ * @copydoc Toolkit::Visual::GetDepthIndex
*/
float GetDepthIndex() const;
/**
- * @copydoc Toolkit::ControlRenderer::SetOnStage
+ * @copydoc Toolkit::Visual::SetOnStage
* @pre Impl->mGeometry must be created before this method is called
*/
void SetOnStage( Actor& actor );
/**
- * @copydoc Toolkit::ControlRenderer::SetOffStage
+ * @copydoc Toolkit::Visual::SetOffStage
*/
void SetOffStage( Actor& actor );
/**
- * @copydoc Toolkit::ControlRenderer::CreatePropertyMap
+ * @copydoc Toolkit::Visual::CreatePropertyMap
*/
void CreatePropertyMap( Property::Map& map ) const;
/**
* @brief Constructor.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
- ControlRenderer( RendererFactoryCache& factoryCache );
+ Visual( VisualFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
- virtual ~ControlRenderer();
+ virtual ~Visual();
protected:
/**
* @brief Called by CreatePropertyMap() allowing sub classes to respond to the CreatePropertyMap event
*
- * @param[out] map The renderer property map.
+ * @param[out] map The visual property map.
*/
virtual void DoCreatePropertyMap( Property::Map& map ) const = 0;
/**
* @brief Called by Initialize() allowing sub classes to respond to the Initialize event
*
- * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
- * @param[in] propertyMap The properties for the requested ControlRenderer object.
+ * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor
+ * @param[in] propertyMap The properties for the requested Visual object.
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) {};
/**
* @brief Called by SetOnStage() allowing sub classes to respond to the SetOnStage event
*
- * @param[in] actor The actor applying this renderer.
+ * @param[in] actor The actor applying this visual.
*/
virtual void DoSetOnStage( Actor& actor );
/**
* @brief Called by SetOffStage() allowing sub classes to respond to the SetOffStage event
*
- * @param[in] actor The actor applying this renderer.
+ * @param[in] actor The actor applying this visual.
*/
virtual void DoSetOffStage( Actor& actor );
protected:
/**
- * @brief Gets the on stage state for this ControlRenderer
+ * @brief Gets the on stage state for this Visual
*
- * @return Returns true if this ControlRenderer is on stage, false if it is off the stage
+ * @return Returns true if this Visual is on stage, false if it is off the stage
*/
bool GetIsOnStage() const;
private:
// Undefined
- ControlRenderer( const ControlRenderer& renderer );
+ Visual( const Visual& visual );
// Undefined
- ControlRenderer& operator=( const ControlRenderer& renderer );
+ Visual& operator=( const Visual& visual );
protected:
struct Impl;
Impl* mImpl;
- RendererFactoryCache& mFactoryCache;
+ VisualFactoryCache& mFactoryCache;
};
} // namespace Internal
-inline const Internal::ControlRenderer& GetImplementation(const Toolkit::ControlRenderer& renderer)
+inline const Internal::Visual& GetImplementation(const Toolkit::Visual& visual)
{
- DALI_ASSERT_ALWAYS( renderer && "ControlRenderer handle is empty" );
+ DALI_ASSERT_ALWAYS( visual && "Visual handle is empty" );
- const BaseObject& handle = renderer.GetBaseObject();
+ const BaseObject& handle = visual.GetBaseObject();
- return static_cast<const Internal::ControlRenderer&>(handle);
+ return static_cast<const Internal::Visual&>(handle);
}
-inline Internal::ControlRenderer& GetImplementation(Toolkit::ControlRenderer& renderer)
+inline Internal::Visual& GetImplementation(Toolkit::Visual& visual)
{
- DALI_ASSERT_ALWAYS( renderer && "ControlRenderer handle is empty" );
+ DALI_ASSERT_ALWAYS( visual && "Visual handle is empty" );
- BaseObject& handle = renderer.GetBaseObject();
+ BaseObject& handle = visual.GetBaseObject();
- return static_cast<Internal::ControlRenderer&>(handle);
+ return static_cast<Internal::Visual&>(handle);
}
} // namespace Toolkit
} // namespace Dali
-#endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERER_H
+#endif // DALI_TOOLKIT_INTERNAL_VISUAL_H
*/
// CLASS HEADER
-#include "renderer-string-constants.h"
+#include "visual-string-constants.h"
namespace Dali
{
#include <dali/integration-api/debug.h>
// INTERNAL_INCLUDES
-#include <dali-toolkit/internal/controls/renderers/control-renderer-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-impl.h>
namespace //Unnamed namespace
{
DALI_ASSERT_ALWAYS( mBlurLevels > 0 && " Minimal blur level is one, otherwise no blur is needed" );
mGaussianBlurView.assign( blurLevels, Toolkit::GaussianBlurView() );
mBlurredImage.assign( blurLevels, FrameBufferImage() );
- mRenderers.assign( blurLevels+1, Toolkit::ControlRenderer() );
+ mRenderers.assign( blurLevels+1, Toolkit::Visual() );
}
SuperBlurView::~SuperBlurView()
mInputImage = inputImage;
Actor self( Self() );
- InitializeControlRenderer( self, mRenderers[0], mInputImage );
+ InitializeVisual( self, mRenderers[0], mInputImage );
mRenderers[0].SetDepthIndex(0);
SetShaderEffect( mRenderers[0] );
if( self.OnStage() )
mResourcesCleared = true;
}
}
-void SuperBlurView::SetShaderEffect( Toolkit::ControlRenderer& renderer )
+void SuperBlurView::SetShaderEffect( Toolkit::Visual& renderer )
{
Property::Map shaderMap;
std::stringstream verterShaderString;
shaderMap[ "fragmentShader" ] = FRAGMENT_SHADER;
- Internal::ControlRenderer& rendererImpl = GetImplementation( renderer );
+ Internal::Visual& rendererImpl = GetImplementation( renderer );
rendererImpl.SetCustomShader( shaderMap );
}