From: Seungho Baek Date: Tue, 27 May 2025 08:22:38 +0000 (+0900) Subject: [NUI] Add View.Ignored to optimize invisible Views in render thread X-Git-Tag: submit/tizen/20250529.051345~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18a7dd93aaa4f53b5e291cfc7f98c1a3f86abdf5;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add View.Ignored to optimize invisible Views in render thread Signed-off-by: Seungho Baek --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs index 410536412..379c73d8b 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Actor.cs @@ -92,6 +92,13 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_GetRelayoutSize")] public static extern float GetRelayoutSize(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_SetIgnored")] + public static extern void SetIgnored(global::System.Runtime.InteropServices.HandleRef actor, bool ignored); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_IsIgnored")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool IsIgnored(global::System.Runtime.InteropServices.HandleRef actor); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_SetPadding")] public static extern void SetPadding(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index fa588d25c..cbe105c89 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -7158,6 +7158,7 @@ namespace Tizen.NUI.BaseComponents { Object.InternalSetPropertyInt(SwigCPtr, Property.OffScreenRendering, (int)value); } + private OffScreenRenderingType GetInternalOffScreenRendering() { int temp = Object.InternalGetPropertyInt(SwigCPtr, Property.OffScreenRendering); @@ -7170,6 +7171,33 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// Gets of sets the flag to identify the View will be ignored or not. + /// If the View is marked as ignored, it will not be rendered and will be excluded from render thread computation. + /// So, the render thread properties like WorldPosition and WorldColor become inaccurate. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Ignored + { + set => SetInternalIgnored(value); + get => IsInternalIgnored(); + } + + private void SetInternalIgnored(bool ignored) + { + Interop.Actor.SetIgnored(SwigCPtr, ignored); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + private bool IsInternalIgnored() + { + bool isIgnored = Interop.Actor.IsIgnored(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return isIgnored; + } + private LayoutExtraData EnsureLayoutExtraData() { if (layoutExtraData == null)