diff --git a/graphic/graphic_2d/native_drawing/drawing_region.h b/graphic/graphic_2d/native_drawing/drawing_region.h index 39eb09315f1966fd014b9e50d8220cb145a6eac9..688be735e32f9267b9b665950eea7aa99f61287b 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 @@ -102,6 +103,20 @@ OH_Drawing_Region* OH_Drawing_RegionCreate(void); */ bool OH_Drawing_RegionContains(OH_Drawing_Region* region, int32_t x, int32_t y); +/** + * @brief Determines if the area contains multiple rectangles. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param region Indicates the pointer to an OH_Drawing_Region object. + * @param contain Indicates whether the region contains multiple rectangles. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of region or contain is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RegionIsComplex(const OH_Drawing_Region* region, bool* contain); + /** * @brief Combines two regions. * @@ -115,6 +130,22 @@ bool OH_Drawing_RegionContains(OH_Drawing_Region* region, int32_t x, int32_t y); */ bool OH_Drawing_RegionOp(OH_Drawing_Region* region, const OH_Drawing_Region* other, OH_Drawing_RegionOpMode op); +/** + * @brief Determines whether rect and region does not intersect. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param region Indicates the pointer to an OH_Drawing_Region object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. + * @param res Indicates whether the rectangle does not intersect with the region. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of region, rect or res is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RegionQuickReject( + const OH_Drawing_Region* region, const OH_Drawing_Rect* rect, bool* res); + /** * @brief Sets the region to the specified rect. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index e81640a3fa4218b59fb9dc031eb4e7b90db2a47b..6bb72f5c087ab63ad0bd8c7abe8277cea979b3f8 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1106,10 +1106,18 @@ "first_introduced": "12", "name": "OH_Drawing_RegionContains" }, + { + "first_introduced": "14", + "name": "OH_Drawing_RegionIsComplex" + }, { "first_introduced": "12", "name": "OH_Drawing_RegionOp" }, + { + "first_introduced": "14", + "name": "OH_Drawing_RegionQuickReject" + }, { "first_introduced": "12", "name": "OH_Drawing_RegionSetPath"