Updated all header files to new format
[platform/core/uifw/dali-toolkit.git] / dali-scene-loader / public-api / renderer-state.h
index dc1bf63..f70100a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_RENDERER_STATE_H
 #define DALI_SCENE_LOADER_RENDERER_STATE_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -27,7 +27,6 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 /*
  * @brief Contains values for comparison functions used in depth and stencil testing.
  * @note Relative order of members must match DepthFunction::Type and StencilFunction::Type.
@@ -36,7 +35,7 @@ struct DALI_SCENE_LOADER_API Comparison
 {
   enum Type
   {
-    OMIT,  // not specified; will not be set.
+    OMIT, // not specified; will not be set.
     NEVER,
     ALWAYS,
     LESS,
@@ -58,13 +57,13 @@ struct DALI_SCENE_LOADER_API BlendFactor
 {
   enum Type
   {
-    OMIT,  // not specified - will not be updated
+    OMIT, // not specified - will not be updated
     ZERO,
-    ONE,  // default for source alpha
+    ONE, // default for source alpha
     SRC_COLOR,
     ONE_MINUS_SRC_COLOR,
-    SRC_ALPHA,  // default for source RGB
-    ONE_MINUS_SRC_ALPHA,  // default for destination RGB and destination alpha
+    SRC_ALPHA,           // default for source RGB
+    ONE_MINUS_SRC_ALPHA, // default for destination RGB and destination alpha
     DST_ALPHA,
     ONE_MINUS_DST_ALPHA,
     DST_COLOR,
@@ -87,12 +86,12 @@ struct DALI_SCENE_LOADER_API BufferMode
 {
   enum Type
   {
-    OMIT,  ///< not specified - will not be updated
-    NONE,  ///< Don’t write to either color or stencil buffer (But will potentially render to depth buffer).
-    AUTO,  ///< Writes are managed by the Actor Clipping API. This is DALi's default.
-    COLOR,  ///< Ignore stencil properties.  Write to the color buffer.
-    STENCIL,  ///< Use the stencil properties. Do not write to the color buffer.
-    COLOR_STENCIL  ///< Use the stencil properties AND Write to the color buffer.
+    OMIT,         ///< not specified - will not be updated
+    NONE,         ///< Don’t write to either color or stencil buffer (But will potentially render to depth buffer).
+    AUTO,         ///< Writes are managed by the Actor Clipping API. This is DALi's default.
+    COLOR,        ///< Ignore stencil properties.  Write to the color buffer.
+    STENCIL,      ///< Use the stencil properties. Do not write to the color buffer.
+    COLOR_STENCIL ///< Use the stencil properties AND Write to the color buffer.
   };
 
   BufferMode() = delete;
@@ -103,36 +102,35 @@ struct DALI_SCENE_LOADER_API BufferMode
  */
 namespace RendererState
 {
-
-using Type = uint32_t;  // 8 bits reserved for flags, 4 * 4 bit for blend factors, 4 bits for depth function
+using Type = uint32_t; // 8 bits reserved for flags, 4 * 4 bit for blend factors, 4 bits for depth function
 
 enum DALI_SCENE_LOADER_API Value : Type
 {
   NONE = 0x0,
 
   DEPTH_WRITE = 0x01,
-  DEPTH_TEST = 0x02,
+  DEPTH_TEST  = 0x02,
 
   CULL_FRONT = 0x04,
-  CULL_BACK = 0x08,
+  CULL_BACK  = 0x08,
 
   ALPHA_BLEND = 0x10,
 
   DEPTH_FUNCTION_SHIFT = 6,
-  DEPTH_FUNCTION_BITS = 4,
-  DEPTH_FUNCTION_MASK = ((1 << DEPTH_FUNCTION_BITS) - 1) << DEPTH_FUNCTION_SHIFT,
+  DEPTH_FUNCTION_BITS  = 4,
+  DEPTH_FUNCTION_MASK  = ((1 << DEPTH_FUNCTION_BITS) - 1) << DEPTH_FUNCTION_SHIFT,
 
   BLEND_FACTOR_BASE_SHIFT = DEPTH_FUNCTION_SHIFT + DEPTH_FUNCTION_BITS,
-  BLEND_FACTOR_ITEM_BITS = 4,
-  BLEND_FACTOR_ITEMS = 4,
-  BLEND_FACTOR_BITS = BLEND_FACTOR_ITEM_BITS * BLEND_FACTOR_ITEMS,
-  BLEND_FACTOR_MASK = ((1 << BLEND_FACTOR_BITS) - 1) << BLEND_FACTOR_BASE_SHIFT,
-  BLEND_FACTOR_ITEM_MASK = (1 << BLEND_FACTOR_ITEM_BITS) - 1,  // after rshifting by BLEND_FACTOR_BASE_SHIFT
+  BLEND_FACTOR_ITEM_BITS  = 4,
+  BLEND_FACTOR_ITEMS      = 4,
+  BLEND_FACTOR_BITS       = BLEND_FACTOR_ITEM_BITS * BLEND_FACTOR_ITEMS,
+  BLEND_FACTOR_MASK       = ((1 << BLEND_FACTOR_BITS) - 1) << BLEND_FACTOR_BASE_SHIFT,
+  BLEND_FACTOR_ITEM_MASK  = (1 << BLEND_FACTOR_ITEM_BITS) - 1, // after rshifting by BLEND_FACTOR_BASE_SHIFT
 
   // Buffer mode is DALi's RenderMode, just to avoid too much conflation.
-  BUFFER_MODE_BITS = 3u,
-  BUFFER_MODE_SHIFT = 32u - BUFFER_MODE_BITS,  // from end
-  BUFFER_MODE_MASK = ((1u << BUFFER_MODE_BITS) - 1u) << BUFFER_MODE_SHIFT,
+  BUFFER_MODE_BITS  = 3u,
+  BUFFER_MODE_SHIFT = 32u - BUFFER_MODE_BITS, // from end
+  BUFFER_MODE_MASK  = ((1u << BUFFER_MODE_BITS) - 1u) << BUFFER_MODE_SHIFT,
 
   DEFAULT = DEPTH_WRITE | DEPTH_TEST | CULL_BACK | (Comparison::LESS_EQUAL << DEPTH_FUNCTION_SHIFT),
 };
@@ -141,12 +139,11 @@ enum DALI_SCENE_LOADER_API Value : Type
  * @brief Encodes the given blend factors into a RenderMode value, maskable into other options,
  *  passable into ApplyRenderMode().
  */
-inline
-DALI_SCENE_LOADER_API constexpr uint32_t FromBlendFactors(BlendFactor::Type srcRgb, BlendFactor::Type destRgb,
-  BlendFactor::Type srcAlpha, BlendFactor::Type destAlpha)
+inline DALI_SCENE_LOADER_API constexpr uint32_t FromBlendFactors(BlendFactor::Type srcRgb, BlendFactor::Type destRgb, BlendFactor::Type srcAlpha, BlendFactor::Type destAlpha)
 {
   return (srcRgb | (destRgb << BLEND_FACTOR_ITEM_BITS) | (srcAlpha << (BLEND_FACTOR_ITEM_BITS * 2)) |
-    (destAlpha << (BLEND_FACTOR_ITEM_BITS * 3))) << BLEND_FACTOR_BASE_SHIFT;
+          (destAlpha << (BLEND_FACTOR_ITEM_BITS * 3)))
+         << BLEND_FACTOR_BASE_SHIFT;
 }
 
 /*
@@ -157,9 +154,9 @@ DALI_SCENE_LOADER_API constexpr uint32_t FromBlendFactors(BlendFactor::Type srcR
  */
 DALI_SCENE_LOADER_API void Apply(Type rendererState, Renderer& renderer);
 
-} // RendererState
+} // namespace RendererState
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_RENDERER_STATE_H