diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index f78e6127f9297b09d0a66a932d3fd2165787339b..0e24a1c7a34678a56c9d3e91b4c19bb3a90b66d6 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -841,6 +841,54 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasGetImageInfo(OH_Drawing_Canvas* canvas, OH * @version 1.0 */ OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmd(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); + +/** + * @brief Checks whether the canavs is support alpha. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param isOpaque Indicates if canvas is support alpha. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas or isOpaque is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasIsOpaque(OH_Drawing_Canvas* canvas, bool* isOpaque); + +/** + * @brief Checks if the path has been cut off. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param path Indicates the pointer to an OH_Drawing_Paht object. + * @param quickReject Indicates if the path has been cut off. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas or path is nullptr, + * or quickReject is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectByPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path, + bool* quickReject); + +/** + * @brief Checks if the rect has been cut off. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param rect Indicates the pointer to an OH_Drawing_Rect object. + * @param quickReject Indicates if the rect has been cut off. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas or rect is nullptr, + * or quickReject is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectByRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, + bool* quickReject); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h index d247e88f71502ebdfb0d2d2b03a4106768212004..fcbedcc2212dd357f245662a551878892afb8127 100644 --- a/graphic/graphic_2d/native_drawing/drawing_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_rect.h @@ -40,6 +40,7 @@ * @version 1.0 */ +#include "drawing_error_code.h" #include "drawing_types.h" #ifdef __cplusplus @@ -272,6 +273,22 @@ OH_Drawing_ErrorCode OH_Drawing_RectGetArrayElement(OH_Drawing_Array* rectArray, */ OH_Drawing_ErrorCode OH_Drawing_RectDestroyArray(OH_Drawing_Array* rectArray); +/** + * @brief Equals the original rectangular object to the destination rectangular object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param src Indicates the pointer to an OH_Drawing_Rect object. + * @param dst Indicates the pointer to an OH_Drawing_Rect object. + * @param rectEquals Indicates if other object is rect object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if src or dst is nullptr, + * or rectEquals is nullptr. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_RectEquals(OH_Drawing_Rect* src, OH_Drawing_Rect* dst, bool* rectEquals); + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f539771d30cdac90947de31c81c38d3c4d..ae310a0e98c1e1882fb7f1c8b2d819930cf10e62 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -1721,5 +1721,21 @@ { "first_introduced": "14", "name":"OH_Drawing_GetRunGlyphCount" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_CanvasIsOpaque" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_CanvasQuickRejectByPath" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_CanvasQuickRejectByRect" + }, + { + "first_introduced": "14", + "name":"OH_Drawing_RectEquals" } ] \ No newline at end of file