From: seungho baek Date: Mon, 25 Sep 2023 03:16:45 +0000 (+0900) Subject: Add VisualFactory.UsePrecompiledShader() X-Git-Tag: accepted/tizen/unified/20231205.024657~118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcfbbf07e02ef5b75c45e544ffbeeb156101ad26;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add VisualFactory.UsePrecompiledShader() Signed-off-by: seungho baek --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs b/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs index b7262ad..a9a3a08 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs @@ -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); } } } diff --git a/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs b/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs index 73bbfce..ab2a33a 100755 --- a/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs @@ -84,5 +84,22 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } + + /// + /// Compile the visual shader in advance. Afterwards, + /// when a visual using a new shader is requested, the pre-compiled shader is used. + /// + /// It is recommended that this method be called at the top of the application code. + /// + /// 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. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void UsePreCompiledShader() + { + Interop.VisualFactory.UsePreCompiledShader(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } } }