diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn
index b15bd745a..35a379619 100644
--- a/graphic/graphic_2d/native_drawing/BUILD.gn
+++ b/graphic/graphic_2d/native_drawing/BUILD.gn
@@ -43,6 +43,7 @@ ohos_ndk_headers("native_drawing_header") {
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_round_rect.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_sampling_options.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_shader_effect.h",
+ "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_surface.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_blob.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_declaration.h",
@@ -84,6 +85,7 @@ ohos_ndk_library("libnative_drawing_ndk") {
"native_drawing/drawing_image.h",
"native_drawing/drawing_sampling_options.h",
"native_drawing/drawing_shader_effect.h",
+ "native_drawing/drawing_shadow_layer.h",
"native_drawing/drawing_surface.h",
"native_drawing/drawing_text_blob.h",
"native_drawing/drawing_text_declaration.h",
diff --git a/graphic/graphic_2d/native_drawing/drawing_brush.h b/graphic/graphic_2d/native_drawing/drawing_brush.h
index 74d09b503..98a50756b 100644
--- a/graphic/graphic_2d/native_drawing/drawing_brush.h
+++ b/graphic/graphic_2d/native_drawing/drawing_brush.h
@@ -143,6 +143,17 @@ void OH_Drawing_BrushSetAlpha(OH_Drawing_Brush*, uint8_t alpha);
*/
void OH_Drawing_BrushSetShaderEffect(OH_Drawing_Brush*, OH_Drawing_ShaderEffect*);
+/**
+ * @brief Sets the shadowLayer for a brush.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param OH_Drawing_Brush Indicates the pointer to an OH_Drawing_Brush object.
+ * @param OH_Drawing_ShadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object.
+ * @since 12
+ * @version 1.0
+ */
+void OH_Drawing_BrushSetShadowLayer(OH_Drawing_Brush*, OH_Drawing_ShadowLayer*);
+
/**
* @brief Sets the filter for a brush.
*
diff --git a/graphic/graphic_2d/native_drawing/drawing_pen.h b/graphic/graphic_2d/native_drawing/drawing_pen.h
index b3809f381..8d7f38726 100644
--- a/graphic/graphic_2d/native_drawing/drawing_pen.h
+++ b/graphic/graphic_2d/native_drawing/drawing_pen.h
@@ -280,6 +280,17 @@ void OH_Drawing_PenSetJoin(OH_Drawing_Pen*, OH_Drawing_PenLineJoinStyle);
*/
void OH_Drawing_PenSetShaderEffect(OH_Drawing_Pen*, OH_Drawing_ShaderEffect*);
+/**
+ * @brief Sets the shadowLayer for a pen.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param OH_Drawing_Pen Indicates the pointer to an OH_Drawing_Pen object.
+ * @param OH_Drawing_ShadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object.
+ * @since 12
+ * @version 1.0
+ */
+void OH_Drawing_PenSetShadowLayer(OH_Drawing_Pen*, OH_Drawing_ShadowLayer*);
+
/**
* @brief Sets the pathEffect for a pen.
*
diff --git a/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h b/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h
new file mode 100644
index 000000000..2100e2cb7
--- /dev/null
+++ b/graphic/graphic_2d/native_drawing/drawing_shadow_layer.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef C_INCLUDE_DRAWING_SHADOW_LAYER_H
+#define C_INCLUDE_DRAWING_SHADOW_LAYER_H
+
+/**
+ * @addtogroup Drawing
+ * @{
+ *
+ * @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ *
+ * @since 8
+ * @version 1.0
+ */
+
+/**
+ * @file drawing_shadow_layer.h
+ *
+ * @brief Declares functions related to the ShadowLayer object in the drawing module.
+ *
+ * @library libnative_drawing.so
+ * @since 12
+ * @version 1.0
+ */
+
+#include "drawing_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Creates an OH_Drawing_ShadowLayer object.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param blurRadius Indicates the blur radius of the shadow.
+ * @param x Indicates the offset point on x-axis.
+ * @param y Indicates the offset point on y-axis.
+ * @param color Indicates the shadow color.
+ * @return Returns the pointer to the OH_Drawing_ShadowLayer object created.
+ * @since 12
+ * @version 1.0
+ */
+OH_Drawing_ShadowLayer* OH_Drawing_ShadowLayerCreate(float blurRadius, float x, float y, uint32_t color);
+
+/**
+ * @brief Destroys an OH_Drawing_ShadowLayer object and reclaims the memory occupied by the object.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param OH_Drawing_ShadowLayer Indicates the pointer to an OH_Drawing_ShadowLayer object.
+ * @since 12
+ * @version 1.0
+ */
+void OH_Drawing_ShadowLayerDestroy(OH_Drawing_ShadowLayer*);
+
+#ifdef __cplusplus
+}
+#endif
+/** @} */
+#endif
diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h
index 70ca0a551..870a910b4 100644
--- a/graphic/graphic_2d/native_drawing/drawing_types.h
+++ b/graphic/graphic_2d/native_drawing/drawing_types.h
@@ -188,6 +188,14 @@ typedef struct OH_Drawing_Matrix OH_Drawing_Matrix;
*/
typedef struct OH_Drawing_ShaderEffect OH_Drawing_ShaderEffect;
+/**
+ * @brief Defines a shadowLayer, which is used to draw shaded parts.
+ *
+ * @since 12
+ * @version 1.0
+ */
+typedef struct OH_Drawing_ShadowLayer OH_Drawing_ShadowLayer;
+
/**
* @brief Defines a filter, which is used to store maskFilter and colorFilter.
*
diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
index 37980e97b..b2a73b331 100644
--- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
+++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
@@ -37,6 +37,10 @@
"name": "OH_Drawing_BrushGetFilter"
},
{ "name": "OH_Drawing_BrushSetShaderEffect" },
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_BrushSetShadowLayer"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_BrushReset"
@@ -302,6 +306,10 @@
"name": "OH_Drawing_PenGetFilter"
},
{ "name": "OH_Drawing_PenSetShaderEffect" },
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_PenSetShadowLayer"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_PenSetPathEffect"
@@ -412,6 +420,14 @@
"name": "OH_Drawing_ShaderEffectCreateImageShader"
},
{ "name": "OH_Drawing_ShaderEffectDestroy" },
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_ShadowLayerCreate"
+ },
+ {
+ "first_introduced": "12",
+ "name": "OH_Drawing_ShadowLayerDestroy"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_SurfaceCreateFromGpuContext"