Remove uniform mappings. 48/40848/6
authorFrancisco Santos <f1.santos@samsung.com>
Tue, 9 Jun 2015 10:17:33 +0000 (11:17 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Thu, 11 Jun 2015 17:27:36 +0000 (18:27 +0100)
Change-Id: I4b735591476675ba390d36d36a283cc13c17f917

automated-tests/src/dali-internal/utc-Dali-Material.cpp
automated-tests/src/dali/utc-Dali-Geometry.cpp
automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp
automated-tests/src/dali/utc-Dali-Renderer.cpp
automated-tests/src/dali/utc-Dali-Sampler.cpp
automated-tests/src/dali/utc-Dali-Shader.cpp
dali/internal/event/common/object-impl.cpp
dali/public-api/object/handle.cpp
dali/public-api/object/handle.h

index 09a5260..f8e527c 100644 (file)
@@ -588,7 +588,7 @@ int UtcDaliMaterialConstraint01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = material.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -635,8 +635,7 @@ int UtcDaliMaterialConstraint02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = material.RegisterProperty( "fade-color", initialColor );
-  material.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
@@ -693,7 +692,7 @@ int UtcDaliMaterialAnimatedProperty01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = material.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -739,8 +738,7 @@ int UtcDaliMaterialAnimatedProperty02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = material.RegisterProperty( "fade-color", initialColor );
-  material.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = material.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
index 11963d7..f5f289f 100644 (file)
@@ -103,7 +103,7 @@ int UtcDaliGeometryConstraint01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -150,8 +150,7 @@ int UtcDaliGeometryConstraint02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "fade-color", initialColor );
-  geometry.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
@@ -208,7 +207,7 @@ int UtcDaliGeometryAnimatedProperty01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -254,8 +253,7 @@ int UtcDaliGeometryAnimatedProperty02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = geometry.RegisterProperty( "fade-color", initialColor );
-  geometry.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = geometry.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
index 3f4f84b..b74f01f 100644 (file)
@@ -109,7 +109,7 @@ int UtcDaliPropertyBufferConstraint01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = propertyBuffer.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = propertyBuffer.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -157,8 +157,7 @@ int UtcDaliPropertyBufferConstraint02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = propertyBuffer.RegisterProperty( "fade-color", initialColor );
-  propertyBuffer.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = propertyBuffer.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
@@ -216,7 +215,7 @@ int UtcDaliPropertyBufferAnimatedProperty01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = propertyBuffer.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = propertyBuffer.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -263,8 +262,7 @@ int UtcDaliPropertyBufferAnimatedProperty02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = propertyBuffer.RegisterProperty( "fade-color", initialColor );
-  propertyBuffer.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = propertyBuffer.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
index 1f3932d..d6794a4 100644 (file)
@@ -105,7 +105,7 @@ int UtcDaliRendererConstraint01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = renderer.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -152,8 +152,7 @@ int UtcDaliRendererConstraint02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = renderer.RegisterProperty( "fade-color", initialColor );
-  renderer.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
@@ -210,7 +209,7 @@ int UtcDaliRendererAnimatedProperty01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = renderer.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -256,8 +255,7 @@ int UtcDaliRendererAnimatedProperty02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = renderer.RegisterProperty( "fade-color", initialColor );
-  renderer.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
@@ -317,25 +315,18 @@ int UtcDaliRendererUniformMapPrecendence01(void)
   application.SendNotification();
   application.Render(0);
 
-  Property::Index rendererFadeColorIndex = renderer.RegisterProperty( "fade-color-a", Color::RED );
-  renderer.AddUniformMapping( rendererFadeColorIndex, std::string("uFadeColor") );
+  renderer.RegisterProperty( "uFadeColor", Color::RED );
 
-  Property::Index actorFadeColorIndex = actor.RegisterProperty( "fade-color-b", Color::GREEN );
-  actor.AddUniformMapping( actorFadeColorIndex, std::string("uFadeColor") );
+  actor.RegisterProperty( "uFadeColor", Color::GREEN );
 
-  Property::Index materialFadeColorIndex = material.RegisterProperty( "fade-color-c", Color::BLUE );
-  material.AddUniformMapping( materialFadeColorIndex, std::string("uFadeColor") );
+  Property::Index materialFadeColorIndex = material.RegisterProperty( "uFadeColor", Color::BLUE );
 
-  Property::Index samplerFadeColorIndex = sampler.RegisterProperty( "fade-color-d", Color::CYAN );
-  sampler.AddUniformMapping( samplerFadeColorIndex, std::string("uFadeColor") );
-  Property::Index shaderFadeColorIndex = shader.RegisterProperty( "fade-color-e", Color::MAGENTA );
-  shader.AddUniformMapping( shaderFadeColorIndex, std::string("uFadeColor") );
+  sampler.RegisterProperty( "uFadeColor", Color::CYAN );
+  shader.RegisterProperty( "uFadeColor", Color::MAGENTA );
 
-  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "fade-color-f", Color::YELLOW );
-  geometry.AddUniformMapping( geometryFadeColorIndex, std::string("uFadeColor") );
+  geometry.RegisterProperty( "uFadeColor", Color::YELLOW );
 
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color-g", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uFadeColor") );
+  vertexBuffer.RegisterProperty( "uFadeColor", Color::BLACK );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -397,22 +388,16 @@ int UtcDaliRendererUniformMapPrecendence02(void)
 
   // Don't add property / uniform map to renderer
 
-  Property::Index actorFadeColorIndex = actor.RegisterProperty( "fade-color-b", Color::GREEN );
-  actor.AddUniformMapping( actorFadeColorIndex, std::string("uFadeColor") );
+  actor.RegisterProperty( "uFadeColor", Color::GREEN );
 
-  Property::Index materialFadeColorIndex = material.RegisterProperty( "fade-color-c", Color::BLUE );
-  material.AddUniformMapping( materialFadeColorIndex, std::string("uFadeColor") );
+  Property::Index materialFadeColorIndex = material.RegisterProperty( "uFadeColor", Color::BLUE );
 
-  Property::Index samplerFadeColorIndex = sampler.RegisterProperty( "fade-color-d", Color::CYAN );
-  sampler.AddUniformMapping( samplerFadeColorIndex, std::string("uFadeColor") );
-  Property::Index shaderFadeColorIndex = shader.RegisterProperty( "fade-color-e", Color::MAGENTA );
-  shader.AddUniformMapping( shaderFadeColorIndex, std::string("uFadeColor") );
+  sampler.RegisterProperty( "uFadeColor", Color::CYAN );
+  shader.RegisterProperty( "uFadeColor", Color::MAGENTA );
 
-  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "fade-color-f", Color::YELLOW );
-  geometry.AddUniformMapping( geometryFadeColorIndex, std::string("uFadeColor") );
+  geometry.RegisterProperty( "uFadeColor", Color::YELLOW );
 
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color-g", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uFadeColor") );
+  vertexBuffer.RegisterProperty( "uFadeColor", Color::BLACK );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -475,19 +460,14 @@ int UtcDaliRendererUniformMapPrecendence03(void)
 
   // Don't add property / uniform map to renderer or actor
 
-  Property::Index materialFadeColorIndex = material.RegisterProperty( "fade-color-c", Color::BLUE );
-  material.AddUniformMapping( materialFadeColorIndex, std::string("uFadeColor") );
+  material.RegisterProperty( "uFadeColor", Color::BLUE );
 
-  Property::Index samplerFadeColorIndex = sampler.RegisterProperty( "fade-color-d", Color::CYAN );
-  sampler.AddUniformMapping( samplerFadeColorIndex, std::string("uFadeColor") );
-  Property::Index shaderFadeColorIndex = shader.RegisterProperty( "fade-color-e", Color::MAGENTA );
-  shader.AddUniformMapping( shaderFadeColorIndex, std::string("uFadeColor") );
+  sampler.RegisterProperty( "uFadeColor", Color::CYAN );
+  shader.RegisterProperty( "uFadeColor", Color::MAGENTA );
 
-  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "fade-color-f", Color::YELLOW );
-  geometry.AddUniformMapping( geometryFadeColorIndex, std::string("uFadeColor") );
+  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "uFadeColor", Color::YELLOW );
 
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color-g", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uFadeColor") );
+  vertexBuffer.RegisterProperty( "uFadeColor", Color::BLACK );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -550,16 +530,12 @@ int UtcDaliRendererUniformMapPrecendence04(void)
 
   // Don't add property / uniform map to renderer/actor/material
 
-  Property::Index samplerFadeColorIndex = sampler.RegisterProperty( "fade-color-d", Color::CYAN );
-  sampler.AddUniformMapping( samplerFadeColorIndex, std::string("uFadeColor") );
-  Property::Index shaderFadeColorIndex = shader.RegisterProperty( "fade-color-e", Color::MAGENTA );
-  shader.AddUniformMapping( shaderFadeColorIndex, std::string("uFadeColor") );
+  sampler.RegisterProperty( "uFadeColor", Color::CYAN );
+  shader.RegisterProperty( "uFadeColor", Color::MAGENTA );
 
-  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "fade-color-f", Color::YELLOW );
-  geometry.AddUniformMapping( geometryFadeColorIndex, std::string("uFadeColor") );
+  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "uFadeColor", Color::YELLOW );
 
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color-g", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uFadeColor") );
+  vertexBuffer.RegisterProperty( "uFadeColor", Color::BLACK );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -621,14 +597,11 @@ int UtcDaliRendererUniformMapPrecendence05(void)
 
   // Don't add property / uniform map to renderer/actor/material/sampler
 
-  Property::Index shaderFadeColorIndex = shader.RegisterProperty( "fade-color-e", Color::MAGENTA );
-  shader.AddUniformMapping( shaderFadeColorIndex, std::string("uFadeColor") );
+  shader.RegisterProperty( "uFadeColor", Color::MAGENTA );
 
-  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "fade-color-f", Color::YELLOW );
-  geometry.AddUniformMapping( geometryFadeColorIndex, std::string("uFadeColor") );
+  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "uFadeColor", Color::YELLOW );
 
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color-g", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uFadeColor") );
+  vertexBuffer.RegisterProperty( "uFadeColor", Color::BLACK );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -690,11 +663,9 @@ int UtcDaliRendererUniformMapPrecendence06(void)
 
   // Don't add property / uniform map to renderer/actor/material/sampler/shader
 
-  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "fade-color-f", Color::YELLOW );
-  geometry.AddUniformMapping( geometryFadeColorIndex, std::string("uFadeColor") );
+  geometry.RegisterProperty( "uFadeColor", Color::YELLOW );
 
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color-g", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uFadeColor") );
+  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "uFadeColor", Color::BLACK );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -756,8 +727,7 @@ int UtcDaliRendererUniformMapPrecendence07(void)
 
   // Don't add property / uniform map to renderer/actor/material/sampler/shader/geometry
 
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color-g", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uFadeColor") );
+  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "uFadeColor", Color::BLACK );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
@@ -817,25 +787,13 @@ int UtcDaliRendererUniformMapMultipleUniforms01(void)
   application.SendNotification();
   application.Render(0);
 
-  Property::Index rendererFadeColorIndex = renderer.RegisterProperty( "fade-color", Color::RED );
-  renderer.AddUniformMapping( rendererFadeColorIndex, std::string("uUniform1") );
-
-  Property::Index actorFadeColorIndex = actor.RegisterProperty( "fade-color", Color::GREEN );
-  actor.AddUniformMapping( actorFadeColorIndex, std::string("uUniform2") );
-
-  Property::Index materialFadeColorIndex = material.RegisterProperty( "fade-color", Color::BLUE );
-  material.AddUniformMapping( materialFadeColorIndex, std::string("uUniform3") );
-
-  Property::Index samplerFadeColorIndex = sampler.RegisterProperty( "fade-color", Color::CYAN );
-  sampler.AddUniformMapping( samplerFadeColorIndex, std::string("uUniform4") );
-  Property::Index shaderFadeColorIndex = shader.RegisterProperty( "fade-color", Color::MAGENTA );
-  shader.AddUniformMapping( shaderFadeColorIndex, std::string("uUniform5") );
-
-  Property::Index geometryFadeColorIndex = geometry.RegisterProperty( "fade-color", Color::YELLOW );
-  geometry.AddUniformMapping( geometryFadeColorIndex, std::string("uUniform6") );
-
-  Property::Index vertexFadeColorIndex = vertexBuffer.RegisterProperty( "fade-color", Color::BLACK );
-  vertexBuffer.AddUniformMapping( vertexFadeColorIndex, std::string("uUniform7") );
+  renderer.RegisterProperty( "uUniform1", Color::RED );
+  actor.RegisterProperty( "uUniform2", Color::GREEN );
+  material.RegisterProperty( "uUniform3", Color::BLUE );
+  sampler.RegisterProperty( "uUniform4", Color::CYAN );
+  shader.RegisterProperty( "uUniform5", Color::MAGENTA );
+  geometry.RegisterProperty( "uUniform6", Color::YELLOW );
+  vertexBuffer.RegisterProperty( "uUniform7", Color::BLACK );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -904,32 +862,25 @@ int UtcDaliRendererUniformMapMultipleUniforms02(void)
   application.Render(0);
 
   Property::Value value1(Color::RED);
-  Property::Index rendererIndex = renderer.RegisterProperty( "fade-color", value1 );
-  renderer.AddUniformMapping( rendererIndex, std::string("uUniform1") );
+  renderer.RegisterProperty( "uFadeColor", value1 );
 
   Property::Value value2(1.0f);
-  Property::Index actorIndex = actor.RegisterProperty( "fade-progress", value2 );
-  actor.AddUniformMapping( actorIndex, std::string("uUniform2") );
+  actor.RegisterProperty( "uFadeProgress", value2 );
 
   Property::Value value3(Vector3(0.5f, 0.5f, 1.0f));
-  Property::Index materialIndex = material.RegisterProperty( "fade-position", value3);
-  material.AddUniformMapping( materialIndex, std::string("uUniform3") );
+  material.RegisterProperty( "uFadePosition", value3);
 
   Property::Value value4(Vector2(0.5f, 1.0f));
-  Property::Index samplerIndex = sampler.RegisterProperty( "fade-uv", value4 );
-  sampler.AddUniformMapping( samplerIndex, std::string("uUniform4") );
+  sampler.RegisterProperty( "uFadeUV", value4 );
 
   Property::Value value5(Matrix3::IDENTITY);
-  Property::Index shaderIndex = shader.RegisterProperty( "a-normal-matrix", value5 );
-  shader.AddUniformMapping( shaderIndex, std::string("uUniform5") );
+  shader.RegisterProperty( "uANormalMatrix", value5 );
 
   Property::Value value6(Matrix::IDENTITY);
-  Property::Index geometryIndex = geometry.RegisterProperty( "a-world-matrix", value6 );
-  geometry.AddUniformMapping( geometryIndex, std::string("uUniform6") );
+  geometry.RegisterProperty( "uAWorldMatrix", value6 );
 
   Property::Value value7(7);
-  Property::Index vertexIndex = vertexBuffer.RegisterProperty( "fade-color", value7 );
-  vertexBuffer.AddUniformMapping( vertexIndex, std::string("uUniform7") );
+  vertexBuffer.RegisterProperty( "uAnotherFadeColor", value7 );
 
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -939,31 +890,31 @@ int UtcDaliRendererUniformMapMultipleUniforms02(void)
 
   // Expect that each of the object's uniforms are set
   Vector4 uniform1Value(Vector4::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uUniform1", uniform1Value ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", uniform1Value ) );
   DALI_TEST_EQUALS( uniform1Value, value1.Get<Vector4>(), TEST_LOCATION );
 
   float uniform2Value(0.0f);
-  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uUniform2", uniform2Value ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uFadeProgress", uniform2Value ) );
   DALI_TEST_EQUALS( uniform2Value, value2.Get<float>(), TEST_LOCATION );
 
   Vector3 uniform3Value(Vector3::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "uUniform3", uniform3Value ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "uFadePosition", uniform3Value ) );
   DALI_TEST_EQUALS( uniform3Value, value3.Get<Vector3>(), TEST_LOCATION );
 
   Vector2 uniform4Value(Vector2::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector2>( "uUniform4", uniform4Value ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector2>( "uFadeUV", uniform4Value ) );
   DALI_TEST_EQUALS( uniform4Value, value4.Get<Vector2>(), TEST_LOCATION );
 
   Matrix3 uniform5Value;
-  DALI_TEST_CHECK( gl.GetUniformValue<Matrix3>( "uUniform5", uniform5Value ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Matrix3>( "uANormalMatrix", uniform5Value ) );
   DALI_TEST_EQUALS( uniform5Value, value5.Get<Matrix3>(), TEST_LOCATION );
 
   Matrix uniform6Value;
-  DALI_TEST_CHECK( gl.GetUniformValue<Matrix>( "uUniform6", uniform6Value ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Matrix>( "uAWorldMatrix", uniform6Value ) );
   DALI_TEST_EQUALS( uniform6Value, value6.Get<Matrix>(), TEST_LOCATION );
 
   int uniform7Value = 0;
-  DALI_TEST_CHECK( gl.GetUniformValue<int>( "uUniform7", uniform7Value ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<int>( "uAnotherFadeColor", uniform7Value ) );
   DALI_TEST_EQUALS( uniform7Value, value7.Get<int>(), TEST_LOCATION );
 
   END_TEST;
index 09b45eb..3323127 100644 (file)
@@ -167,8 +167,7 @@ int UtcDaliSamplerUniformMap01(void)
   Stage::GetCurrent().Add( actor );
 
   float initialValue = 1.0f;
-  Property::Index widthClampIndex = sampler.RegisterProperty("width-clamp", initialValue );
-  sampler.AddUniformMapping( widthClampIndex, std::string("uWidthClamp") );
+  Property::Index widthClampIndex = sampler.RegisterProperty("uWidthClamp", initialValue );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
index 2a9c404..dfc715f 100644 (file)
@@ -114,7 +114,7 @@ int UtcDaliShaderConstraint01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = shader.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = shader.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -161,8 +161,7 @@ int UtcDaliShaderConstraint02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = shader.RegisterProperty( "fade-color", initialColor );
-  shader.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = shader.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
@@ -219,7 +218,7 @@ int UtcDaliShaderAnimatedProperty01(void)
   Stage::GetCurrent().Add(actor);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = shader.RegisterProperty( "fade-color", initialColor );
+  Property::Index colorIndex = shader.RegisterProperty( "uFadeColor", initialColor );
 
   application.SendNotification();
   application.Render(0);
@@ -265,8 +264,7 @@ int UtcDaliShaderAnimatedProperty02(void)
   application.Render(0);
 
   Vector4 initialColor = Color::WHITE;
-  Property::Index colorIndex = shader.RegisterProperty( "fade-color", initialColor );
-  shader.AddUniformMapping( colorIndex, std::string("uFadeColor") );
+  Property::Index colorIndex = shader.RegisterProperty( "uFadeColor", initialColor );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
 
index c549e5f..5b36bf7 100644 (file)
@@ -50,6 +50,8 @@ typedef Dali::Vector<Object::Observer*>::ConstIterator ConstObserverIter;
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_OBJECT" );
 #endif
+
+
 } // unnamed namespace
 
 Object::Object()
@@ -635,7 +637,12 @@ Property::Index Object::RegisterSceneGraphProperty(const std::string& name, Prop
 
 Property::Index Object::RegisterProperty( const std::string& name, const Property::Value& propertyValue)
 {
-  return RegisterSceneGraphProperty(name, PROPERTY_CUSTOM_START_INDEX + mCustomProperties.Count(), propertyValue);
+  Property::Index index = RegisterSceneGraphProperty(name, PROPERTY_CUSTOM_START_INDEX + mCustomProperties.Count(), propertyValue);
+
+  /// @todo: don't keep a table of mappings per handle.
+  AddUniformMapping(index, name);
+
+  return index;
 }
 
 Property::Index Object::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode)
index e71b093..80da558 100644 (file)
@@ -168,16 +168,6 @@ void Handle::RemoveConstraints( unsigned int tag )
   GetImplementation(*this).RemoveConstraints( tag );
 }
 
-void Handle::AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName )
-{
-  GetImplementation(*this).AddUniformMapping( propertyIndex, uniformName );
-}
-
-void Handle::RemoveUniformMapping( const std::string uniformName )
-{
-  GetImplementation(*this).RemoveUniformMapping( uniformName );
-}
-
 namespace WeightObject
 {
 
index 6deb17d..7421f49 100644 (file)
@@ -334,36 +334,6 @@ public:
    */
   void RemoveConstraints( unsigned int tag );
 
-  /**
-   * @brief Add an uniform mapping
-   *
-   * Uniform mappings can be used to specify that a property value should be provided to the
-   * shader under a uniform name.
-   *
-   * If multiple objects connected to a Renderer provide mappings for the same uniform name,
-   * the value that is set will come from the object with highest precedence according to this list:
-   *   - Renderer (highest precedence)
-   *   - Actor
-   *   - Material
-   *   - Shader
-   *   - Geometry (lowest precedence)
-   *
-   * Mappings in any other objects are ignored.
-   *
-   * If more than one mapping with the same uniform name is added, then the instead of creating a new
-   * mapping this function changes the propertyIndex on the existing one.
-   *
-   * @param[in] propertyIndex Index of a property hold by the object pointed by this handle
-   * @param[in] uniformName Name of the uniform
-   */
-  void AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName );
-
-  /**
-   * @brief Removes the mapping for the given uniform name, if there is any
-   *
-   * @param[in] uniformName Name of a uniform in a mapping
-   */
-  void RemoveUniformMapping( const std::string uniformName );
 };
 
 namespace WeightObject