Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / rendering / shader.h
index 36e9f23..f20c707 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SHADER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -75,7 +75,6 @@ class Shader;
 class DALI_CORE_API Shader : public Handle
 {
 public:
-
   /**
    * @brief Hints for rendering.
    * @SINCE_1_1.45
@@ -88,9 +87,9 @@ public:
      */
     enum Value
     {
-      NONE                     = 0x00, ///< No hints                                                                          @SINCE_1_1.45
-      OUTPUT_IS_TRANSPARENT    = 0x01, ///< Might generate transparent alpha from opaque inputs                               @SINCE_1_1.45
-      MODIFIES_GEOMETRY        = 0x02, ///< Might change position of vertices, this option disables any culling optimizations @SINCE_1_1.45
+      NONE                  = 0x00, ///< No hints                                                                          @SINCE_1_1.45
+      OUTPUT_IS_TRANSPARENT = 0x01, ///< Might generate transparent alpha from opaque inputs                               @SINCE_1_1.45
+      MODIFIES_GEOMETRY     = 0x02, ///< Might change position of vertices, this option disables any culling optimizations @SINCE_1_1.45
     };
   };
 
@@ -125,9 +124,9 @@ public:
    * @param[in] hints Hints to define the geometry of the rendered object
    * @return A handle to a shader effect
    */
-  static Shader New( const std::string& vertexShader,
-                     const std::string& fragmentShader,
-                     Hint::Value hints = Hint::NONE );
+  static Shader New(const std::string& vertexShader,
+                    const std::string& fragmentShader,
+                    Hint::Value        hints = Hint::NONE);
 
   /**
    * @brief Default constructor, creates an empty handle.
@@ -150,7 +149,7 @@ public:
    * @SINCE_1_1.43
    * @param[in] handle A handle to a Shader object
    */
-  Shader( const Shader& handle );
+  Shader(const Shader& handle);
 
   /**
    * @brief Downcasts to a shader handle.
@@ -160,7 +159,7 @@ public:
    * @param[in] handle Handle to an object
    * @return Shader handle or an uninitialized handle
    */
-  static Shader DownCast( BaseHandle handle );
+  static Shader DownCast(BaseHandle handle);
 
   /**
    * @brief Assignment operator, changes this handle to point at the same object.
@@ -169,17 +168,60 @@ public:
    * @param[in] handle Handle to an object
    * @return Reference to the assigned object
    */
-  Shader& operator=( const Shader& handle );
+  Shader& operator=(const Shader& handle);
 
-public:
+  /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   */
+  Shader(Shader&& rhs);
 
   /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.22
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this
+   */
+  Shader& operator=(Shader&& rhs);
+
+  /**
+   * @brief Get shader preprocessor of shading language version.
+   * @note This can potentially block until GL has been initialized
+   * when the first time any DALi application is launched in the system.
+   * @SINCE_1_9.36
+   * @return shader preprocessor string.
+   */
+  static std::string GetShaderVersionPrefix();
+
+  /**
+   * @brief Get vertex shader preprocessor that includes shading language version.
+   * @note This can potentially block until GL has been initialized
+   * when the first time any DALi application is launched in the system.
+   * @SINCE_1_9.36
+   * @return Vertex shader preprocessor string.
+   */
+  static std::string GetVertexShaderPrefix();
+
+  /**
+   * @brief Get fragment shader preprocessor that includes shading language version.
+   * @note This can potentially block until GL has been initialized
+   * when the first time any DALi application is launched in the system.
+   * @SINCE_1_9.36
+   * @return Fragment shader preprocessor string.
+   */
+  static std::string GetFragmentShaderPrefix();
+
+public:
+  /**
    * @brief This constructor is used by Dali New() methods.
    * @note  Not intended for application developers.
    * @SINCE_1_1.43
    * @param[in] effect A pointer to a newly allocated Dali resource.
    */
-  explicit DALI_INTERNAL Shader( Internal::Shader* effect );
+  explicit DALI_INTERNAL Shader(Internal::Shader* effect);
 };
 
 /**