Add VisualFactory.UsePrecompiledShader()
authorseungho baek <sbsh.baek@samsung.com>
Mon, 25 Sep 2023 03:16:45 +0000 (12:16 +0900)
committerJay Cho <chojoong@gmail.com>
Fri, 27 Oct 2023 02:30:53 +0000 (11:30 +0900)
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs
src/Tizen.NUI/src/public/Visuals/VisualFactory.cs

index b7262ad..a9a3a08 100755 (executable)
@@ -44,6 +44,9 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualFactory_CreateVisual__SWIG_2")]
             public static extern global::System.IntPtr CreateVisual(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualFactory_UsePreCompiledShader")]
+            public static extern void UsePreCompiledShader(global::System.Runtime.InteropServices.HandleRef jarg1);
         }
     }
 }
index 73bbfce..ab2a33a 100755 (executable)
@@ -84,5 +84,22 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
+
+        /// <summary>
+        /// Compile the visual shader in advance. Afterwards,
+        /// when a visual using a new shader is requested, the pre-compiled shader is used.
+        /// </summary>
+        /// <remarks> It is recommended that this method be called at the top of the application code.</remarks>
+        /// <remarks>
+        /// Using precompiled shaders is helpful when the application is complex and uses
+        /// many different styles of visual options. On the other hand,if most visuals are the same
+        /// and the application is simple, it may use memory unnecessarily or slow down the application launching speed.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void UsePreCompiledShader()
+        {
+            Interop.VisualFactory.UsePreCompiledShader(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
     }
 }