diff --git a/graphic/graphic_2d/native_drawing/drawing_region.h b/graphic/graphic_2d/native_drawing/drawing_region.h index 39eb09315f1966fd014b9e50d8220cb145a6eac9..b84673138fc144f0c56995437c5446c4d1d70402 100644 --- a/graphic/graphic_2d/native_drawing/drawing_region.h +++ b/graphic/graphic_2d/native_drawing/drawing_region.h @@ -40,6 +40,7 @@ * @version 1.0 */ +#include "drawing_error_code.h" #include "drawing_types.h" #ifdef __cplusplus @@ -140,6 +141,20 @@ bool OH_Drawing_RegionSetRect(OH_Drawing_Region* region, const OH_Drawing_Rect* */ bool OH_Drawing_RegionSetPath(OH_Drawing_Region* region, const OH_Drawing_Path* path, const OH_Drawing_Region* clip); +/** + * @brief Determine whether the region is a rect with positive dimensional. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Region Indicates the pointer to an OH_Drawing_Region object. + * @param isRect Indicates if drawable area is empty. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if cRegion or isRect is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RegionIsRect(const OH_Drawing_Region* cRegion, bool* isRect); + /** * @brief Destroys an OH_Drawing_Region object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h index f3a6245c008d20e5a40266080094b6e5b49728bf..49247968bfecd373f79caca7725e4967bc077a53 100644 --- a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h @@ -224,6 +224,22 @@ OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(co float startRadius, const OH_Drawing_Point2D* endPt, float endRadius, const uint32_t* colors, const float* pos, uint32_t size, OH_Drawing_TileMode, const OH_Drawing_Matrix*); +/** + * @brief Creates an OH_Drawing_ShaderEffect that generates a blend shader by two shaders. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param dstShaderEffect Indicates the destination pointer to an OH_Drawing_ShaderEffect object. + * @param srcShaderEffect Indicates the source pointer to an OH_Drawing_ShaderEffect object. + * @param blendMode Indicates the center of the start circle for the gradient. + * @return Returns the pointer to the OH_Drawing_ShaderEffect object created. + * If nullptr is returned, the creation fails. + * The possible cause of the failure is any of dstShaderEffect and srcShaderEffect is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ShaderEffect* OH_Drawing_ShaderEffectCreateBlendShader(OH_Drawing_ShaderEffect* dstShaderEffect, + OH_Drawing_ShaderEffect* srcShaderEffect, OH_Drawing_BlendMode blendMode); +y /** * @brief Destroys an OH_Drawing_ShaderEffect object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 3f0f7905b62de328131d4b4575952e30497f76c1..2c97ca6576321a1e430d16b6ea1bc45af3124c71 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -663,6 +663,10 @@ "first_introduced": "12", "name": "OH_Drawing_ShaderEffectCreateTwoPointConicalGradient" }, + { + "first_introduced": "14", + "name": "OH_Drawing_ShaderEffectCreateBlendShader" + }, { "name": "OH_Drawing_ShaderEffectDestroy" }, { "first_introduced": "12", @@ -1146,6 +1150,10 @@ "first_introduced": "12", "name": "OH_Drawing_RegionSetPath" }, + { + "first_introduced": "14", + "name": "OH_Drawing_RegionIsRect" + }, { "first_introduced": "12", "name": "OH_Drawing_RegionDestroy"