From: sunghyun kim Date: Wed, 21 Aug 2024 09:50:57 +0000 (+0900) Subject: [NUI] Add AddPrecompileShader() for adding precompile shader X-Git-Tag: submit/tizen/20240925.121854~1^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1052a9ae700d8936b4f9917040e6e57eee2183ee;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add AddPrecompileShader() for adding precompile shader --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs b/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs index 988953bf5..0be090072 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.VisualFactory.cs @@ -31,6 +31,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualFactory_CreateVisual__SWIG_0")] public static extern global::System.IntPtr CreateVisual(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VisualFactory_AddPrecompileShader")] + public static extern bool AddPrecompileShader(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [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 7fb9c8d04..0ca06449d 100755 --- a/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualFactory.cs @@ -136,5 +136,45 @@ namespace Tizen.NUI Interop.VisualFactory.UsePreCompiledShader(SwigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + + /// + /// Adds a list of pre-compiled shaders to the visual factory. + /// + /// + /// This API allows you to add the desired precompile shader to the list. + /// you can set it through PropertyMap. + /// you need to know the values for setting well to use them, so please refer to the explanation below. + /// + /// The property map consists of string keys. + /// + /// - shaderType: Set the desired shader type. we provides these type: "image","text","color","3d" and "custom" + /// - shaderOption(propertyMap): Set the desired shader option. we provides these flag: we provides a lot of shader options, so user need to check proper shader option. + /// - vertexShader: Set the vertext shader that user want. this is for custom shader. + /// - fragmentShader: Set the fragment shader that user want. this is for custom shader. + /// - shaderName: if user want to set shader name, use this. this is for custom shader.(optional) + /// + /// (example) + /// PropertyMap imageShader = new PropertyMap(); + /// imageShader.Add("shaderType", new PropertyValue("image")); + /// imageShader.Add("shaderOption", new PropertyValue(new PropertyMap().Add("ROUNDED_CORNER", new PropertyValue(true)) + /// .Add("MASKING", new PropertyValue(true)))); + /// + /// PropertyMap textShader = new PropertyMap(); + /// textShader.Add("shaderType", new PropertyValue("text")); + /// + /// VisualFactory.Instance.AddPrecompileShader(imageShader); + /// VisualFactory.Instance.AddPrecompileShader(textShader); + /// VisualFactory.Instance.UsePreCompiledShader(); + /// + /// The map contains the shader option for precompiling. + /// True if the pre-compiled shader is added, otherwise false. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool AddPrecompileShader(PropertyMap option) + { + bool result = false; + result = Interop.VisualFactory.AddPrecompileShader(SwigCPtr, PropertyMap.getCPtr(option)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } } }