1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

perf(vg_lite): optimize matrix and rectangle conversion (#7537)

This commit is contained in:
VIFEX 2025-01-04 21:18:36 +08:00 committed by GitHub
parent c9872e5283
commit ee05029cb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 19 deletions

View File

@ -106,13 +106,13 @@ void lv_draw_vg_lite_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t *
/* If clipping is not required, blit directly */
if(lv_area_is_in(&image_tf_area, draw_unit->clip_area, false) && dsc->clip_radius <= 0) {
/* The image area is the coordinates relative to the image itself */
lv_area_t src_area = *coords;
lv_area_move(&src_area, -coords->x1, -coords->y1);
/* rect is used to crop the pixel-aligned padding area */
vg_lite_rectangle_t rect;
lv_vg_lite_rect(&rect, &src_area);
vg_lite_rectangle_t rect = {
.x = 0,
.y = 0,
.width = lv_area_get_width(coords),
.height = lv_area_get_height(coords),
};
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_blit_rect");
LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect(

View File

@ -187,13 +187,14 @@ static void draw_letter_bitmap(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_d
/* If clipping is not required, blit directly */
if(lv_area_is_in(&image_area, u->base_unit.clip_area, false)) {
/* The image area is the coordinates relative to the image itself */
lv_area_t src_area = image_area;
lv_area_move(&src_area, -image_area.x1, -image_area.y1);
/* rect is used to crop the pixel-aligned padding area */
vg_lite_rectangle_t rect;
lv_vg_lite_rect(&rect, &src_area);
vg_lite_rectangle_t rect = {
.x = 0,
.y = 0,
.width = lv_area_get_width(&image_area),
.height = lv_area_get_height(&image_area)
};
LV_PROFILER_DRAW_BEGIN_TAG("vg_lite_blit_rect");
LV_VG_LITE_CHECK_ERROR(vg_lite_blit_rect(
&u->target_buffer,

View File

@ -867,11 +867,6 @@ void lv_vg_lite_rect(vg_lite_rectangle_t * rect, const lv_area_t * area)
rect->height = lv_area_get_height(area);
}
void lv_vg_lite_matrix(vg_lite_matrix_t * dest, const lv_matrix_t * src)
{
lv_memcpy(dest, src, sizeof(lv_matrix_t));
}
uint32_t lv_vg_lite_get_palette_size(vg_lite_buffer_format_t format)
{
uint32_t size = 0;
@ -1149,7 +1144,7 @@ void lv_vg_lite_matrix_multiply(vg_lite_matrix_t * matrix, const vg_lite_matrix_
}
/* Copy temporary matrix into result. */
lv_memcpy(matrix, &temp, sizeof(temp));
*matrix = temp;
}
bool lv_vg_lite_matrix_inverse(vg_lite_matrix_t * result, const vg_lite_matrix_t * matrix)

View File

@ -145,7 +145,10 @@ vg_lite_color_t lv_vg_lite_color(lv_color_t color, lv_opa_t opa, bool pre_mul);
void lv_vg_lite_rect(vg_lite_rectangle_t * rect, const lv_area_t * area);
void lv_vg_lite_matrix(vg_lite_matrix_t * dest, const lv_matrix_t * src);
static inline void lv_vg_lite_matrix(vg_lite_matrix_t * dest, const lv_matrix_t * src)
{
*(lv_matrix_t *)dest = *src;
}
/* Param checker */