From 804655c8775f6f3877eeb940a2921235a8db8925 Mon Sep 17 00:00:00 2001 From: zoulinken Date: Mon, 20 Jan 2025 17:02:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?postIdleCallback=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=8A=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoulinken --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ arkui/ace_engine/native/native_node_napi.h | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 2543c34aa..8a8ed7b11 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2603,6 +2603,10 @@ "first_introduced": "16", "name": "OH_ArkUI_PostFrameCallback" }, + { + "first_introduced": "16", + "name": "OH_ArkUI_PostIdleCallback" + }, { "first_introduced": "16", "name": "OH_ArkUI_HostWindowInfo_GetName" diff --git a/arkui/ace_engine/native/native_node_napi.h b/arkui/ace_engine/native/native_node_napi.h index bba66d373..2737d4b6b 100644 --- a/arkui/ace_engine/native/native_node_napi.h +++ b/arkui/ace_engine/native/native_node_napi.h @@ -374,6 +374,26 @@ ArkUI_ErrorCode OH_ArkUI_GetRouterPageId( int32_t OH_ArkUI_PostFrameCallback(ArkUI_ContextHandle uiContext, void* userData, void (*callback)(uint64_t nanoTimestamp, uint32_t frameCount, void* userData)); +/** + * @brief Register a callback to be executed at the end of the next idle frame. + * If there is no next frame, will request one automatically. + * + * @param uiContext ArkUI_ContextHandle. + * @param userData Indicates the custom data to be saved. + * @param callback Custom callback function. + * @param nanoTimestamp Timestamp of frame signal. + * @param frameCount Frame count. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is + * successful. Returns {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init + * error. Returns {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext + * is invalid. Returns {@link ARKUI_ERROR_CODE_CALLBACK_INVALID} if the callback + * function is invalid. + * @since 16 + */ +int32_t OH_ArkUI_PostIdleCallback(ArkUI_ContextHandle uiContext, void* userData, + void (*callback)(uint64_t nanoTimestamp, uint32_t frameCount, void* userData)); + #ifdef __cplusplus }; #endif -- Gitee From 27c268d042f3b65204865958d0c0bcac62975f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=9E=97=E8=82=AF?= <735001321@qq.com> Date: Fri, 28 Feb 2025 07:14:22 +0000 Subject: [PATCH 2/4] update arkui/ace_engine/native/libace.ndk.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹林肯 <735001321@qq.com> --- arkui/ace_engine/native/libace.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 2afeb5da0..8a1fbc5c1 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2848,7 +2848,7 @@ "name": "OH_ArkUI_PostIdleCallback" }, { - "first_introduced": "16", + "first_introduced": "15", "name": "OH_ArkUI_HostWindowInfo_GetName" }, { -- Gitee From 1be11312e299f10373a09befe102260d8110eb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=9E=97=E8=82=AF?= <735001321@qq.com> Date: Sat, 1 Mar 2025 10:42:24 +0000 Subject: [PATCH 3/4] update arkui/ace_engine/native/native_node_napi.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹林肯 <735001321@qq.com> --- arkui/ace_engine/native/native_node_napi.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arkui/ace_engine/native/native_node_napi.h b/arkui/ace_engine/native/native_node_napi.h index 2737d4b6b..1fd73c7a4 100644 --- a/arkui/ace_engine/native/native_node_napi.h +++ b/arkui/ace_engine/native/native_node_napi.h @@ -381,18 +381,17 @@ int32_t OH_ArkUI_PostFrameCallback(ArkUI_ContextHandle uiContext, void* userData * @param uiContext ArkUI_ContextHandle. * @param userData Indicates the custom data to be saved. * @param callback Custom callback function. - * @param nanoTimestamp Timestamp of frame signal. + * @param nanoTimeLeft The remaining time from the deadline for this frame. * @param frameCount Frame count. * @return Returns the result code. - * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is - * successful. Returns {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init - * error. Returns {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext - * is invalid. Returns {@link ARKUI_ERROR_CODE_CALLBACK_INVALID} if the callback - * function is invalid. - * @since 16 + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init error. + * Returns {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext is invalid. + * Returns {@link ARKUI_ERROR_CODE_CALLBACK_INVALID} if the callback function is invalid. + * @since 17 */ int32_t OH_ArkUI_PostIdleCallback(ArkUI_ContextHandle uiContext, void* userData, - void (*callback)(uint64_t nanoTimestamp, uint32_t frameCount, void* userData)); + void (*callback)(uint64_t nanoTimeLeft, uint32_t frameCount, void* userData)); #ifdef __cplusplus }; -- Gitee From 7deb987feb3093158192895078f9de34a74e2a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=9E=97=E8=82=AF?= <735001321@qq.com> Date: Sat, 1 Mar 2025 10:48:57 +0000 Subject: [PATCH 4/4] update arkui/ace_engine/native/libace.ndk.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹林肯 <735001321@qq.com> --- arkui/ace_engine/native/libace.ndk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 8a1fbc5c1..4d37e1759 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2844,7 +2844,7 @@ "name": "OH_ArkUI_PostFrameCallback" }, { - "first_introduced": "16", + "first_introduced": "17", "name": "OH_ArkUI_PostIdleCallback" }, { -- Gitee