diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn
index 88c0459bc9fd316e2be057729c6e97d9081011e3..1252a4a4b51adae78c8f86d1799ef50d7f591bae 100644
--- a/graphic/graphic_2d/native_drawing/BUILD.gn
+++ b/graphic/graphic_2d/native_drawing/BUILD.gn
@@ -36,6 +36,7 @@ ohos_ndk_headers("native_drawing_header") {
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_memory_stream.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path_effect.h",
+ "//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path_iterator.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_pen.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_pixel_map.h",
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_point.h",
@@ -83,6 +84,7 @@ ohos_ndk_library("libnative_drawing_ndk") {
"native_drawing/drawing_memory_stream.h",
"native_drawing/drawing_path.h",
"native_drawing/drawing_path_effect.h",
+ "native_drawing/drawing_path_iterator.h",
"native_drawing/drawing_pen.h",
"native_drawing/drawing_pixel_map.h",
"native_drawing/drawing_point.h",
diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h
index 5a1de3d15178dd34fe9ac8739c6dab0e22ec87ba..2426dc68a265fe4eebc52b78ad36f64c1b8a1eaf 100644
--- a/graphic/graphic_2d/native_drawing/drawing_canvas.h
+++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h
@@ -399,6 +399,25 @@ void OH_Drawing_CanvasDrawOval(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect*
void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas* canvas,
const OH_Drawing_Rect* rect, float startAngle, float sweepAngle);
+/**
+ * @brief Draws an arc with use center.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cCanvas Indicates the pointer to an OH_Drawing_Canvas object.
+ * @param cRect Indicates the pointer to an OH_Drawing_Rect object.
+ * @param startAngle Indicates the startAngle of the arc.
+ * @param sweepAngle Indicates the sweepAngle of the arc.
+ * @param useCenter If true, include the center of the oval in the arc, and close it if it is being stroked.
+ * This will draw a wedge.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if cCanvas or cRect is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_CanvasDrawArcWithCenter(OH_Drawing_Canvas* cCanvas, const OH_Drawing_Rect* cRect,
+ float startAngle, float sweepAngle, bool useCenter);
+
/**
* @brief Draws a roundrect.
*
@@ -410,6 +429,23 @@ void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas* canvas,
*/
void OH_Drawing_CanvasDrawRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* roundRect);
+/**
+ * @brief Draw two nested rounded rectangles.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cCanvas Indicates the pointer to an OH_Drawing_Canvas object.
+ * @param outer Rounded rectangle object, representing the outer rounded rectangle boundary.
+ * @param inner Rounded rectangle object, representing the internal rounded rectangle boundary.
+ * @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 cCanvas, outer
+ * and inner is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_CanvasDrawNestedRoundRect(OH_Drawing_Canvas* cCanvas, const OH_Drawing_RoundRect* outer,
+ const OH_Drawing_RoundRect* inner);
+
/**
* @brief Draws a single character.
*
@@ -844,6 +880,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_matrix.h b/graphic/graphic_2d/native_drawing/drawing_matrix.h
index bbf6645dfaf5910f121f92fbe67eac5150aa0eb0..f8ccd8006e2f3e16667bc2301742dea33e182221 100644
--- a/graphic/graphic_2d/native_drawing/drawing_matrix.h
+++ b/graphic/graphic_2d/native_drawing/drawing_matrix.h
@@ -223,6 +223,40 @@ void OH_Drawing_MatrixPreRotate(OH_Drawing_Matrix* matrix, float degree, float p
*/
void OH_Drawing_MatrixPreScale(OH_Drawing_Matrix* matrix, float sx, float sy, float px, float py);
+/**
+ * @brief Sets Matrix to Matrix multiplied by Matrix constructed from skewing by (kx, ky)
+ * about a pivot point at (px, py).
+ * Given:
+ *
+ * | A B C | | 1 kx dx |
+ * Matrix =| D E F |, K(kx, ky, px, py) = | ky 1 dy |
+ * | G H I | | 0 0 1 |
+ *
+ * where:
+ *
+ * dx = -kx * py
+ * dy = -ky * px
+ *
+ * sets Matrix to:
+ *
+ * | A B C | | 1 kx dx | | A+B*ky A*kx+B A*dx+B*dy+C |
+ * Matrix * K(kx, ky, px, py) = | D E F | | ky 1 dy | = | D+E*ky D*kx+E D*dx+E*dy+F |
+ * | G H I | | 0 0 1 | | G+H*ky G*kx+H G*dx+H*dy+I |
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cMatrix Indicates the pointer to an OH_Drawing_Matrix object.
+ * @param kx Horizontal skew factor.
+ * @param ky Vertical skew factor.
+ * @param px Pivot on x-axis.
+ * @param py Pivot on y-axis.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if matrix is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_MatrixPreSkew(OH_Drawing_Matrix* cMatrix, float kx, float ky, float px, float py);
+
/**
* @brief Sets forward matrix to translate by dx and dy.
* Given:
@@ -300,6 +334,37 @@ void OH_Drawing_MatrixPostRotate(OH_Drawing_Matrix* matrix, float degree, float
*/
void OH_Drawing_MatrixPostScale(OH_Drawing_Matrix* matrix, float sx, float sy, float px, float py);
+/**
+ * @brief Sets Matrix to Matrix constructed from skewing by (kx, ky) about pivot point
+ * (px, py), multiplied by Matrix.
+ * Given:
+ *
+ * | J K L | | 1 kx dx |
+ * Matrix =| M N O |, K(kx, ky, px, py) = | ky 1 dy |
+ * | P Q R | | 0 0 1 |
+ *
+ * where:
+ *
+ * dx = -kx * py
+ * dy = -ky * px
+ *
+ * sets Matrix to:
+ *
+ * | 1 kx dx| |J K L| |J+kx*M+dx*P K+kx*N+dx*Q L+kx*O+dx+R|
+ * K(kx, ky, px, py) * Matrix = |ky 1 dy| |M N O| = |ky*J+M+dy*P ky*K+N+dy*Q ky*L+O+dy*R|
+ * | 0 0 1| |P Q R| | P Q R|
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cMatrix Indicates the pointer to an OH_Drawing_Matrix object.
+ * @param kx Horizontal skew factor.
+ * @param ky Vertical skew factor.
+ * @param px Pivot on x-axis.
+ * @param py Pivot on y-axis.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_MatrixPostSkew(OH_Drawing_Matrix* cMatrix, float kx, float ky, float px, float py);
+
/**
* @brief Sets backward matrix to translate by (dx, dy).
* Given:
@@ -464,6 +529,22 @@ bool OH_Drawing_MatrixSetPolyToPoly(OH_Drawing_Matrix* matrix, const OH_Drawing_
void OH_Drawing_MatrixMapPoints(const OH_Drawing_Matrix* matrix, const OH_Drawing_Point2D* src,
OH_Drawing_Point2D* dst, int count);
+/**
+ * @brief A circle with radius radius is constructed using the matrix mapping, and the average radius is returned.
+ * The result squared is equal to the major axis length times the minor axis length.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cMatrix Indicates the pointer to an OH_Drawing_Matrix object.
+ * @param radius Indicates the pointer to radius of a circle.
+ * @param radiusDst Average mapped radius.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if matrix or radiusDst is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_MatrixMapRadius(const OH_Drawing_Matrix* cMatrix, float radius, float* radiusDst);
+
/**
* @brief Sets dst to bounds of src corners mapped by matrix transformation.
*
diff --git a/graphic/graphic_2d/native_drawing/drawing_path.h b/graphic/graphic_2d/native_drawing/drawing_path.h
index 3cc9269c9d8b50f10f255b4f0d108c62e9c4b8aa..996d013fa053d848eda5b182b9ff85dc060b0b8d 100644
--- a/graphic/graphic_2d/native_drawing/drawing_path.h
+++ b/graphic/graphic_2d/native_drawing/drawing_path.h
@@ -40,6 +40,7 @@
#ifndef C_INCLUDE_DRAWING_PATH_H
#define C_INCLUDE_DRAWING_PATH_H
+#include "drawing_error_code.h"
#include "drawing_types.h"
#ifdef __cplusplus
@@ -682,6 +683,20 @@ bool OH_Drawing_PathOp(OH_Drawing_Path* path, const OH_Drawing_Path* other, OH_D
bool OH_Drawing_PathGetMatrix(OH_Drawing_Path* path, bool forceClosed,
float distance, OH_Drawing_Matrix* matrix, OH_Drawing_PathMeasureMatrixFlags flag);
+/**
+ * @brief Get pathIterator from path.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param path Indicates the pointer to an OH_Drawing_Path object.
+ * @param iter Indicates the pointer to an OH_Drawing_PathIterator object.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if path or iter is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PathGetPathIterator(OH_Drawing_Path* path, OH_Drawing_PathIterator* iter);
+
#ifdef __cplusplus
}
#endif
diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h
index 7576c2500775c362b6a4c3c8cc7e72710ddff468..1a9465df4bf2c8df1b303e4edd7815cf09f5779c 100644
--- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h
+++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h
@@ -46,6 +46,21 @@
extern "C" {
#endif
+/**
+ * @brief Enumerate path effect types.
+ *
+ * @since 14
+ * @version 1.0
+ */
+typedef enum {
+ /** Indicates that the path effect is a translation effect. */
+ PATH_EFFECT_TRANSLATE,
+ /** Indicates that the path effect is a rotation effect. */
+ PATH_EFFECT_ROTATE,
+ /** Indicates that the path effect is a morph effect. */
+ PATH_EFFECT_MORPH,
+} OH_Drawing_PathEffectType;
+
/**
* @brief Creates an OH_Drawing_PathEffect object.
*
@@ -59,6 +74,34 @@ extern "C" {
*/
OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect(float* intervals, int count, float phase);
+/**
+ * @brief Creates an OH_Drawing_PathEffect object and sets the path effect to a dash effect.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param path Indicates the pointer to an OH_Drawing_Path object.
+ * @param advance Indicates the distance between the dashed segments.
+ * @param phase Indicates the offset into intervals array.
+ * @param type Indicates the type of the path effect.
+ * @return Returns the pointer to the OH_Drawing_PathEffect object created.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_PathEffect* OH_Drawing_CreatePathDashEffect(const OH_Drawing_Path* path, float advance, float phase,
+ OH_Drawing_PathEffectType type);
+
+/**
+ * @brief Creates an OH_Drawing_PathEffect object and sum the path effect.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param pathEffectOne Indicates the pointer to an OH_Drawing_PathEffect object.
+ * @param pathEffectTwo Indicates the pointer to an OH_Drawing_PathEffect object.
+ * @return Returns the pointer to the OH_Drawing_PathEffect object created.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_PathEffect* OH_Drawing_CreateSumPathEffect(OH_Drawing_PathEffect* pathEffectOne,
+ OH_Drawing_PathEffect* pathEffectTwo);
+
/**
* @brief Destroys an OH_Drawing_PathEffect object and reclaims the memory occupied by the object.
*
@@ -69,6 +112,43 @@ OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect(float* intervals, int cou
*/
void OH_Drawing_PathEffectDestroy(OH_Drawing_PathEffect* pathEffect);
+/**
+ * @brief Creates an OH_Drawing_PathEffect object.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param segLength Indicates the maximum segment length of the path.
+ * @param dev Indicates the deviation during drawing.
+ * @param seedAssist Indicates generate effect pseudo-random sequence, the default value is zero.
+ * @return Returns the pointer to the OH_Drawing_PathEffect object created.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_PathEffect* OH_Drawing_CreateDiscretePathEffect(float segLength, float dev, uint32_t seedAssist = 0);
+
+/**
+ * @brief Creates an OH_Drawing_PathEffect object.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param radius Indicates the degree of curvature of the arc,
+ * the radius to use must be greater than 0 in order to take effect.
+ * @return Returns the pointer to the OH_Drawing_PathEffect object created.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_PathEffect* OH_Drawing_CreateCornerPathEffect(float radius);
+
+/**
+ * @brief Creates an OH_Drawing_PathEffect object.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param outer Indicates an OH_Drawing_PathEffect object
+ * @param inner Indicates an OH_Drawing_PathEffect object
+ * @return Returns the pointer to the OH_Drawing_PathEffect object created.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_PathEffect* OH_Drawing_CreateComposePathEffect(OH_Drawing_PathEffect* outer, OH_Drawing_PathEffect* inner);
+
#ifdef __cplusplus
}
#endif
diff --git a/graphic/graphic_2d/native_drawing/drawing_path_iterator.h b/graphic/graphic_2d/native_drawing/drawing_path_iterator.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8867f94fa82e10d1f1af73996d430d34a7b73ba
--- /dev/null
+++ b/graphic/graphic_2d/native_drawing/drawing_path_iterator.h
@@ -0,0 +1,155 @@
+/*
+ * 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.
+ */
+
+/**
+ * @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_path_iterator.h
+ *
+ * @brief Declares functions related to the pathiterator object in the drawing module.
+ *
+ * @kit ArkGraphics2D
+ * @library libnative_drawing.so
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @since 14
+ * @version 1.0
+ */
+
+#ifndef C_INCLUDE_DRAWING_PATH_ITERATOR_H
+#define C_INCLUDE_DRAWING_PATH_ITERATOR_H
+
+#include "drawing_error_code.h"
+#include "drawing_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Types of operation for the path.
+ *
+ * @since 14
+ * @version 1.0
+ */
+typedef enum {
+ /** move operation */
+ PATHITERATOR_VERB_MOVE,
+ /** line operation */
+ PATHITERATOR_VERB_LINE,
+ /** quad operation */
+ PATHITERATOR_VERB_QUAD,
+ /** conic operation */
+ PATHITERATOR_VERB_CONIC,
+ /** cubic operation */
+ PATHITERATOR_VERB_CUBIC,
+ /** close operation */
+ PATHITERATOR_VERB_CLOSE,
+ /** all operations done */
+ PATHITERATOR_VERB_DONE = PATHITERATOR_VERB_CLOSE + 1
+} OH_Drawing_PathIteratorVerb;
+
+/**
+ * @brief Creates an OH_Drawing_PathIterator object.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @return Returns the pointer to the OH_Drawing_PathIterator object created.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_PathIterator* OH_Drawing_PathIteratorCreate(void);
+
+/**
+ * @brief Creates an OH_Drawing_PathIterator object with path.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param path Indicates the pointer to an OH_Drawing_Path object.
+ * @return Returns the pointer to the OH_Drawing_PathIterator object created.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_PathIterator* OH_Drawing_PathIteratorCreateWithPath(OH_Drawing_Path* path);
+
+/**
+ * @brief Destroys an OH_Drawing_PathIterator object and reclaims the memory occupied by the object.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param iter Indicates the pointer to an OH_Drawing_PathIterator object.
+ * @since 14
+ * @version 1.0
+ */
+void OH_Drawing_PathIteratorDestroy(OH_Drawing_PathIterator* iter);
+
+/**
+ * @brief Get next verb in this iterator's path, and fill entries in the point2D array
+ * with point data (if any) for that operation, the point2D array size must be 4 or more.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param iter Indicates the pointer to an OH_Drawing_PathIterator object.
+ * @param points Indicates the pointer to an OH_Drawing_Point2D object.
+ * @param count Indicates the array size of the point2D, not less than offset plus 4.
+ * @param verb Indicates the next verb in this iterator's path.
+ * @param offset Indicates offset into the array where entries should be placed.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if count < offect + 4, iter, points or verb is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PathIteratorNext(OH_Drawing_PathIterator* iter,
+ OH_Drawing_Point2D* points, const uint32_t count, OH_Drawing_PathIteratorVerb* verb, int offset);
+
+/**
+ * @brief Get the next verb in the iteration, or PATHITERATOR_VERB_DONE if there are no more elements.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param iter Indicates the pointer to an OH_Drawing_PathIterator object.
+ * @param verb Indicates the next verb in the iteration.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if iter or verb is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PathIteratorPeek(OH_Drawing_PathIterator* iter, OH_Drawing_PathIteratorVerb* verb);
+
+/**
+ * @brief The determine if there are still elements in the iterator.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param iter Indicates the pointer to an OH_Drawing_PathIterator object.
+ * @param hasNext Indicates the determine if there are still elements in the iterator.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if iter is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PathIteratorHasNext(OH_Drawing_PathIterator* iter, bool* hasNext);
+
+#ifdef __cplusplus
+}
+#endif
+/** @} */
+#endif
\ No newline at end of file
diff --git a/graphic/graphic_2d/native_drawing/drawing_point.h b/graphic/graphic_2d/native_drawing/drawing_point.h
index d3c8f5a46109bef056ca5279f887575386e2bb1e..ef066acadaff42df85b38346989eda9ce5661705 100644
--- a/graphic/graphic_2d/native_drawing/drawing_point.h
+++ b/graphic/graphic_2d/native_drawing/drawing_point.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023 Huawei Device Co., Ltd.
+ * Copyright (c) 2023-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
@@ -102,6 +102,65 @@ OH_Drawing_ErrorCode OH_Drawing_PointGetY(const OH_Drawing_Point* point, float*
*/
OH_Drawing_ErrorCode OH_Drawing_PointSet(OH_Drawing_Point* point, float x, float y);
+/**
+ * @brief Indicates whether firstPoint are equal to secondPoint.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param firstPoint Indicates the pointer to an OH_Drawing_Point object.
+ * @param secondPoint Indicates the pointer to an OH_Drawing_Point object.
+ * @param isEqual Indicates whether firstPoint and secondPoint are equal.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if firstPoint or secondPoint is nullptr,
+ * or isEqual is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PointEquals(
+ const OH_Drawing_Point *firstPoint, const OH_Drawing_Point *secondPoint, bool *isEqual);
+
+/**
+ * @brief Offset the coordinates of the point.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param point Indicates the pointer to an OH_Drawing_Point object.
+ * @param x Indicates the x offset of the point.
+ * @param y Indicates the y offset of the point.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if point is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PointOffset(OH_Drawing_Point* point, float x, float y);
+
+/**
+ * @brief Returns the euclidean distance from (0,0) to (x,y).
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param point Indicates the pointer to an OH_Drawing_Point object.
+ * @param len Indicates euclidean distance of the point.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if point or len is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PointLength(const OH_Drawing_Point* point, float* len);
+
+/**
+ * @brief Reverse the coordinates of a point.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param point Indicates the pointer to an OH_Drawing_Point object.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if point is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_PointNegate(OH_Drawing_Point* point);
+
/**
* @brief Destroys an OH_Drawing_Point object and reclaims the memory occupied by the object.
*
diff --git a/graphic/graphic_2d/native_drawing/drawing_rect.h b/graphic/graphic_2d/native_drawing/drawing_rect.h
index ce02692a20494f8e4f50c0a390e1d3ca354df60b..64b7d271c924d15cf2b864cf8eb7a5ec3d01b353 100644
--- a/graphic/graphic_2d/native_drawing/drawing_rect.h
+++ b/graphic/graphic_2d/native_drawing/drawing_rect.h
@@ -73,6 +73,20 @@ OH_Drawing_Rect* OH_Drawing_RectCreate(float left, float top, float right, float
*/
bool OH_Drawing_RectIntersect(OH_Drawing_Rect* rect, const OH_Drawing_Rect* other);
+/**
+ * @brief Gets whether the rectangle is empty.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param rect Indicates the pointer to an OH_Drawing_Rect object.
+ * @param isEmpty Indicates the result of function.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rect or isEmpty is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RectIsEmpty(const OH_Drawing_Rect* rect, bool* isEmpty);
+
/**
* @brief Sets rect to the union of rect and other.
*
@@ -206,6 +220,65 @@ float OH_Drawing_RectGetWidth(OH_Drawing_Rect* rect);
*/
void OH_Drawing_RectCopy(OH_Drawing_Rect* src, OH_Drawing_Rect* dst);
+/**
+* @brief Sets the dst integer Rect by rounding this rectangle's coordinates to their nearest integer values.
+*
+* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+* @param rect Indicates the pointer to an OH_Drawing_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 rect is nullptr.
+* @since 14
+* @version 1.0
+*/
+OH_Drawing_ErrorCode OH_Drawing_RectRound(OH_Drawing_Rect* rect);
+
+/**
+* @brief Sets the dst integer Rect by rounding "out" this rectangle,
+* choosing the floor of top and left, and the ceiling of right and bottom.
+*
+* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+* @param sRect Indicates the pointer to an OH_Drawing_Rect object.
+* @param dRect Indicates the pointer to an OH_Drawing_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 sRect or dRect is nullptr.
+* @since 14
+* @version 1.0
+*/
+OH_Drawing_ErrorCode OH_Drawing_RectRoundOut(OH_Drawing_Rect* sRect, OH_Drawing_Rect* dRect);
+
+/**
+ * @brief Offsets the rectangle by adding dx to its left and right coordinates,
+ * and adding dy to its top and bottom coordinates.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param rect Indicates the pointer to an OH_Drawing_Rect object.
+ * @param dx Indicates the amount to add to the rectangle's left and right coordinates.
+ * @param dy Indicates the amount to add to the rectangle's top and bottom coordinates.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if rect is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RectOffset(OH_Drawing_Rect* rect, float dx, float dy);
+
+/**
+ * @brief Swaps the rectangle left and right if the left is greater than right;
+ * and swaps the rectangle top and bottom if the top is greater than bottom.
+ * If the edges are already correct, then nothing is done.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param rect Indicates the pointer to an OH_Drawing_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 rect is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RectSort(OH_Drawing_Rect* rect);
+
/**
* @brief Destroys an OH_Drawing_Rect object and reclaims the memory occupied by the object.
*
@@ -274,6 +347,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/drawing_region.h b/graphic/graphic_2d/native_drawing/drawing_region.h
index ea27f3bcef0a16ec05c722ade28d511fed68fdbf..ad6ff56b804109cb0d7e242de8f01321c43fd2e8 100644
--- a/graphic/graphic_2d/native_drawing/drawing_region.h
+++ b/graphic/graphic_2d/native_drawing/drawing_region.h
@@ -40,6 +40,7 @@
#ifndef C_INCLUDE_DRAWING_REGION_H
#define C_INCLUDE_DRAWING_REGION_H
+#include "drawing_error_code.h"
#include "drawing_types.h"
#ifdef __cplusplus
@@ -89,6 +90,21 @@ typedef enum {
*/
OH_Drawing_Region* OH_Drawing_RegionCreate(void);
+/**
+ * @brief Overriding the class Region equals operator.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param from Indicates source of comparison object.
+ * @param to Indicates comparison object.
+ * @param res Indicates whether the the two regions are equal.
+ * @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 from, to or res is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RegionEquals(OH_Drawing_Region* from, OH_Drawing_Region* to, bool* res);
+
/**
* @brief Determines whether the region contains the specified coordinates.
*
@@ -102,6 +118,67 @@ OH_Drawing_Region* OH_Drawing_RegionCreate(void);
*/
bool OH_Drawing_RegionContains(OH_Drawing_Region* region, int32_t x, int32_t y);
+/**
+ * @brief Determines whether the region contains the rect.
+ *
+ * @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 the region is equal contains the rect.
+ * @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_RegionQuickContains(OH_Drawing_Region* region,
+ const OH_Drawing_Rect* rect, bool* res);
+
+/**
+ * @brief Determines whether two regions does not intersect.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param region Indicates the pointer to an OH_Drawing_Region object.
+ * @param other Indicates the pointer to an OH_Drawing_Region 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, other or res is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RegionQuickRejectWithRegion(OH_Drawing_Region* region,
+ const OH_Drawing_Region* other, bool* res);
+
+/**
+ * @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 Determines whether region is empty.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cRegion Indicates the pointer to an OH_Drawing_Region object.
+ * @param isEmpty Indicates whether the region is empty.It is true if region is empty;
+ * it is false otherwise.
+ * @return Returns the error code {@link OH_Drawing_ErrorCode}.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if cRegion or isEmpty is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RegionIsEmpty(OH_Drawing_Region* cRegion, bool* isEmpty);
+
/**
* @brief Combines two regions.
*
@@ -115,6 +192,54 @@ 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 Combines regions and rect.
+ *
+ * @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 other Indicates the pointer to an OH_Drawing_Region object.
+ * @param op Indicates the operation to apply to combine.
+ * @param res Indicates whether the region is not empty.
+ * @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, other or res is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RegionOpWithRect(OH_Drawing_Region* region, const OH_Drawing_Rect* rect,
+ const OH_Drawing_Region* other, OH_Drawing_RegionOpMode op, bool* res);
+
+/**
+ * @brief Get the external rect with the smallest region.
+ *
+ * @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.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if region or rect is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RegionGetBounds(OH_Drawing_Region* region, OH_Drawing_Rect* rect);
+
+/**
+ * @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.
*
@@ -127,6 +252,23 @@ bool OH_Drawing_RegionOp(OH_Drawing_Region* region, const OH_Drawing_Region* oth
*/
bool OH_Drawing_RegionSetRect(OH_Drawing_Region* region, const OH_Drawing_Rect* rect);
+/**
+ * @brief Constructs a copy of an existing region.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cRegion Indicates the pointer to an OH_Drawing_Region object.
+ * @param cCopy Indicates the pointer to an OH_Drawing_Region object.
+ * @param isRegion Indicates whether the constructed region is empty.It is true if region is not empty;
+ * it is false otherwise.
+ * @return Returns the error code {@link OH_Drawing_ErrorCode}.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of cRegion, cCopy and isRegion is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RegionSetRegion(OH_Drawing_Region* cRegion, const OH_Drawing_Region* cCopy,
+ bool* isRegion);
+
/**
* @brief Constructs region that matchs outline of path within clip.
*
@@ -140,6 +282,37 @@ 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 Translates by dx along the x-axis and dy along the y-axis, and assign the result to the dst region.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param region Indicates the pointer to an OH_Drawing_Region object.
+ * @param dx Indicates the distance to translate on x-axis.
+ * @param dy Indicates the distance to translate on y-axis.
+ * @param dst Indicates the pointer to an OH_Drawing_Region object.
+ * @return Returns the error code.
+ * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.
+ * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if region or dst is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_RegionTranslate(OH_Drawing_Region* region,
+ int32_t dx, int32_t dy, OH_Drawing_Region* dst);
+
+/**
+ * @brief Determines whether the region is a rect with positive dimensional.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param cRegion Indicates the pointer to an OH_Drawing_Region object.
+ * @param isRect Indicates whether drawable area is a rect.
+ * @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 b42156a5fcde2a861d16cb6ea73164452a1059fb..1959793d318b06cd03468bf838c763fc541e2e04 100644
--- a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h
+++ b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h
@@ -226,6 +226,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 tileMode, const OH_Drawing_Matrix* 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 blend mode.
+ * @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);
+
/**
* @brief Destroys an OH_Drawing_ShaderEffect object and reclaims the memory occupied by the object.
*
diff --git a/graphic/graphic_2d/native_drawing/drawing_typeface.h b/graphic/graphic_2d/native_drawing/drawing_typeface.h
index 0b5e8d965f6bb04fcb2bb7cca885b30d952d6f83..3c412e49d691acd02f9a5fa8f151d3ed1ad14ea4 100644
--- a/graphic/graphic_2d/native_drawing/drawing_typeface.h
+++ b/graphic/graphic_2d/native_drawing/drawing_typeface.h
@@ -172,6 +172,22 @@ OH_Drawing_ErrorCode OH_Drawing_FontArgumentsAddVariation(OH_Drawing_FontArgumen
*/
OH_Drawing_ErrorCode OH_Drawing_FontArgumentsDestroy(OH_Drawing_FontArguments* fontArguments);
+/**
+ * @brief Indicates whether two OH_Drawing_Typeface objects are equal.
+ *
+ * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
+ * @param typeface Indicates the pointer to an OH_Drawing_Typeface object.
+ * @param other Indicates the pointer to an OH_Drawing_Typeface object.
+ * @param isEqual Indicates results.
+ * @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 typeface, other and isEqual is nullptr.
+ * @since 14
+ * @version 1.0
+ */
+OH_Drawing_ErrorCode OH_Drawing_TypefaceIsEqual(OH_Drawing_Typeface* typeface, OH_Drawing_Typeface* other,
+ bool* isEqual);
+
#ifdef __cplusplus
}
#endif
diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h
index c1bfda620328da17b8819fcd18ea0f05eb3a6e61..8588dbcbafc1fa5ed01efef72d6f9ffb3a60cf91 100644
--- a/graphic/graphic_2d/native_drawing/drawing_types.h
+++ b/graphic/graphic_2d/native_drawing/drawing_types.h
@@ -89,6 +89,14 @@ typedef struct OH_Drawing_Brush OH_Drawing_Brush;
*/
typedef struct OH_Drawing_Path OH_Drawing_Path;
+/**
+ * @brief Defines a iterator, which is used to query a given path, to discover operations and point values.
+ *
+ * @since 14
+ * @version 1.0
+ */
+typedef struct OH_Drawing_PathIterator OH_Drawing_PathIterator;
+
/**
* @brief Defines a bitmap, which is a memory that contains the pixel data of a shape.
*
diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
index 82740916529eb02214fdb23d47dee984f6cd3c4d..7131a5b403ef35da913a01189a5a416e61b537d1 100644
--- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
+++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json
@@ -152,6 +152,14 @@
"name": "OH_Drawing_CanvasGetImageInfo"
},
{ "name": "OH_Drawing_CreateDashPathEffect" },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_CreatePathDashEffect"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_CreateSumPathEffect"
+ },
{ "name": "OH_Drawing_PathEffectDestroy" },
{ "name": "OH_Drawing_ColorFilterCreateBlendMode" },
{ "name": "OH_Drawing_ColorFilterCreateCompose" },
@@ -316,6 +324,10 @@
"first_introduced": "12",
"name": "OH_Drawing_MatrixMapPoints"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_MatrixMapRadius"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_MatrixMapRect"
@@ -333,6 +345,10 @@
"first_introduced": "12",
"name": "OH_Drawing_MatrixPreScale"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_MatrixPreSkew"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_MatrixPreRotate"
@@ -345,6 +361,10 @@
"first_introduced": "12",
"name": "OH_Drawing_MatrixPostScale"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_MatrixPostSkew"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_MatrixPostRotate"
@@ -438,6 +458,34 @@
"first_introduced": "12",
"name": "OH_Drawing_PathGetBounds"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PathGetPathIterator"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PathIteratorCreate"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PathIteratorDestroy"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PathIteratorCreateWithPath"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PathIteratorNext"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PathIteratorPeek"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PathIteratorHasNext"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_PathGetLength"
@@ -532,6 +580,22 @@
"first_introduced": "12",
"name": "OH_Drawing_PointSet"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PointEquals"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PointOffset"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PointLength"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_PointNegate"
+ },
{ "name": "OH_Drawing_ColorSetArgb" },
{
"first_introduced": "12",
@@ -559,10 +623,18 @@
"first_introduced": "12",
"name": "OH_Drawing_RectIntersect"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RectIsEmpty"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_RectJoin"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RectSort"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_RectSetLeft"
@@ -607,6 +679,18 @@
"first_introduced": "12",
"name": "OH_Drawing_RectCopy"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RectRound"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RectRoundOut"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RectOffset"
+ },
{ "name": "OH_Drawing_RectDestroy" },
{ "name": "OH_Drawing_RoundRectCreate" },
{
@@ -663,6 +747,10 @@
"first_introduced": "12",
"name": "OH_Drawing_ShaderEffectCreateTwoPointConicalGradient"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_ShaderEffectCreateBlendShader"
+ },
{ "name": "OH_Drawing_ShaderEffectDestroy" },
{
"first_introduced": "12",
@@ -1138,14 +1226,30 @@
"first_introduced": "12",
"name": "OH_Drawing_RegionContains"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionIsComplex"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionIsEmpty"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_RegionOp"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionQuickReject"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_RegionSetPath"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionIsRect"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_RegionDestroy"
@@ -1154,6 +1258,34 @@
"first_introduced": "12",
"name": "OH_Drawing_RegionSetRect"
},
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionEquals"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionQuickContains"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionQuickRejectWithRegion"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionOpWithRect"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionGetBounds"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionTranslate"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_RegionSetRegion"
+ },
{
"first_introduced": "12",
"name": "OH_Drawing_SetTypographyTextFontFamily"
@@ -1725,5 +1857,42 @@
{
"first_introduced": "14",
"name":"OH_Drawing_GetFontCollectionGlobalInstance"
+ "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"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_TypefaceIsEqual"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_CanvasDrawNestedRoundRect"
+ },
+ {
+ "first_introduced": "14",
+ "name": "OH_Drawing_CanvasDrawArcWithCenter"
+ },
+ {
+ "first_introduced": "14",
+ "name":"OH_Drawing_CreateDiscretePathEffect"
+ },
+ {
+ "first_introduced": "14",
+ "name":"OH_Drawing_CreateCornerPathEffect"
+ },
+ {
+ "first_introduced": "14",
+ "name":"OH_Drawing_CreateComposePathEffect"
}
]
\ No newline at end of file