Merge Handle & Constrainable
[platform/core/uifw/dali-core.git] / dali / public-api / shader-effects / shader-effect.h
index 0f83f5a..446bb12 100644 (file)
@@ -20,9 +20,9 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/active-constraint-declarations.h>
-#include <dali/public-api/object/constrainable.h>
+#include <dali/public-api/object/handle.h>
 
-namespace Dali DALI_IMPORT_API
+namespace Dali
 {
 
 /**
@@ -40,7 +40,7 @@ namespace Dali DALI_IMPORT_API
  * "  }\n";
  *
  * [An example of DALI_COMPOSE_SHADER usage]
- * const string FRAGMENT_SHADER_SOURCE = DALI_COMPOSE_SHADER (
+ * const string VERTEX_SHADER_SOURCE = DALI_COMPOSE_SHADER (
  *   void main()
  *   {
  *     gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);
@@ -68,7 +68,7 @@ enum GeometryType
 {
   GEOMETRY_TYPE_IMAGE = 0x01,         ///< image, with flat color or texture
   GEOMETRY_TYPE_TEXT = 0x02,          ///< text, with flat color or texture
-  GEOMETRY_TYPE_MESH = 0x04,          ///< Complex meshes, with flat color
+  GEOMETRY_TYPE_UNTEXTURED_MESH = 0x04,///< Complex meshes, with flat color
   GEOMETRY_TYPE_TEXTURED_MESH = 0x08, ///< Complex meshes, with texture
   GEOMETRY_TYPE_LAST = 0x10
 };
@@ -147,7 +147,7 @@ enum GeometryType
  * with the uniform color "uColor" of the node
  * </B>
  */
-class ShaderEffect : public Constrainable
+class DALI_IMPORT_API ShaderEffect : public Handle
 {
 public:
   /**
@@ -185,8 +185,8 @@ public:
    */
   static const Property::Index GRID_DENSITY;       ///< name "grid-density",   type FLOAT
   static const Property::Index IMAGE;              ///< name "image",          type MAP; {"filename":"", "load-policy":...}
-  static const Property::Index PROGRAM;            ///< name "program",        type MAP; {"vertex-filename":"",...}
-  static const Property::Index GEOMETRY_HINTS;     ///< name "geometry-hints", type INT (bitfield)
+  static const Property::Index PROGRAM;            ///< name "program",        type MAP; {"vertex-prefix":"","fragment-prefix":"","vertex":"","fragment":""}
+  static const Property::Index GEOMETRY_HINTS;     ///< name "geometry-hints", type INT (bitfield) values from enum GeometryHints
 
   static const float DEFAULT_GRID_DENSITY;         ///< The default density is 40 pixels
 
@@ -195,12 +195,13 @@ public:
    */
   enum GeometryHints
   {
-    HINT_NONE         = 0x00,   ///< no hints
-    HINT_GRID_X       = 0x01,   ///< Geometry must be subdivided in X
-    HINT_GRID_Y       = 0x02,   ///< Geometry must be subdivided in Y
-    HINT_GRID         = (HINT_GRID_X | HINT_GRID_Y),
-    HINT_DEPTH_BUFFER = 0x04,   ///< Needs depth buffering turned on
-    HINT_BLENDING     = 0x08    ///< Notifies the actor to use blending even if it's fully opaque. Needs actor's blending set to BlendingMode::AUTO
+    HINT_NONE           = 0x00,   ///< no hints
+    HINT_GRID_X         = 0x01,   ///< Geometry must be subdivided in X
+    HINT_GRID_Y         = 0x02,   ///< Geometry must be subdivided in Y
+    HINT_GRID           = (HINT_GRID_X | HINT_GRID_Y),
+    HINT_DEPTH_BUFFER   = 0x04,   ///< Needs depth buffering turned on
+    HINT_BLENDING       = 0x08,   ///< Notifies the actor to use blending even if it's fully opaque. Needs actor's blending set to BlendingMode::AUTO
+    HINT_DOESNT_MODIFY_GEOMETRY = 0x10 ///< Notifies that the vertex shader will not change geometry (enables bounding box culling)
   };
 
   /**
@@ -213,10 +214,9 @@ public:
    */
   enum UniformCoordinateType
   {
-    COORDINATE_TYPE_DEFAULT,            ///< Default, No transformation to be applied
-    COORDINATE_TYPE_VIEWPORT_POSITION,  ///< The uniform is a position vector in viewport coordinates that needs to be converted to GL view space coordinates.
-    COORDINATE_TYPE_VIEWPORT_DIRECTION, ///< The uniform is a directional vector in viewport coordinates that needs to be converted to GL view space coordinates.
-    COORDINATE_TYPE_TEXTURE_POSITION    ///< The uniform is a position in texture coordinates.
+    COORDINATE_TYPE_DEFAULT,           ///< Default, No transformation to be applied
+    COORDINATE_TYPE_VIEWPORT_POSITION, ///< The uniform is a position vector in viewport coordinates that needs to be converted to GL view space coordinates.
+    COORDINATE_TYPE_VIEWPORT_DIRECTION ///< The uniform is a directional vector in viewport coordinates that needs to be converted to GL view space coordinates.
   };
 
   /**
@@ -321,14 +321,17 @@ public:
   ShaderEffect(const ShaderEffect& object);
 
   /**
-   * @copydoc Dali::BaseHandle::operator=
+   * @brief This assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] rhs  A reference to the copied handle
+   * @return A reference to this
    */
-  using BaseHandle::operator=;
+  ShaderEffect& operator=(const ShaderEffect& rhs);
 
   /**
    * @brief Sets image for using as effect texture.
    *
-   * This image texture will be bound to the "sEffectTexture" sampler
+   * This image texture will be bound to the "sEffect" sampler
    * so it can be used in fragment shader for effects
    *
    * @param[in] image to use as effect texture