From f62bb2e78f509076b6b65d3a7298ac6bd6cf9429 Mon Sep 17 00:00:00 2001 From: wangweiyuan Date: Mon, 11 Aug 2025 16:05:58 +0800 Subject: [PATCH] clipShape Signed-off-by: wangweiyuan --- arkui/ace_engine/native/libace.ndk.json | 32 +++++++++ arkui/ace_engine/native/native_render.h | 87 +++++++++++++++++++++++++ 2 files changed, 119 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3c739a283d0..5a4c286a49a 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -4062,5 +4062,37 @@ { "first_introduced": "20", "name": "OH_ArkUI_PostUITaskAndWait" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_Create" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_Dispose" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_SetRadiusWidth" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_SetRadiusHeight" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_SetRadius" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_SetWidth" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_SetHeight" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RectShape_SetOffset" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_render.h b/arkui/ace_engine/native/native_render.h index d6ea4b1c332..bf5197fc211 100644 --- a/arkui/ace_engine/native/native_render.h +++ b/arkui/ace_engine/native/native_render.h @@ -1470,6 +1470,93 @@ void OH_ArkUI_RenderNodeUtils_DisposeColorAnimatableProperty(ArkUI_ColorAnimatab int32_t OH_ArkUI_RenderNodeUtils_SetContentModifierOnDraw(ArkUI_RenderContentModifierHandle modifier, void* userData, void (*callback)(ArkUI_DrawContext* context, void* userData)); +/** + * @brief creates the rect shape. + * + * @return Rect shape information. + * @since 20 + */ +ArkUI_RectShape* OH_ArkUI_RectShape_Create(void); + +/** + * @brief Destroys the rect shape. + * + * @param shape Pointer to the object by the RectShape to be destroyed. + * @since 20 + */ +void OH_ArkUI_RectShape_Dispose(ArkUI_RectShape* shape); + +/** + * @brief Set the radius width for the rect shape. The unit is vp. + * + * @param shape Indicates the pointer to the RectShape. + * @param width Indicates the radius width of the rect. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +int32_t OH_ArkUI_RectShape_SetRadiusWidth(ArkUI_RectShape* shape, float width); + +/** + * @brief Set the radius height for the rect shape. The unit is vp. + * + * @param shape Indicates the pointer to the RectShape. + * @param height Indicates the radius height of the rect. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +int32_t OH_ArkUI_RectShape_SetRadiusHeight(ArkUI_RectShape* shape, float height); + +/** + * @brief Set the radius for the rect shape. The unit is vp. + * + * @param shape Indicates the pointer to the RectShape. + * @param topLeft Indicates the topLeft radius of the rect. + * @param topRight Indicates the topRight radius of the rect. + * @param bottomLeft Indicates the bottomLeft radius of the rect. + * @param bottomRight Indicates the bottomRight radius of the rect. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +int32_t OH_ArkUI_RectShape_SetRadius(ArkUI_RectShape* shape, float topLeft, float topRight, + float bottomLeft, float bottomRight); + +/** + * @brief Set the width for the rect shape. The unit is vp. + * + * @param shape Indicates the pointer to the RectShape. + * @param width Indicates the width of the rect. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +int32_t OH_ArkUI_RectShape_SetWidth(ArkUI_RectShape* shape, float width); + +/** + * @brief Set the height for the rect shape. The unit is vp. + * + * @param shape Indicates the pointer to the RectShape. + * @param height Indicates the height of the rect. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +int32_t OH_ArkUI_RectShape_SetHeight(ArkUI_RectShape* shape, float height); + +/** + * @brief Set the offset for the rect shape. The unit is vp. + * + * @param shape Indicates the pointer to the RectShape. + * @param x Indicates the x-axis offset of the rect. + * @param y Indicates the y-axis offset of the rect. + * @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +int32_t OH_ArkUI_RectShape_SetOffset(ArkUI_RectShape* shape, float x, float y); + /** * @brief Create a RectShape option. * -- Gitee