Remove unnamed namespace from DissolveEffect (Klocwork Error)
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / shader-effects / dissolve-effect.h
index 95cccc8..4953e4d 100644 (file)
 #include <string.h>
 #include <dali/devel-api/rendering/shader.h>
 
-namespace
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+/**
+ * @brief Only registers the required property if it has not registered it before.
+ *
+ * @tparam  T  The type of the property.
+ *
+ * @param[in]  actor  The actor to register the property with.
+ * @param[in]  name   The name of the property.
+ * @param[in]  value  The value the property should be set to.
+ */
+template < typename T>
+DALI_INTERNAL void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value )
 {
-  template < typename T>
-  void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value )
+  Dali::Property::Index index = actor.GetPropertyIndex( name );
+  if ( Dali::Property::INVALID_INDEX == index )
   {
-    Dali::Property::Index index = actor.GetPropertyIndex( name );
-    if ( Dali::Property::INVALID_INDEX == index )
-    {
-      index = actor.RegisterProperty( name, value );
-    }
-    else
-    {
-      actor.SetProperty( index, value );
-    }
+    index = actor.RegisterProperty( name, value );
   }
-
-  template < typename T>
-  void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value, Dali::Property::AccessMode accessMode )
+  else
   {
-    Dali::Property::Index index = actor.GetPropertyIndex( name );
-    if ( Dali::Property::INVALID_INDEX == index )
-    {
-      index = actor.RegisterProperty( name, value, accessMode );
-    }
-    else
-    {
-      actor.SetProperty( index, value );
-    }
+    actor.SetProperty( index, value );
   }
+}
 
-};
-
-namespace Dali
-{
-
-namespace Toolkit
+/**
+ * @brief Only registers the required property if it has not registered it before.
+ *
+ * @tparam  T  The type of the property.
+ *
+ * @param[in]  actor       The actor to register the property with.
+ * @param[in]  name        The name of the property.
+ * @param[in]  value       The value the property should be set to.
+ * @param[in]  accessMode  The accessMode required for the property.
+ */
+template < typename T>
+DALI_INTERNAL void SafeSetCustomProperty( Dali::Actor& actor, const std::string& name, const T& value, Dali::Property::AccessMode accessMode )
 {
+  Dali::Property::Index index = actor.GetPropertyIndex( name );
+  if ( Dali::Property::INVALID_INDEX == index )
+  {
+    index = actor.RegisterProperty( name, value, accessMode );
+  }
+  else
+  {
+    actor.SetProperty( index, value );
+  }
+}
 
 /**
  * @brief Set the dissolve central line.
@@ -150,7 +165,7 @@ inline void DissolveEffectSetCentralLine( Actor& actor, const Vector2& position,
  *    "uPercentage" - This value is proportional to the distortion applied; a value of zero means no distortion.
  *
  *  @param[in] useHighPrecision True if using high precision in fragment shader for fully random noise, false otherwise
- *  @return A handle to a newly allocated ShaderEffect
+ *  @return The newly created Property::Map with the dissolve effect
  */
 
 inline Property::Map CreateDissolveEffect( bool useHighPrecision = true )
@@ -245,13 +260,13 @@ inline Property::Map CreateDissolveEffect( bool useHighPrecision = true )
   vertexShaderString.append( vertexShader );
   fragmentShaderString.append( fragmentShader );
 
-  customShader[ "vertex-shader" ] = vertexShaderString;
-  customShader[ "fragment-shader" ] = fragmentShaderString;
+  customShader[ "vertexShader" ] = vertexShaderString;
+  customShader[ "fragmentShader" ] = fragmentShaderString;
 
-  customShader[ "subdivide-grid-x" ] = 20;
-  customShader[ "subdivide-grid-y" ] = 20;
+  customShader[ "subdivideGridX" ] = 20;
+  customShader[ "subdivideGridY" ] = 20;
 
-  customShader[ "hints" ] = "output-is-transparent";
+  customShader[ "hints" ] = "outputIsTransparent";
 
   map[ "shader" ] = customShader;
   return map;