From 60d3149eca012631f5988da214d10d2973708a98 Mon Sep 17 00:00:00 2001 From: l00844999 Date: Thu, 20 Mar 2025 16:47:36 +0800 Subject: [PATCH] drawing fix Signed-off-by: l00844999 --- .../graphic_2d/native_drawing/drawing_bitmap.h | 2 +- .../graphic_2d/native_drawing/drawing_canvas.h | 10 +++++----- .../native_drawing/drawing_error_code.h | 4 ++-- .../graphic_2d/native_drawing/drawing_font.h | 4 ++-- .../native_drawing/drawing_gpu_context.h | 2 +- .../native_drawing/drawing_mask_filter.h | 2 +- .../graphic_2d/native_drawing/drawing_matrix.h | 2 +- .../graphic_2d/native_drawing/drawing_path.h | 10 +++++----- .../native_drawing/drawing_path_effect.h | 4 ++-- .../graphic_2d/native_drawing/drawing_pen.h | 4 ++-- .../graphic_2d/native_drawing/drawing_region.h | 2 +- .../native_drawing/drawing_round_rect.h | 2 +- .../native_drawing/drawing_sampling_options.h | 4 ++-- .../native_drawing/drawing_shader_effect.h | 2 +- .../native_drawing/drawing_text_blob.h | 2 +- .../graphic_2d/native_drawing/drawing_types.h | 18 +++++++++--------- 16 files changed, 37 insertions(+), 37 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_bitmap.h b/graphic/graphic_2d/native_drawing/drawing_bitmap.h index 95dd825f9..83e1a4aaa 100644 --- a/graphic/graphic_2d/native_drawing/drawing_bitmap.h +++ b/graphic/graphic_2d/native_drawing/drawing_bitmap.h @@ -52,7 +52,7 @@ extern "C" { * @since 8 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_BitmapFormat { /** Storage format of bitmap pixels */ OH_Drawing_ColorFormat colorFormat; /** Alpha format of bitmap pixels */ diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index 2581f31ab..8652fb460 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -54,7 +54,7 @@ extern "C" { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_SrcRectConstraint { /** * Using sampling only inside bounds in a slower manner. */ @@ -286,7 +286,7 @@ void OH_Drawing_CanvasDrawRegion(OH_Drawing_Canvas* canvas, const OH_Drawing_Reg * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PointMode { /** * Draw each point separately. */ @@ -506,7 +506,7 @@ void OH_Drawing_CanvasDrawTextBlob(OH_Drawing_Canvas* canvas, const OH_Drawing_T * @since 11 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_CanvasClipOp { /** * Clip with difference. */ @@ -684,7 +684,7 @@ void OH_Drawing_CanvasConcatMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_CanvasShadowFlags { /** * Use no shadow flags. */ @@ -794,7 +794,7 @@ void OH_Drawing_CanvasDrawImageRect(OH_Drawing_Canvas* canvas, OH_Drawing_Image* * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_VertexMode { /** * The vertices are a triangle list. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_error_code.h b/graphic/graphic_2d/native_drawing/drawing_error_code.h index 5bdc19682..726e3c554 100644 --- a/graphic/graphic_2d/native_drawing/drawing_error_code.h +++ b/graphic/graphic_2d/native_drawing/drawing_error_code.h @@ -48,7 +48,7 @@ extern "C" { * @brief Enumerates error codes of drawing. * @since 12 */ -typedef enum { +typedef enum OH_Drawing_ErrorCode { /** * @error Operation completed successfully. */ @@ -89,7 +89,7 @@ OH_Drawing_ErrorCode OH_Drawing_ErrorCodeGet(); * @since 18 * @version 1.0 */ -void OH_Drawing_ErrorCodeReset(); +void OH_Drawing_ErrorCodeReset(void); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_drawing/drawing_font.h b/graphic/graphic_2d/native_drawing/drawing_font.h index e8582939c..e58a97d79 100644 --- a/graphic/graphic_2d/native_drawing/drawing_font.h +++ b/graphic/graphic_2d/native_drawing/drawing_font.h @@ -63,7 +63,7 @@ OH_Drawing_Font* OH_Drawing_FontCreate(void); * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_FontHinting { /** glyph outlines unchanged */ FONT_HINTING_NONE, /** minimal modification to improve contrast */ @@ -80,7 +80,7 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_FontEdging { /** no transparent pixels on glyph edges */ FONT_EDGING_ALIAS, /** may have transparent pixels on glyph edges */ diff --git a/graphic/graphic_2d/native_drawing/drawing_gpu_context.h b/graphic/graphic_2d/native_drawing/drawing_gpu_context.h index 1949a5e72..868789507 100644 --- a/graphic/graphic_2d/native_drawing/drawing_gpu_context.h +++ b/graphic/graphic_2d/native_drawing/drawing_gpu_context.h @@ -52,7 +52,7 @@ extern "C" { * @since 12 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_GpuContextOptions { /** If true this allows path mask textures to be cached */ bool allowPathMaskCaching; } OH_Drawing_GpuContextOptions; diff --git a/graphic/graphic_2d/native_drawing/drawing_mask_filter.h b/graphic/graphic_2d/native_drawing/drawing_mask_filter.h index c265e1c90..ac5427162 100644 --- a/graphic/graphic_2d/native_drawing/drawing_mask_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_mask_filter.h @@ -52,7 +52,7 @@ extern "C" { * @since 11 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_BlurType { /** * Fuzzy inside and outside. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_matrix.h b/graphic/graphic_2d/native_drawing/drawing_matrix.h index bbf6645df..890a11286 100644 --- a/graphic/graphic_2d/native_drawing/drawing_matrix.h +++ b/graphic/graphic_2d/native_drawing/drawing_matrix.h @@ -123,7 +123,7 @@ void OH_Drawing_MatrixSetMatrix(OH_Drawing_Matrix* matrix, float scaleX, float s * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_ScaleToFit { /** * Scales in x and y to fill destination rect. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_path.h b/graphic/graphic_2d/native_drawing/drawing_path.h index a198ec855..4a08a3e35 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path.h +++ b/graphic/graphic_2d/native_drawing/drawing_path.h @@ -53,7 +53,7 @@ extern "C" { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PathDirection { /** clockwise direction for adding closed contours */ PATH_DIRECTION_CW, /** counter-clockwise direction for adding closed contours */ @@ -66,7 +66,7 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PathFillType { /** Specifies that "inside" is computed by a non-zero sum of signed edge crossings */ PATH_FILL_TYPE_WINDING, /** Specifies that "inside" is computed by an odd number of edge crossings */ @@ -83,7 +83,7 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PathAddMode { /** Appended to destination unaltered */ PATH_ADD_MODE_APPEND, /** Add line if prior contour is not closed */ @@ -96,7 +96,7 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PathOpMode { /** * Difference operation. */ @@ -125,7 +125,7 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PathMeasureMatrixFlags { /** * Gets position. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h index 214cea663..5404ab650 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 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 @@ -52,7 +52,7 @@ extern "C" { * @since 18 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PathDashStyle { /** Indicates translation effect. */ DRAWING_PATH_DASH_STYLE_TRANSLATE, /** Indicates rotation effect. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_pen.h b/graphic/graphic_2d/native_drawing/drawing_pen.h index 7465f4eba..6e1f015ee 100644 --- a/graphic/graphic_2d/native_drawing/drawing_pen.h +++ b/graphic/graphic_2d/native_drawing/drawing_pen.h @@ -205,7 +205,7 @@ void OH_Drawing_PenSetMiterLimit(OH_Drawing_Pen* pen, float miter); * @since 8 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PenLineCapStyle { /** * There is no cap style. Both ends of the line segment are cut off square. */ @@ -251,7 +251,7 @@ void OH_Drawing_PenSetCap(OH_Drawing_Pen* pen, OH_Drawing_PenLineCapStyle capSty * @since 8 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_PenLineJoinStyle { /** * Mitered corner. If the angle of a polyline is small, its miter length may be inappropriate. * In this case, you need to use the miter limit to limit the miter length. diff --git a/graphic/graphic_2d/native_drawing/drawing_region.h b/graphic/graphic_2d/native_drawing/drawing_region.h index ea27f3bce..482a930d3 100644 --- a/graphic/graphic_2d/native_drawing/drawing_region.h +++ b/graphic/graphic_2d/native_drawing/drawing_region.h @@ -52,7 +52,7 @@ extern "C" { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_RegionOpMode { /** * Difference operation. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_round_rect.h b/graphic/graphic_2d/native_drawing/drawing_round_rect.h index e3dec061f..6b5e5e995 100644 --- a/graphic/graphic_2d/native_drawing/drawing_round_rect.h +++ b/graphic/graphic_2d/native_drawing/drawing_round_rect.h @@ -53,7 +53,7 @@ extern "C" { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_CornerPos { /** * Index of top-left corner radii. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h index 12a90a087..fcac9a03a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h +++ b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h @@ -52,7 +52,7 @@ extern "C" { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_FilterMode { /** single sample point (nearest neighbor) */ FILTER_MODE_NEAREST, /** interporate between 2x2 sample points (bilinear interpolation) */ @@ -65,7 +65,7 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_MipmapMode { /** ignore mipmap levels, sample from the "base" */ MIPMAP_MODE_NONE, /** sample from the nearest level */ diff --git a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h index b42156a5f..4034af2c0 100644 --- a/graphic/graphic_2d/native_drawing/drawing_shader_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_shader_effect.h @@ -52,7 +52,7 @@ extern "C" { * @since 11 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_TileMode { /** * Replicate the edge color if the shader effect draws outside of its original bounds. */ diff --git a/graphic/graphic_2d/native_drawing/drawing_text_blob.h b/graphic/graphic_2d/native_drawing/drawing_text_blob.h index 5a0dbdfd6..0ef1fbdb1 100644 --- a/graphic/graphic_2d/native_drawing/drawing_text_blob.h +++ b/graphic/graphic_2d/native_drawing/drawing_text_blob.h @@ -129,7 +129,7 @@ uint32_t OH_Drawing_TextBlobUniqueID(const OH_Drawing_TextBlob* textBlob); * @since 11 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_RunBuffer { /** storage for glyph indexes in run */ uint16_t* glyphs; /** storage for glyph positions in run */ diff --git a/graphic/graphic_2d/native_drawing/drawing_types.h b/graphic/graphic_2d/native_drawing/drawing_types.h index 65a39f672..0b6f72dcc 100644 --- a/graphic/graphic_2d/native_drawing/drawing_types.h +++ b/graphic/graphic_2d/native_drawing/drawing_types.h @@ -127,7 +127,7 @@ typedef struct OH_Drawing_ColorSpace OH_Drawing_ColorSpace; * @since 12 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_Point2D { float x; float y; } OH_Drawing_Point2D; @@ -146,7 +146,7 @@ typedef OH_Drawing_Point2D OH_Drawing_Corner_Radii; * @since 12 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_Point3D { float x; float y; float z; @@ -319,7 +319,7 @@ typedef struct OH_Drawing_Surface OH_Drawing_Surface; * @since 8 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_ColorFormat { /** Unknown format. */ COLOR_FORMAT_UNKNOWN, /** Each pixel is represented by 8 bits, which together indicate alpha. */ @@ -352,7 +352,7 @@ typedef enum { * @since 8 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_AlphaFormat { /** Unknown format. */ ALPHA_FORMAT_UNKNOWN, /** The bitmap does not have the alpha component. */ @@ -382,7 +382,7 @@ typedef enum { * @since 11 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_BlendMode { /** r = 0. */ BLEND_MODE_CLEAR, /** r = s. */ @@ -449,7 +449,7 @@ typedef enum { * @since 12 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_Image_Info { /** storage for width of image */ int32_t width; /** storage for height of image */ @@ -466,7 +466,7 @@ typedef struct { * @since 12 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_RectStyle_Info { /** color of rectstyle */ uint32_t color; /** radius in left top of rectstyle */ @@ -485,7 +485,7 @@ typedef struct { * @since 14 * @version 1.0 */ -typedef struct { +typedef struct OH_Drawing_String { /** A pointer to a byte string containing UTF-16 encoded entities */ uint8_t* strData; /** The length of `strData` in bytes */ @@ -497,7 +497,7 @@ typedef struct { * @since 12 * @version 1.0 */ -typedef enum { +typedef enum OH_Drawing_TextEncoding { /** uses bytes to represent UTF-8 or ASCII */ TEXT_ENCODING_UTF8, /** uses two byte words to represent most of Unicode */ -- Gitee