From be7c7e044ee52749bf6dd21319aef8f5fb8ade50 Mon Sep 17 00:00:00 2001 From: liuwei793 Date: Mon, 14 Oct 2024 09:53:35 +0800 Subject: [PATCH] interface_sdk_c Signed-off-by: liuwei793 Change-Id: Id9652a8685a4b78d894eef360e5decdeafa43481 --- .../native_drawing/drawing_region.h | 31 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 8 +++++ 2 files changed, 39 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_region.h b/graphic/graphic_2d/native_drawing/drawing_region.h index 39eb09315..688be735e 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 e81640a3f..6bb72f5c0 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" -- Gitee