(Control Renderers) Removed Renderer suffix from rendererType & created programming...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / color / color-renderer.cpp
index b6074eb..ddc41f5 100644 (file)
@@ -38,10 +38,8 @@ namespace Internal
 namespace
 {
 const char * const RENDERER_TYPE("rendererType");
-const char * const RENDERER_TYPE_VALUE("colorRenderer");
+const char * const RENDERER_TYPE_VALUE("color");
 const char * const COLOR_NAME("blendColor");
-const char * const COLOR_UNIFORM_NAME("uBlendColor");
-
 
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
@@ -58,11 +56,11 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
 
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 uBlendColor;\n
+  uniform lowp vec4 blendColor;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = uBlendColor*uColor;\n
+    gl_FragColor = blendColor*uColor;\n
   }\n
 );
 }
@@ -136,10 +134,10 @@ void ColorRenderer::InitializeRenderer()
   Material material = Material::New( shader );
   mImpl->mRenderer = Renderer::New( geometry, material );
 
-  mBlendColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_UNIFORM_NAME, mBlendColor );
+  mBlendColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mBlendColor );
   if( mBlendColor.a < 1.f )
   {
-    mImpl->mRenderer.GetMaterial().SetBlendMode( BlendingMode::ON );
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
   }
 }
 
@@ -150,9 +148,9 @@ void ColorRenderer::SetColor(const Vector4& color)
   if( mImpl->mRenderer )
   {
     (mImpl->mRenderer).SetProperty( mBlendColorIndex, color );
-    if( color.a < 1.f &&  (mImpl->mRenderer).GetMaterial().GetBlendMode() != BlendingMode::ON)
+    if( color.a < 1.f )
     {
-      (mImpl->mRenderer).GetMaterial().SetBlendMode( BlendingMode::ON );
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
     }
   }
 }