Renaming PropertyBuffer to VertexBuffer
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Renderer.cpp
index 300767a..7b700ce 100644 (file)
@@ -18,9 +18,9 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/actors/actor-devel.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
+#include <dali/devel-api/common/stage.h>
 
 #include <dali/public-api/dali-core.h>
-#include <dali/devel-api/images/texture-set-image.h>
 #include <dali/integration-api/render-task-list-integ.h>
 #include <cstdio>
 #include <string>
@@ -140,6 +140,57 @@ int UtcDaliRendererAssignmentOperator(void)
   END_TEST;
 }
 
+int UtcDaliRendererMoveConstructor(void)
+{
+  TestApplication application;
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+  Renderer renderer = Renderer::New( geometry, shader );
+  DALI_TEST_CHECK( renderer );
+  DALI_TEST_EQUALS( 1, renderer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::TRANSPARENT, TEST_LOCATION );
+
+  renderer.SetProperty( Renderer::Property::BLEND_COLOR, Color::MAGENTA );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+
+  Renderer move = std::move( renderer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+  DALI_TEST_CHECK( !renderer );
+
+  END_TEST;
+}
+
+int UtcDaliRendererMoveAssignment(void)
+{
+  TestApplication application;
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+  Renderer renderer = Renderer::New( geometry, shader );
+  DALI_TEST_CHECK( renderer );
+  DALI_TEST_EQUALS( 1, renderer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::TRANSPARENT, TEST_LOCATION );
+
+  renderer.SetProperty( Renderer::Property::BLEND_COLOR, Color::MAGENTA );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+
+  Renderer move;
+  move = std::move( renderer );
+  DALI_TEST_CHECK( move );
+  DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( move.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+  DALI_TEST_CHECK( !renderer );
+
+  END_TEST;
+}
+
 int UtcDaliRendererDownCast01(void)
 {
   TestApplication application;
@@ -256,7 +307,7 @@ int UtcDaliRendererSetGetGeometry(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   application.SendNotification();
   application.Render(0);
@@ -291,7 +342,7 @@ int UtcDaliRendererSetGetShader(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
   application.SendNotification();
@@ -331,7 +382,7 @@ int UtcDaliRendererSetGetDepthIndex(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   application.SendNotification();
   application.Render(0);
@@ -370,7 +421,7 @@ int UtcDaliRendererSetGetFaceCullingMode(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   // By default, none of the faces should be culled
   unsigned int cullFace = renderer.GetProperty<int>( Renderer::Property::FACE_CULLING_MODE );
@@ -457,7 +508,7 @@ int UtcDaliRendererBlendOptions01(void)
   actor.SetProperty( Actor::Property::OPACITY, 0.5f );
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB,    BlendFactor::ONE_MINUS_SRC_COLOR );
   renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB,   BlendFactor::SRC_ALPHA_SATURATE  );
@@ -502,7 +553,7 @@ int UtcDaliRendererBlendOptions02(void)
   actor.SetProperty( Actor::Property::OPACITY, 0.5f ); // enable blending
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB,    BlendFactor::CONSTANT_COLOR );
   renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB,   BlendFactor::ONE_MINUS_CONSTANT_COLOR );
@@ -547,7 +598,7 @@ int UtcDaliRendererBlendOptions03(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   // Test the defaults as documented in blending.h
   int equationRgb   = renderer.GetProperty<int>( Renderer::Property::BLEND_EQUATION_RGB );
@@ -573,7 +624,7 @@ int UtcDaliRendererBlendOptions04(void)
   actor.SetProperty( Actor::Property::OPACITY, 0.1f );
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   // Test the single blending equation setting
   {
@@ -618,7 +669,7 @@ int UtcDaliRendererSetBlendMode01(void)
   actor.SetProperty( Actor::Property::OPACITY, 0.98f );
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON);
 
@@ -650,7 +701,7 @@ int UtcDaliRendererSetBlendMode01b(void)
   actor.SetProperty( Actor::Property::OPACITY, 0.0f );
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON);
 
@@ -685,7 +736,7 @@ int UtcDaliRendererSetBlendMode02(void)
   actor.SetProperty( Actor::Property::OPACITY, 0.15f );
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::OFF);
 
@@ -717,7 +768,7 @@ int UtcDaliRendererSetBlendMode03(void)
   actor.SetProperty( Actor::Property::OPACITY, 0.75f );
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
 
@@ -748,7 +799,7 @@ int UtcDaliRendererSetBlendMode04(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
 
@@ -780,7 +831,7 @@ int UtcDaliRendererSetBlendMode04b(void)
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
   actor.SetProperty( Actor::Property::COLOR, Vector4(1.0f, 0.0f, 1.0f, 0.5f) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
 
@@ -812,7 +863,7 @@ int UtcDaliRendererSetBlendMode04c(void)
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
   actor.SetProperty( Actor::Property::COLOR, Color::MAGENTA );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
 
@@ -847,7 +898,7 @@ int UtcDaliRendererSetBlendMode05(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
 
@@ -878,7 +929,7 @@ int UtcDaliRendererSetBlendMode06(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
 
@@ -912,7 +963,7 @@ int UtcDaliRendererSetBlendMode07(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
 
@@ -972,7 +1023,7 @@ int UtcDaliRendererSetBlendColor(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
 
@@ -1045,7 +1096,7 @@ int UtcDaliRendererPreMultipledAlpha(void)
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
   actor.SetProperty( Actor::Property::COLOR, Vector4(1.0f, 0.0f, 1.0f, 0.5f) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   Property::Value value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
   bool preMultipliedAlpha;
@@ -1140,7 +1191,7 @@ int UtcDaliRendererConstraint01(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
   Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
@@ -1182,7 +1233,7 @@ int UtcDaliRendererConstraint02(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
   application.SendNotification();
   application.Render(0);
 
@@ -1236,7 +1287,7 @@ int UtcDaliRendererAnimatedProperty01(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
   Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
@@ -1277,7 +1328,7 @@ int UtcDaliRendererAnimatedProperty02(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
   application.SendNotification();
   application.Render(0);
 
@@ -1331,7 +1382,7 @@ int UtcDaliRendererUniformMapPrecendence01(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
   application.SendNotification();
   application.Render(0);
 
@@ -1388,7 +1439,7 @@ int UtcDaliRendererUniformMapPrecendence02(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
   application.SendNotification();
   application.Render(0);
 
@@ -1446,7 +1497,7 @@ int UtcDaliRendererUniformMapPrecendence03(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
   application.SendNotification();
   application.Render(0);
 
@@ -1484,7 +1535,7 @@ int UtcDaliRendererUniformMapMultipleUniforms01(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
   application.SendNotification();
   application.Render(0);
 
@@ -1531,7 +1582,7 @@ int UtcDaliRendererUniformMapMultipleUniforms02(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
   application.SendNotification();
   application.Render(0);
 
@@ -1600,7 +1651,7 @@ int UtcDaliRendererRenderOrder2DLayer(void)
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
 
-  Actor root = Stage::GetCurrent().GetRootLayer();
+  Actor root = application.GetScene().GetRootLayer();
 
   Actor actor0 = CreateActor( root, 0, TEST_LOCATION );
   Renderer renderer0 = CreateRenderer( actor0, geometry, shader, 0 );
@@ -1692,7 +1743,7 @@ int UtcDaliRendererRenderOrder2DLayerMultipleRenderers(void)
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
 
-  Actor root = Stage::GetCurrent().GetRootLayer();
+  Actor root = application.GetScene().GetRootLayer();
 
   Actor actor0 = CreateActor( root, 0, TEST_LOCATION );
   Actor actor1 = CreateActor( actor0, 0, TEST_LOCATION );
@@ -1780,7 +1831,7 @@ int UtcDaliRendererRenderOrder2DLayerSiblingOrder(void)
 
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
-  Actor root = Stage::GetCurrent().GetRootLayer();
+  Actor root = application.GetScene().GetRootLayer();
   Actor actor0 = CreateActor( root,   1, TEST_LOCATION );
   Actor actor1 = CreateActor( root,   0, TEST_LOCATION );
   Actor actor2 = CreateActor( actor0, 0, TEST_LOCATION );
@@ -1847,7 +1898,7 @@ int UtcDaliRendererRenderOrder2DLayerOverlay(void)
 
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
-  Actor root = Stage::GetCurrent().GetRootLayer();
+  Actor root = application.GetScene().GetRootLayer();
 
   /*
    * Create the following hierarchy:
@@ -1977,7 +2028,7 @@ int UtcDaliRendererSetIndexRange(void)
   };
   Property::Map vertexFormat;
   vertexFormat["aPosition"] = Property::VECTOR2;
-  PropertyBuffer vertexBuffer = PropertyBuffer::New( vertexFormat );
+  VertexBuffer vertexBuffer = VertexBuffer::New( vertexFormat );
   vertexBuffer.SetData( shapes, sizeof(shapes)/sizeof(shapes[0]));
 
   // --------------------------------------------------------------------------
@@ -1989,8 +2040,8 @@ int UtcDaliRendererSetIndexRange(void)
   Renderer renderer = Renderer::New( geometry, shader );
   actor.AddRenderer( renderer );
 
-  Stage stage = Stage::GetCurrent();
-  stage.Add( actor );
+  Integration::Scene scene = application.GetScene();
+  scene.Add( actor );
 
   char buffer[ 128 ];
 
@@ -2082,9 +2133,9 @@ int UtcDaliRendererSetDepthFunction(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage stage = Stage::GetCurrent();
-  stage.GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
-  stage.Add(actor);
+  Integration::Scene scene = application.GetScene();
+  scene.GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
+  scene.Add(actor);
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   glAbstraction.EnableEnableDisableCallTrace(true);
@@ -2255,7 +2306,7 @@ int UtcDaliRendererEnumProperties(void)
   Actor actor = Actor::New();
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   /*
    * Here we use a templatized function to perform several checks on each enumeration property.
@@ -2291,9 +2342,9 @@ Renderer RendererTestFixture( TestApplication& application )
   Actor actor = Actor::New();
   actor.AddRenderer( renderer );
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage stage = Stage::GetCurrent();
-  stage.GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
-  stage.Add( actor );
+  Integration::Scene scene = application.GetScene();
+  scene.GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
+  scene.Add( actor );
 
   return renderer;
 }
@@ -2341,7 +2392,7 @@ int UtcDaliRendererSetDepthTestMode(void)
 
   // Change the layer behavior to LAYER_UI.
   // Note this will also disable depth testing for the layer by default, we test this first.
-  Stage::GetCurrent().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_UI );
+  application.GetScene().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_UI );
 
   glEnableDisableStack.Reset();
   application.SendNotification();
@@ -2351,7 +2402,7 @@ int UtcDaliRendererSetDepthTestMode(void)
   DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Disable", GetDepthTestString() ) );
 
   // Turn the layer depth-test flag back on, and confirm that depth testing is now on.
-  Stage::GetCurrent().GetRootLayer().SetProperty(Layer::Property::DEPTH_TEST, true );
+  application.GetScene().GetRootLayer().SetProperty(Layer::Property::DEPTH_TEST, true );
 
   glEnableDisableStack.Reset();
   application.SendNotification();
@@ -2786,7 +2837,7 @@ int UtcDaliRendererWrongNumberOfTextures(void)
   actor.AddRenderer(renderer);
   actor.SetProperty( Actor::Property::POSITION, Vector2(0.0f,0.0f));
   actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  Stage::GetCurrent().Add(actor);
+  application.GetScene().Add(actor);
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
   TraceCallStack& drawTrace = gl.GetDrawTrace();
@@ -2828,7 +2879,7 @@ int UtcDaliRendererOpacity(void)
   actor.AddRenderer( renderer );
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
   actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   Property::Value value = renderer.GetProperty( DevelRenderer::Property::OPACITY );
   float opacity;
@@ -2876,7 +2927,7 @@ int UtcDaliRendererOpacityAnimation(void)
   actor.AddRenderer( renderer );
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
   actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render(0);
@@ -2928,7 +2979,7 @@ int UtcDaliRendererInvalidProperty(void)
   Actor actor = Actor::New();
   actor.AddRenderer( renderer );
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render(0);
@@ -2956,7 +3007,7 @@ int UtcDaliRendererRenderingBehavior(void)
   actor.AddRenderer( renderer );
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
   actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   Property::Value value = renderer.GetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR );
   int renderingBehavior;
@@ -3024,7 +3075,7 @@ int UtcDaliRendererRegenerateUniformMap(void)
   actor.AddRenderer( renderer );
   actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
   actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -3057,3 +3108,162 @@ int UtcDaliRendererRegenerateUniformMap(void)
 
   END_TEST;
 }
+
+int UtcDaliRendererAddDrawCommands(void)
+{
+  TestApplication application;
+
+  tet_infoline("Test adding draw commands to the renderer");
+
+  TestGlAbstraction &glAbstraction = application.GetGlAbstraction();
+  glAbstraction.EnableEnableDisableCallTrace(true);
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader   shader   = Shader::New("vertexSrc", "fragmentSrc");
+  Renderer renderer = Renderer::New(geometry, shader);
+
+  renderer.SetProperty( Renderer::Property::BLEND_MODE, Dali::BlendMode::ON );
+  Actor actor = Actor::New();
+  actor.AddRenderer(renderer);
+  actor.SetProperty(Actor::Property::SIZE, Vector2(400.0f, 400.0f));
+  actor.SetProperty(Actor::Property::COLOR, Vector4(1.0f, 0.0f, 1.0f, 1.0f));
+  application.GetScene().Add(actor);
+
+  // Expect delivering a single draw call
+  auto &drawTrace = glAbstraction.GetDrawTrace();
+  drawTrace.Reset();
+  drawTrace.Enable(true);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
+
+  auto drawCommand1 = DevelRenderer::DrawCommand{};
+  drawCommand1.drawType     = DevelRenderer::DrawType::INDEXED;
+  drawCommand1.firstIndex   = 0;
+  drawCommand1.elementCount = 2;
+  drawCommand1.queue        = DevelRenderer::RENDER_QUEUE_OPAQUE;
+
+  auto drawCommand2 = DevelRenderer::DrawCommand{};
+  drawCommand2.drawType     = DevelRenderer::DrawType::INDEXED;
+  drawCommand2.firstIndex   = 2;
+  drawCommand2.elementCount = 2;
+  drawCommand2.queue        = DevelRenderer::RENDER_QUEUE_TRANSPARENT;
+
+  auto drawCommand3 = DevelRenderer::DrawCommand{};
+  drawCommand3.drawType     = DevelRenderer::DrawType::ARRAY;
+  drawCommand3.firstIndex   = 2;
+  drawCommand3.elementCount = 2;
+  drawCommand3.queue        = DevelRenderer::RENDER_QUEUE_OPAQUE;
+
+  DevelRenderer::AddDrawCommand(renderer, drawCommand1);
+  DevelRenderer::AddDrawCommand(renderer, drawCommand2);
+  DevelRenderer::AddDrawCommand(renderer, drawCommand3);
+
+  drawTrace.Reset();
+  drawTrace.Enable(true);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 3, TEST_LOCATION);
+
+  END_TEST;
+}
+int UtcDaliRendererSetGeometryNegative(void)
+{
+  TestApplication application;
+  Dali::Renderer instance;
+  try
+  {
+    Dali::Geometry arg1;
+    instance.SetGeometry(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliRendererSetTexturesNegative(void)
+{
+  TestApplication application;
+  Dali::Renderer instance;
+  try
+  {
+    Dali::TextureSet arg1;
+    instance.SetTextures(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliRendererSetShaderNegative(void)
+{
+  TestApplication application;
+  Dali::Renderer instance;
+  try
+  {
+    Dali::Shader arg1;
+    instance.SetShader(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliRendererGetGeometryNegative(void)
+{
+  TestApplication application;
+  Dali::Renderer instance;
+  try
+  {
+    instance.GetGeometry();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliRendererGetTexturesNegative(void)
+{
+  TestApplication application;
+  Dali::Renderer instance;
+  try
+  {
+    instance.GetTextures();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliRendererGetShaderNegative(void)
+{
+  TestApplication application;
+  Dali::Renderer instance;
+  try
+  {
+    instance.GetShader();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}