diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h
index 521c93ec67a1c08f5ea97b344bd52bc35e5b8930..a393a1f2ad4f5a0d2e37c45ac83086f475b111ea 100644
--- a/graphic/graphic_2d/native_drawing/drawing_canvas.h
+++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h
@@ -404,6 +404,20 @@ typedef enum {
void OH_Drawing_CanvasClipRect(OH_Drawing_Canvas*, const OH_Drawing_Rect*,
OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias);
+/**
+ * @brief Clip a round rect.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object.
+ * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object.
+ * @param clipOp Indicates the operation to apply to clip.
+ * @param doAntiAlias Indicates whether clip operation requires anti-aliased.
+ * @since 12
+ * @version 1.0
+ */
+void OH_Drawing_CanvasClipRoundRect(OH_Drawing_Canvas*, const OH_Drawing_RoundRect*,
+ OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias);
+
/**
* @brief Clip a path.
*
diff --git a/graphic/graphic_2d/native_drawing/drawing_path.h b/graphic/graphic_2d/native_drawing/drawing_path.h
index 687bdf780d8f6b4088538e684b42ecc40090dfe1..d82a70df860cc5b61f39d9495791b9af6ba2ac5d 100644
--- a/graphic/graphic_2d/native_drawing/drawing_path.h
+++ b/graphic/graphic_2d/native_drawing/drawing_path.h
@@ -334,6 +334,18 @@ void OH_Drawing_PathAddRoundRect(OH_Drawing_Path*, const OH_Drawing_RoundRect* r
void OH_Drawing_PathAddOvalWithInitialPoint(OH_Drawing_Path*, const OH_Drawing_Rect*,
uint32_t start, OH_Drawing_PathDirection);
+/**
+ * @brief Adds a oval to the path, defined by the rect, and wound in the specified direction.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param OH_Drawing_Path Indicates the pointer to an OH_Drawing_Path object.
+ * @param OH_Drawing_Rect Indicates the pointer to an OH_Drawing_Rect object.
+ * @param OH_Drawing_PathDirection Indicates the path direction.
+ * @since 12
+ * @version 1.0
+ */
+void OH_Drawing_PathAddOval(OH_Drawing_Path*, const OH_Drawing_Rect*, OH_Drawing_PathDirection);
+
/**
* @brief Appends arc to path, as the start of new contour.Arc added is part of ellipse bounded by oval,
* from startAngle through sweepAngle. Both startAngle and sweepAngle are measured in degrees, where zero degrees
diff --git a/graphic/graphic_2d/native_drawing/drawing_round_rect.h b/graphic/graphic_2d/native_drawing/drawing_round_rect.h
index d17025de1e942b68ed937e34bc93f702081bc100..a31773a5ced7045d8b78e8ce11edc64688f1e5de 100644
--- a/graphic/graphic_2d/native_drawing/drawing_round_rect.h
+++ b/graphic/graphic_2d/native_drawing/drawing_round_rect.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
@@ -43,6 +43,31 @@
extern "C" {
#endif
+/**
+ * @brief Enumerates of corner radii position.
+ *
+ * @since 12
+ * @version 1.0
+ */
+typedef enum {
+ /**
+ * Index of top-left corner radii.
+ */
+ CORNER_POS_TOP_LEFT,
+ /**
+ * Index of top-right corner radii.
+ */
+ CORNER_POS_TOP_RIGHT,
+ /**
+ * Index of bottom-right corner radii.
+ */
+ CORNER_POS_BOTTOM_RIGHT,
+ /**
+ * Index of bottom-left corner radii.
+ */
+ CORNER_POS_BOTTOM_LEFT,
+} OH_Drawing_CornerPos;
+
/**
* @brief Creates an OH_Drawing_RoundRect object.
*
@@ -56,6 +81,30 @@ extern "C" {
*/
OH_Drawing_RoundRect* OH_Drawing_RoundRectCreate(const OH_Drawing_Rect*, float xRad, float yRad);
+/**
+ * @brief Sets the radiusX and radiusY for a specific corner position.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_Rect object.
+ * @param pos Indicates the corner radii position.
+ * @param OH_Drawing_Corner_Radii Indicates the corner radii on x-axis and y-axis.
+ * @since 12
+ * @version 1.0
+ */
+void OH_Drawing_RoundRectSetCorner(OH_Drawing_RoundRect*, OH_Drawing_CornerPos pos, OH_Drawing_Corner_Radii);
+
+/**
+ * @brief Gets an OH_Drawing_Corner_Radii struct, the point is round corner radiusX and radiusY.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param OH_Drawing_RoundRect Indicates the pointer to an OH_Drawing_RoundRect object.
+ * @param pos Indicates the corner radii position.
+ * @return Returns the corner radii of OH_Drawing_Corner_Radii struct.
+ * @since 12
+ * @version 1.0
+ */
+OH_Drawing_Corner_Radii OH_Drawing_RoundRectGetCorner(OH_Drawing_RoundRect*, OH_Drawing_CornerPos pos);
+
/**
* @brief Destroys an OH_Drawing_RoundRect object and reclaims the memory occupied by the object.
*
diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h
index 1d544bec9a032f7488443baa697a118a4ddc5fd0..ef9c7d5d1b85fb7e0d7bd6b1b02fe88aa2282c66 100644
--- a/graphic/graphic_2d/native_drawing/drawing_types.h
+++ b/graphic/graphic_2d/native_drawing/drawing_types.h
@@ -120,6 +120,14 @@ typedef struct {
float y;
} OH_Drawing_Point2D;
+/**
+ * @brief Defines a corner radii, which is on x-axis and y-axis.
+ *
+ * @since 12
+ * @version 1.0
+ */
+typedef OH_Drawing_Point2D OH_Drawing_Corner_Radii;
+
/**
* @brief Defines a point of 3d, which is used to describe the coordinate point.
*
diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
index 4279a87c253f0d9d807fc7e76c6c48ca6bdc270b..020bfd802d854c8418e134b65ec409b69c3973a0 100644
--- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
+++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
@@ -85,6 +85,10 @@
"name": "OH_Drawing_CanvasDrawImageRectWithSrc"
},
{ "name": "OH_Drawing_CanvasClipRect" },
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_CanvasClipRoundRect"
+ },
{ "name": "OH_Drawing_CanvasClipPath" },
{ "name": "OH_Drawing_CanvasRotate" },
{ "name": "OH_Drawing_CanvasTranslate" },
@@ -246,6 +250,10 @@
"first_introduced": "12",
"name": "OH_Drawing_PathGetLength"
},
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_PathAddOval"
+ },
{ "name": "OH_Drawing_PathContains" },
{ "name": "OH_Drawing_PathTransform" },
{
@@ -365,6 +373,14 @@
},
{ "name": "OH_Drawing_RectDestroy" },
{ "name": "OH_Drawing_RoundRectCreate" },
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_RoundRectGetCorner"
+ },
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_RoundRectSetCorner"
+ },
{ "name": "OH_Drawing_RoundRectDestroy" },
{ "name": "OH_Drawing_SetTextStyleColor" },
{ "name": "OH_Drawing_SetTextStyleFontSize" },