[dali_1.9.17] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Geometry.cpp
index 4574a29..ab99c59 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,8 +17,6 @@
 
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/rendering/renderer.h>
 
 using namespace Dali;
 
@@ -37,11 +35,6 @@ void geometry_test_cleanup(void)
 namespace
 {
 
-void TestConstraintNoBlue( Vector4& current, const PropertyInputContainer& inputs )
-{
-  current.b = 0.0f;
-}
-
 struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
 
 PropertyBuffer CreateVertexBuffer( const std::string& aPosition, const std::string& aTexCoord )
@@ -57,22 +50,12 @@ PropertyBuffer CreateVertexBuffer( const std::string& aPosition, const std::stri
   vertexFormat[aPosition] = Property::VECTOR2;
   vertexFormat[aTexCoord] = Property::VECTOR2;
 
-  PropertyBuffer vertexData = PropertyBuffer::New( vertexFormat, 4 );
-  vertexData.SetData(texturedQuadVertexData);
+  PropertyBuffer vertexData = PropertyBuffer::New( vertexFormat );
+  vertexData.SetData( texturedQuadVertexData, 4 );
 
   return vertexData;
 }
 
-PropertyBuffer CreateIndexBuffer()
-{
-  unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
-  Property::Map indexFormat;
-  indexFormat["indices"] = Property::UNSIGNED_INTEGER; // Should be Unsigned Short
-  PropertyBuffer indices = PropertyBuffer::New( indexFormat, 3 );
-  indices.SetData(indexData);
-
-  return indices;
-}
 
 }
 
@@ -154,10 +137,10 @@ int UtcDaliGeometryAddVertexBuffer(void)
   Geometry geometry = Geometry::New();
   geometry.AddVertexBuffer( vertexBuffer1 );
 
-  Material material = CreateMaterial(1.f);
-  Renderer renderer = Renderer::New(geometry, material);
+  Shader shader = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
   Actor actor = Actor::New();
-  actor.SetSize(Vector3::ONE * 100.f);
+  actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
   actor.AddRenderer(renderer);
   Stage::GetCurrent().Add(actor);
 
@@ -189,10 +172,9 @@ int UtcDaliGeometryAddVertexBuffer(void)
     const TestGlAbstraction::BufferDataCalls& bufferDataCalls =
         application.GetGlAbstraction().GetBufferDataCalls();
 
-    DALI_TEST_EQUALS( bufferDataCalls.size(), 2u, TEST_LOCATION );
-
+    //Check that only the new buffer gets uploaded
+    DALI_TEST_EQUALS( bufferDataCalls.size(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( bufferDataCalls[0], 4*sizeof( TexturedQuadVertex ), TEST_LOCATION );
-    DALI_TEST_EQUALS( bufferDataCalls[1], 4*sizeof( TexturedQuadVertex ), TEST_LOCATION );
   }
 
   END_TEST;
@@ -233,10 +215,10 @@ int UtcDaliGeometryRemoveVertexBuffer(void)
   Geometry geometry = Geometry::New();
   geometry.AddVertexBuffer( vertexBuffer1 );
 
-  Material material = CreateMaterial(1.f);
-  Renderer renderer = Renderer::New(geometry, material);
+  Shader shader = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
   Actor actor = Actor::New();
-  actor.SetSize(Vector3::ONE * 100.f);
+  actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
   actor.AddRenderer(renderer);
   Stage::GetCurrent().Add(actor);
 
@@ -262,15 +244,14 @@ int UtcDaliGeometrySetIndexBuffer(void)
   tet_infoline("Test SetIndexBuffer");
 
   PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
-  PropertyBuffer indexBuffer = CreateIndexBuffer( );
 
   Geometry geometry = Geometry::New();
   geometry.AddVertexBuffer( vertexBuffer );
 
-  Material material = CreateMaterial(1.f);
-  Renderer renderer = Renderer::New(geometry, material);
+  Shader shader = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
   Actor actor = Actor::New();
-  actor.SetSize(Vector3::ONE * 100.f);
+  actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
   actor.AddRenderer(renderer);
   Stage::GetCurrent().Add(actor);
 
@@ -291,7 +272,8 @@ int UtcDaliGeometrySetIndexBuffer(void)
   // Set index buffer
   application.GetGlAbstraction().ResetBufferDataCalls();
 
-  geometry.SetIndexBuffer( indexBuffer );
+  const unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+  geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
   application.SendNotification();
   application.Render(0);
   application.Render();
@@ -301,22 +283,22 @@ int UtcDaliGeometrySetIndexBuffer(void)
     const TestGlAbstraction::BufferDataCalls& bufferDataCalls =
         application.GetGlAbstraction().GetBufferDataCalls();
 
-    DALI_TEST_EQUALS( bufferDataCalls.size(), 2u, TEST_LOCATION );
+    //Only the index buffer should be uploaded
+    DALI_TEST_EQUALS( bufferDataCalls.size(), 1u, TEST_LOCATION );
 
-    DALI_TEST_EQUALS( bufferDataCalls[0], 4*sizeof( TexturedQuadVertex ), TEST_LOCATION );
     // should be unsigned short instead of unsigned int
-    DALI_TEST_EQUALS( bufferDataCalls[1], 6*sizeof( unsigned short ), TEST_LOCATION );
+    DALI_TEST_EQUALS( bufferDataCalls[0], 6*sizeof( unsigned short ), TEST_LOCATION );
   }
 
 
   END_TEST;
 }
 
-int UtcDaliGeometrySetGetGeometryType(void)
+int UtcDaliGeometrySetGetGeometryType01(void)
 {
   TestApplication application;
 
-  tet_infoline("Test SetGeometryType and GetGeometryType");
+  tet_infoline("Test SetType and GetType: without index buffer");
 
   unsigned int numVertex = 4u;
   PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
@@ -324,10 +306,10 @@ int UtcDaliGeometrySetGetGeometryType(void)
   Geometry geometry = Geometry::New();
   geometry.AddVertexBuffer( vertexBuffer );
 
-  Material material = CreateMaterial(1.f);
-  Renderer renderer = Renderer::New(geometry, material);
+  Shader shader = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
   Actor actor = Actor::New();
-  actor.SetSize(Vector3::ONE * 100.f);
+  actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
   actor.AddRenderer(renderer);
   Stage::GetCurrent().Add(actor);
 
@@ -351,11 +333,11 @@ int UtcDaliGeometrySetGetGeometryType(void)
   out << GL_TRIANGLES << ", " << 0 << ", " << numVertex;
   DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawArrays", out.str()), true, TEST_LOCATION);
 
-  DALI_TEST_EQUALS( geometry.GetGeometryType(), Geometry::TRIANGLES, TEST_LOCATION);
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLES, TEST_LOCATION);
 
   /*********************************************************/
   // LINES, no index buffer
-  geometry.SetGeometryType( Geometry::LINES );
+  geometry.SetType( Geometry::LINES );
 
   drawTrace.Reset();
   drawTrace.Enable(true);
@@ -372,11 +354,11 @@ int UtcDaliGeometrySetGetGeometryType(void)
   out << GL_LINES << ", " << 0 << ", " << numVertex;
   DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawArrays", out.str()), true, TEST_LOCATION);
 
-  DALI_TEST_EQUALS( geometry.GetGeometryType(), Geometry::LINES, TEST_LOCATION);
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::LINES, TEST_LOCATION);
 
   /*****************************************************/
   //POINTS
-  geometry.SetGeometryType( Geometry::POINTS );
+  geometry.SetType( Geometry::POINTS );
 
   drawTrace.Reset();
   drawTrace.Enable(true);
@@ -393,279 +375,177 @@ int UtcDaliGeometrySetGetGeometryType(void)
   out << GL_POINTS << ", " << 0 << ", " << numVertex;
   DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawArrays", out.str()), true, TEST_LOCATION);
 
-  DALI_TEST_EQUALS( geometry.GetGeometryType(), Geometry::POINTS, TEST_LOCATION);
-
-  END_TEST;
-}
-
-int UtcDaliGeometrySetGetRequireDepthTesting(void)
-{
-  TestApplication application;
-
-  tet_infoline("Test SetRequiresDepthTesting, GetRequiresDepthTesting");
-
-  Shader shader = Shader::New("VertexSource", "FragmentSource");
-  Material material = Material::New( shader );
-
-  Geometry geometry = CreateQuadGeometry();
-  Renderer renderer = Renderer::New( geometry, material );
-
-  Actor actor = Actor::New();
-  actor.AddRenderer(renderer);
-  actor.SetSize(400, 400);
-  Stage::GetCurrent().Add(actor);
-
-  DALI_TEST_EQUALS( geometry.GetRequiresDepthTesting(), false, TEST_LOCATION );
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::POINTS, TEST_LOCATION);
 
-  geometry.SetRequiresDepthTesting(true);
+  /*****************************************************/
+  //TRIANGLE_STRIP, no index buffer
+  geometry.SetType( Geometry::TRIANGLE_STRIP );
 
-  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
-  glAbstraction.EnableCullFaceCallTrace(true);
+  drawTrace.Reset();
+  drawTrace.Enable(true);
   application.SendNotification();
+  application.Render(0);
   application.Render();
-//  TODO: Not supported yes
-//  TraceCallStack& glEnableStack = glAbstraction.GetCullFaceTrace();
-//  std::ostringstream out;
-//  out << GL_DEPTH_TEST;
-//  DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", out.str().c_str() ) );
-
-  DALI_TEST_EQUALS( geometry.GetRequiresDepthTesting(), true, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliGeometryPropertyRequiresDepthTest(void)
-{
-  TestApplication application;
-
-  tet_infoline("Test SetRequiresDepthTesting, GetRequiresDepthTesting");
-
-  Shader shader = Shader::New("VertexSource", "FragmentSource");
-  Material material = Material::New( shader );
-
-  Geometry geometry = CreateQuadGeometry();
-  Renderer renderer = Renderer::New( geometry, material );
-
-  Actor actor = Actor::New();
-  actor.AddRenderer(renderer);
-  actor.SetSize(400, 400);
-  Stage::GetCurrent().Add(actor);
-
-  DALI_TEST_EQUALS( geometry.GetProperty<bool>(Geometry::Property::REQUIRES_DEPTH_TEST), false, TEST_LOCATION );
-
-  geometry.SetProperty(Geometry::Property::REQUIRES_DEPTH_TEST, true );
-
-  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
-  glAbstraction.EnableCullFaceCallTrace(true);
   application.SendNotification();
-  application.Render();
-//  TODO: Not supported yes
-//  TraceCallStack& glEnableStack = glAbstraction.GetCullFaceTrace();
-//  std::ostringstream out;
-//  out << GL_DEPTH_TEST;
-//  DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", out.str().c_str() ) );
-
-  DALI_TEST_EQUALS( geometry.GetProperty<bool>(Geometry::Property::REQUIRES_DEPTH_TEST), true, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliGeometryConstraint(void)
-{
-  TestApplication application;
-
-  tet_infoline("Test that a custom geometry property can be constrained");
+  drawTrace.Enable( false );
 
-  Shader shader = Shader::New("VertexSource", "FragmentSource");
-  Material material = Material::New( shader );
-  material.SetProperty(Material::Property::COLOR, Color::WHITE);
+  // geometry type is set as GL_TRIANGLE_STRIP
+  // no index buffer, call glDrawArrays,
+  DALI_TEST_EQUALS( drawTrace.CountMethod( "DrawArrays" ), 2, TEST_LOCATION);
+  out.str("");
+  out << GL_TRIANGLE_STRIP << ", " << 0 << ", " << numVertex;
+  DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawArrays", out.str()), true, TEST_LOCATION);
 
-  Geometry geometry = CreateQuadGeometry();
-  Renderer renderer = Renderer::New( geometry, material );
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLE_STRIP, TEST_LOCATION);
 
-  Actor actor = Actor::New();
-  actor.AddRenderer(renderer);
-  actor.SetSize(400, 400);
-  Stage::GetCurrent().Add(actor);
-
-  Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
+  /*****************************************************/
+  //TRIANGLE_FAN, no index buffer
+  geometry.SetType( Geometry::TRIANGLE_FAN );
 
+  drawTrace.Reset();
+  drawTrace.Enable(true);
   application.SendNotification();
   application.Render(0);
-  DALI_TEST_EQUALS( geometry.GetProperty<Vector4>(colorIndex), initialColor, TEST_LOCATION );
-
-  // Apply constraint
-  Constraint constraint = Constraint::New<Vector4>( geometry, colorIndex, TestConstraintNoBlue );
-  constraint.Apply();
+  application.Render();
   application.SendNotification();
-  application.Render(0);
+  drawTrace.Enable( false );
 
-  // Expect no blue component in either buffer - yellow
-  DALI_TEST_EQUALS( geometry.GetProperty<Vector4>(colorIndex), Color::YELLOW, TEST_LOCATION );
-  application.Render(0);
-  DALI_TEST_EQUALS( geometry.GetProperty<Vector4>(colorIndex), Color::YELLOW, TEST_LOCATION );
+  // geometry type is set as GL_TRIANGLE_FAN
+  // no index buffer, call glDrawArrays,
+  DALI_TEST_EQUALS( drawTrace.CountMethod( "DrawArrays" ), 2, TEST_LOCATION);
+  out.str("");
+  out << GL_TRIANGLE_FAN << ", " << 0 << ", " << numVertex;
+  DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawArrays", out.str()), true, TEST_LOCATION);
 
-  geometry.RemoveConstraints();
-  geometry.SetProperty(colorIndex, Color::WHITE );
-  application.SendNotification();
-  application.Render(0);
-  DALI_TEST_EQUALS( geometry.GetProperty<Vector4>(colorIndex), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLE_FAN, TEST_LOCATION);
 
   END_TEST;
 }
 
-int UtcDaliGeometryConstraint02(void)
+int UtcDaliGeometrySetGetGeometryType02(void)
 {
   TestApplication application;
 
-  tet_infoline("Test that a uniform map geometry property can be constrained");
+  tet_infoline("Test SetType and GetType: with index buffer");
 
-  Shader shader = Shader::New("VertexSource", "FragmentSource");
-  Material material = Material::New( shader );
-  material.SetProperty(Material::Property::COLOR, Color::WHITE);
+  unsigned int numVertex = 4u;
+  unsigned int numIndex = 6u; // 6 unsigned short
+  PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
 
-  Geometry geometry = CreateQuadGeometry();
-  Renderer renderer = Renderer::New( geometry, material );
 
+  Geometry geometry = Geometry::New();
+  geometry.AddVertexBuffer( vertexBuffer );
+  const unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+  geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
+
+  Shader shader = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
   Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
   actor.AddRenderer(renderer);
-  actor.SetSize(400, 400);
   Stage::GetCurrent().Add(actor);
-  application.SendNotification();
-  application.Render(0);
 
-  Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
-
-  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+  TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
 
+  /****************************************************/
+  // Default (TRIANGLES), with index buffer
+  drawTrace.Reset();
+  drawTrace.Enable(true);
   application.SendNotification();
   application.Render(0);
-
-  Vector4 actualValue(Vector4::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, initialColor, TEST_LOCATION );
-
-  // Apply constraint
-  Constraint constraint = Constraint::New<Vector4>( geometry, colorIndex, TestConstraintNoBlue );
-  constraint.Apply();
+  application.Render();
   application.SendNotification();
-  application.Render(0);
+  drawTrace.Enable( false );
+
+  // Test the default geometry type is GL_TRIANGLE
+  DALI_TEST_EQUALS( drawTrace.CountMethod( "DrawElements" ), 2, TEST_LOCATION);
+  std::stringstream out;
+  out << GL_TRIANGLES << ", " << numIndex << ", " << GL_UNSIGNED_SHORT<<", "<<"indices";
+  DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawElements", out.str()), true, TEST_LOCATION);
 
-   // Expect no blue component in either buffer - yellow
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::YELLOW, TEST_LOCATION );
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLES, TEST_LOCATION);
 
-  application.Render(0);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::YELLOW, TEST_LOCATION );
+  /*********************************************************/
+  // LINES, with index buffer
+  geometry.SetType( Geometry::LINES );
 
-  geometry.RemoveConstraints();
-  geometry.SetProperty(colorIndex, Color::WHITE );
+  drawTrace.Reset();
+  drawTrace.Enable(true);
   application.SendNotification();
   application.Render(0);
+  application.Render();
+  application.SendNotification();
+  drawTrace.Enable( false );
 
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::WHITE, TEST_LOCATION );
-
-  END_TEST;
-}
-
-
-
-int UtcDaliGeometryAnimatedProperty01(void)
-{
-  TestApplication application;
-
-  tet_infoline("Test that a custom geometry property can be animated");
-
-  Shader shader = Shader::New("VertexSource", "FragmentSource");
-  Material material = Material::New( shader );
-  material.SetProperty(Material::Property::COLOR, Color::WHITE);
-
-  Geometry geometry = CreateQuadGeometry();
-  Renderer renderer = Renderer::New( geometry, material );
+  // geometry type is set as GL_LINES
+  DALI_TEST_EQUALS( drawTrace.CountMethod( "DrawElements" ), 2, TEST_LOCATION);
+  out.str("");
+  out << GL_LINES << ", " << numIndex << ", " << GL_UNSIGNED_SHORT<<", "<<"indices";
+  DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawElements", out.str()), true, TEST_LOCATION);
 
-  Actor actor = Actor::New();
-  actor.AddRenderer(renderer);
-  actor.SetSize(400, 400);
-  Stage::GetCurrent().Add(actor);
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::LINES, TEST_LOCATION);
 
-  Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
+  /*****************************************************/
+  //POINTS
+  geometry.SetType( Geometry::POINTS );
 
+  drawTrace.Reset();
+  drawTrace.Enable(true);
   application.SendNotification();
   application.Render(0);
-  DALI_TEST_EQUALS( geometry.GetProperty<Vector4>(colorIndex), initialColor, TEST_LOCATION );
-
-  Animation  animation = Animation::New(1.0f);
-  KeyFrames keyFrames = KeyFrames::New();
-  keyFrames.Add(0.0f, initialColor);
-  keyFrames.Add(1.0f, Color::TRANSPARENT);
-  animation.AnimateBetween( Property( geometry, colorIndex ), keyFrames );
-  animation.Play();
-
+  application.Render();
   application.SendNotification();
-  application.Render(500);
-
-  DALI_TEST_EQUALS( geometry.GetProperty<Vector4>(colorIndex), Color::WHITE * 0.5f, TEST_LOCATION );
-
-  application.Render(500);
-
-  DALI_TEST_EQUALS( geometry.GetProperty<Vector4>(colorIndex), Color::TRANSPARENT, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliGeometryAnimatedProperty02(void)
-{
-  TestApplication application;
+  drawTrace.Enable( false );
 
-  tet_infoline("Test that a uniform map geometry property can be animated");
+  // geometry type is set as GL_POINTS
+  // As Points does not use the index buffer, call glDrawArrays,
+  DALI_TEST_EQUALS( drawTrace.CountMethod( "DrawArrays" ), 2, TEST_LOCATION);
+  out.str("");
+  out << GL_POINTS << ", " << 0 << ", " << numVertex;
+  DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawArrays", out.str()), true, TEST_LOCATION);
 
-  Shader shader = Shader::New("VertexSource", "FragmentSource");
-  Material material = Material::New( shader );
-  material.SetProperty(Material::Property::COLOR, Color::WHITE);
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::POINTS, TEST_LOCATION);
 
-  Geometry geometry = CreateQuadGeometry();
-  Renderer renderer = Renderer::New( geometry, material );
+  /*****************************************************/
+  //TRIANGLE_STRIP
+  geometry.SetType( Geometry::TRIANGLE_STRIP );
 
-  Actor actor = Actor::New();
-  actor.AddRenderer(renderer);
-  actor.SetSize(400, 400);
-  Stage::GetCurrent().Add(actor);
+  drawTrace.Reset();
+  drawTrace.Enable(true);
   application.SendNotification();
   application.Render(0);
+  application.Render();
+  application.SendNotification();
+  drawTrace.Enable( false );
+
+  // geometry type is set as GL_TRIANGLE_STRIP
+  DALI_TEST_EQUALS( drawTrace.CountMethod( "DrawElements" ), 2, TEST_LOCATION);
+  out.str("");
+  out << GL_TRIANGLE_STRIP << ", " << numIndex << ", " << GL_UNSIGNED_SHORT<<", "<<"indices";
+  DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawElements", out.str()), true, TEST_LOCATION);
 
-  Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLE_STRIP, TEST_LOCATION);
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
+  /*****************************************************/
+  //TRIANGLE_FAN
+  geometry.SetType( Geometry::TRIANGLE_FAN );
 
+  drawTrace.Reset();
+  drawTrace.Enable(true);
   application.SendNotification();
   application.Render(0);
-
-  Vector4 actualValue(Vector4::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, initialColor, TEST_LOCATION );
-
-  Animation  animation = Animation::New(1.0f);
-  KeyFrames keyFrames = KeyFrames::New();
-  keyFrames.Add(0.0f, initialColor);
-  keyFrames.Add(1.0f, Color::TRANSPARENT);
-  animation.AnimateBetween( Property( geometry, colorIndex ), keyFrames );
-  animation.Play();
-
+  application.Render();
   application.SendNotification();
-  application.Render(500);
+  drawTrace.Enable( false );
 
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::WHITE * 0.5f, TEST_LOCATION );
+  // geometry type is set as GL_TRIANGLE_FAN
+  DALI_TEST_EQUALS( drawTrace.CountMethod( "DrawElements" ), 2, TEST_LOCATION);
+  out.str("");
+  out << GL_TRIANGLE_FAN << ", " << numIndex << ", " << GL_UNSIGNED_SHORT<<", "<<"indices";
+  DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawElements", out.str()), true, TEST_LOCATION);
 
-  application.Render(500);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
-  DALI_TEST_EQUALS( actualValue, Color::TRANSPARENT, TEST_LOCATION );
+  DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLE_FAN, TEST_LOCATION);
 
   END_TEST;
 }