From c0d0e195207b43a974e2689aff4ee2be08222401 Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Fri, 8 Nov 2024 18:03:07 +0800 Subject: [PATCH] =?UTF-8?q?pathEffect=E7=9B=B8=E5=85=B3ndk=E5=A4=B4?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: Ia96f9be1beec72442db911d9224d8ce44897e799 --- .../native_drawing/drawing_path_effect.h | 39 ++++++++++++++++++- .../native_drawing/libnative_drawing.ndk.json | 12 ++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h index b3260d576..6132bf173 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -69,6 +69,43 @@ OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect(float* intervals, int cou */ void OH_Drawing_PathEffectDestroy(OH_Drawing_PathEffect*); +/** + * @brief Creates an OH_Drawing_PathEffect object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param segLength Indicates the maximum segment length of the path. + * @param dev Indicates the deviation during drawing. + * @param seedAssist Indicates generate effect pseudo-random sequence, the default value is zero. + * @return Returns the pointer to the OH_Drawing_PathEffect object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_PathEffect* OH_Drawing_CreateDiscretePathEffect(float segLength, float dev, uint32_t seedAssist = 0); + +/** + * @brief Creates an OH_Drawing_PathEffect object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param radius Indicates the degree of curvature of the arc, + * the radius to use must be greater than 0 in order to take effect. + * @return Returns the pointer to the OH_Drawing_PathEffect object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_PathEffect* OH_Drawing_CreateCornerPathEffect(float radius); + +/** + * @brief Creates an OH_Drawing_PathEffect object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param outer Indicates an OH_Drawing_PathEffect object + * @param inner Indicates an OH_Drawing_PathEffect object + * @return Returns the pointer to the OH_Drawing_PathEffect object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_PathEffect* OH_Drawing_CreateComposePathEffect(OH_Drawing_PathEffect* outer, OH_Drawing_PathEffect* inner); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f53..a21c2d2be 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1721,5 +1721,17 @@ { "first_introduced": "14", "name":"OH_Drawing_GetRunGlyphCount" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_CreateDiscretePathEffect" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_CreateCornerPathEffect" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_CreateComposePathEffect" } ] \ No newline at end of file -- Gitee