From e5f034908690ff2f8187dc7de872349e6e33af0d Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Wed, 18 Oct 2023 15:17:35 +0900 Subject: [PATCH] [NUI] Make AddFrameUpdateCallback with root view Previously, we can only add the root view of FrameUpdateCallback as root layer of window. Now let we add some API that user can set specific view for given FrameUpdateCallback will use. This API will be used when we want to optimize callback behaviour. Signed-off-by: Eunki, Hong --- src/Tizen.NUI/src/public/Window/Window.cs | 13 +++++++++++++ .../Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index 12eff27..3779dfe 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -2219,6 +2219,19 @@ namespace Tizen.NUI } /// + /// Add FrameUpdateCallback with root view. + /// FrameUpdateCallbackInterface can only detach Views under given view. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback, View rootView) + { + if(rootView != null) + { + frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, View.getCPtr(rootView)); + } + } + + /// /// Remove FrameUpdateCallback /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs index fe02d9a..80751c1 100644 --- a/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs +++ b/test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/FrameUpdateCallbackTest.cs @@ -540,7 +540,8 @@ namespace Tizen.NUI.Samples // Add frame callback on window. // OnUpdate callback of frameUpdateCallback will be called before every render frame. - window.AddFrameUpdateCallback(frameUpdateCallback); + // We can set root view what given frameUpdateCallback used + window.AddFrameUpdateCallback(frameUpdateCallback, controlView); // compute limit position the container could go. leftDirectionLimit = (float)window.Size.Width - (totalSize + (float)(INITIAL_POSITION)); -- 2.7.4