mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-10 21:28:59 +08:00
fix(vglite) upstream comments
Signed-off-by: Cosmin-Daniel Radu <cosmin.radu_1@nxp.com>
This commit is contained in:
committed by
Gabor Kiss-Vamosi
parent
29391f2402
commit
a2b687c2d4
@@ -1001,7 +1001,7 @@ menu "LVGL configuration"
|
||||
config LV_DEMO_BENCHMARK_ALIGNED_FONTS
|
||||
depends on LV_USE_DEMO_BENCHMARK
|
||||
bool "Use static aligned fonts"
|
||||
default y
|
||||
default n
|
||||
endmenu
|
||||
endmenu
|
||||
|
||||
|
||||
+6
-1
@@ -1326,7 +1326,12 @@
|
||||
|
||||
/** Benchmark your system */
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
|
||||
|
||||
#if LV_USE_DEMO_BENCHMARK
|
||||
/** Use fonts where bitmaps are aligned 16 byte and has Nx16 byte stride */
|
||||
#define LV_DEMO_BENCHMARK_ALIGNED_FONTS 0
|
||||
#endif
|
||||
|
||||
/** Render test for each primitive.
|
||||
* - Requires at least 480x272 display. */
|
||||
#define LV_USE_DEMO_RENDER 0
|
||||
|
||||
@@ -323,7 +323,7 @@ static int32_t _vglite_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
||||
}
|
||||
}
|
||||
vglite_draw_task_t * vglite_task = lv_malloc_zeroed(sizeof(vglite_draw_task_t));
|
||||
LV_ASSERT(vglite_task != NULL);
|
||||
LV_ASSERT_MALLOC(vglite_task);
|
||||
|
||||
vglite_task->t = t;
|
||||
|
||||
|
||||
@@ -563,7 +563,7 @@ static void _vglite_draw_arc(vglite_draw_task_t * vglite_task, const lv_point_t
|
||||
const lv_area_t * clip_area, const lv_draw_arc_dsc_t * dsc)
|
||||
{
|
||||
vg_lite_path_t * path = lv_malloc_zeroed(sizeof(vg_lite_path_t));
|
||||
LV_ASSERT(path != NULL);
|
||||
LV_ASSERT_MALLOC(path);
|
||||
vglite_task->path = path;
|
||||
int16_t start_angle = dsc->start_angle;
|
||||
int16_t end_angle = dsc->end_angle;
|
||||
@@ -576,7 +576,7 @@ static void _vglite_draw_arc(vglite_draw_task_t * vglite_task, const lv_point_t
|
||||
vg_lite_buffer_t * dest_buf = vglite_get_dest_buf();
|
||||
|
||||
int32_t * arc_path = lv_malloc_zeroed(ARC_PATH_DATA_MAX_SIZE * sizeof(int32_t));
|
||||
LV_ASSERT(arc_path != NULL);
|
||||
LV_ASSERT_MALLOC(arc_path);
|
||||
vglite_task->path_data = arc_path;
|
||||
|
||||
/*** Init path ***/
|
||||
|
||||
@@ -183,7 +183,7 @@ static void _vglite_draw_border(vglite_draw_task_t * vglite_task, const lv_area_
|
||||
|
||||
/*** Init path ***/
|
||||
int32_t * path_data = lv_malloc_zeroed(RECT_PATH_DATA_MAX_SIZE * sizeof(int32_t));
|
||||
LV_ASSERT(path_data != NULL);
|
||||
LV_ASSERT_MALLOC(path_data);
|
||||
vglite_task->path_data = path_data;
|
||||
|
||||
uint32_t path_data_size;
|
||||
@@ -191,7 +191,7 @@ static void _vglite_draw_border(vglite_draw_task_t * vglite_task, const lv_area_
|
||||
vg_lite_quality_t path_quality = radius > 0 ? VG_LITE_HIGH : VG_LITE_MEDIUM;
|
||||
|
||||
vg_lite_path_t * path = lv_malloc_zeroed(sizeof(vg_lite_path_t));
|
||||
LV_ASSERT(path != NULL);
|
||||
LV_ASSERT_MALLOC(path);
|
||||
vglite_task->path = path;
|
||||
VGLITE_CHECK_ERROR(vg_lite_init_path(path, VG_LITE_S32, path_quality, path_data_size, path_data,
|
||||
(vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1,
|
||||
|
||||
@@ -34,6 +34,17 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Set rectangle path data
|
||||
*
|
||||
* @param[in/out] path_data Coordinates of the rectangle
|
||||
* @param[in/out] path_data_size Size of path_data (bytes)
|
||||
* @param[in] p Points of the rectangle
|
||||
*
|
||||
*/
|
||||
static void _vglite_set_rectangle(int32_t * path_data, uint32_t * path_data_size,
|
||||
const lv_area_t * dest_area);
|
||||
|
||||
/**
|
||||
* Fill area, with optional opacity.
|
||||
*
|
||||
@@ -119,7 +130,7 @@ static void _vglite_set_rectangle(int32_t * path_data, uint32_t * path_data_size
|
||||
path_data[pidx++] = VLC_OP_LINE;
|
||||
path_data[pidx++] = dest_area->x1;
|
||||
path_data[pidx++] = dest_area->y1;
|
||||
path_data[pidx] = VLC_OP_END;
|
||||
path_data[pidx++] = VLC_OP_END;
|
||||
|
||||
*path_data_size = pidx * sizeof(int32_t);
|
||||
}
|
||||
@@ -147,12 +158,12 @@ static void _vglite_fill(vglite_draw_task_t * vglite_task, const lv_area_t * des
|
||||
else { /*fill with transparency*/
|
||||
|
||||
vg_lite_path_t * path = lv_malloc_zeroed(sizeof(vg_lite_path_t));
|
||||
LV_ASSERT(path != NULL);
|
||||
LV_ASSERT_MALLOC(path);
|
||||
vglite_task->path = path;
|
||||
|
||||
uint32_t path_data_size;
|
||||
int32_t * path_data = lv_malloc_zeroed(16 * sizeof(int32_t));
|
||||
LV_ASSERT(path_data != NULL);
|
||||
LV_ASSERT_MALLOC(path_data);
|
||||
vglite_task->path_data = path_data;
|
||||
_vglite_set_rectangle(path_data, &path_data_size, dest_area);
|
||||
|
||||
@@ -181,7 +192,7 @@ static void _vglite_draw_rect(vglite_draw_task_t * vglite_task, const lv_area_t
|
||||
|
||||
/*** Init path ***/
|
||||
int32_t * path_data = lv_malloc_zeroed(RECT_PATH_DATA_MAX_SIZE * sizeof(int32_t));
|
||||
LV_ASSERT(path_data != NULL);
|
||||
LV_ASSERT_MALLOC(path_data);
|
||||
vglite_task->path_data = path_data;
|
||||
|
||||
uint32_t path_data_size;
|
||||
@@ -189,7 +200,7 @@ static void _vglite_draw_rect(vglite_draw_task_t * vglite_task, const lv_area_t
|
||||
vg_lite_quality_t path_quality = dsc->radius > 0 ? VG_LITE_HIGH : VG_LITE_MEDIUM;
|
||||
|
||||
vg_lite_path_t * path = lv_malloc_zeroed(sizeof(vg_lite_path_t));
|
||||
LV_ASSERT(path != NULL);
|
||||
LV_ASSERT_MALLOC(path);
|
||||
vglite_task->path = path;
|
||||
VGLITE_CHECK_ERROR(vg_lite_init_path(path, VG_LITE_S32, path_quality, path_data_size, path_data,
|
||||
(vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1,
|
||||
@@ -205,7 +216,7 @@ static void _vglite_draw_rect(vglite_draw_task_t * vglite_task, const lv_area_t
|
||||
/*** Init Gradient ***/
|
||||
if(has_gradient) {
|
||||
gradient = lv_malloc_zeroed(sizeof(vg_lite_linear_gradient_t));
|
||||
LV_ASSERT(gradient != NULL);
|
||||
LV_ASSERT_MALLOC(gradient);
|
||||
vglite_task->gradient = gradient;
|
||||
|
||||
vg_lite_matrix_t * grad_matrix;
|
||||
|
||||
@@ -384,7 +384,7 @@ static void _vglite_draw_pattern(vglite_draw_task_t * vglite_task, const lv_area
|
||||
|
||||
/* Path to draw */
|
||||
int32_t * path_data = lv_malloc_zeroed(RECT_PATH_DATA_MAX_SIZE * sizeof(int32_t));
|
||||
LV_ASSERT(path_data != NULL);
|
||||
LV_ASSERT_MALLOC(path_data);
|
||||
vglite_task->path_data = path_data;
|
||||
|
||||
uint32_t path_data_size;
|
||||
@@ -392,7 +392,7 @@ static void _vglite_draw_pattern(vglite_draw_task_t * vglite_task, const lv_area
|
||||
vg_lite_quality_t path_quality = VG_LITE_MEDIUM;
|
||||
|
||||
vg_lite_path_t * path = lv_malloc_zeroed(sizeof(vg_lite_path_t));
|
||||
LV_ASSERT(path != NULL);
|
||||
LV_ASSERT_MALLOC(path);
|
||||
vglite_task->path = path;
|
||||
VGLITE_CHECK_ERROR(vg_lite_init_path(path, VG_LITE_S32, path_quality, path_data_size, path_data,
|
||||
(vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1,
|
||||
|
||||
@@ -98,7 +98,7 @@ static void _draw_vglite_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_
|
||||
#if LV_USE_FONT_PLACEHOLDER
|
||||
/* Draw a placeholder rectangle*/
|
||||
vglite_draw_task_t * vglite_task = lv_malloc_zeroed(sizeof(vglite_draw_task_t));
|
||||
LV_ASSERT(vglite_task != NULL);
|
||||
LV_ASSERT_MALLOC(vglite_task);
|
||||
|
||||
lv_draw_border_dsc_t border_draw_dsc;
|
||||
|
||||
@@ -152,7 +152,7 @@ static void _draw_vglite_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_
|
||||
else {
|
||||
glyph_draw_dsc->g->req_raw_bitmap = 1;
|
||||
mask_buf = lv_font_get_glyph_static_bitmap(glyph_draw_dsc->g);
|
||||
mask_stride = lv_draw_buf_width_to_stride(glyph_draw_dsc->g->box_w, LV_COLOR_FORMAT_A8);
|
||||
mask_stride = glyph_draw_dsc->g->stride;
|
||||
}
|
||||
|
||||
uint32_t mask_width = lv_area_get_width(glyph_draw_dsc->letter_coords);
|
||||
@@ -180,7 +180,7 @@ static void _draw_vglite_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_
|
||||
#if LV_USE_IMGFONT
|
||||
glyph_draw_dsc->glyph_data = lv_font_get_glyph_bitmap(glyph_draw_dsc->g, glyph_draw_dsc->_draw_buf);
|
||||
vglite_draw_task_t * vglite_task = lv_malloc_zeroed(sizeof(vglite_draw_task_t));
|
||||
LV_ASSERT(vglite_task != NULL);
|
||||
LV_ASSERT_MALLOC(vglite_task);
|
||||
|
||||
lv_draw_image_dsc_t img_dsc;
|
||||
lv_draw_image_dsc_init(&img_dsc);
|
||||
@@ -217,7 +217,7 @@ static void _draw_vglite_letter(lv_draw_task_t * t, lv_draw_glyph_dsc_t * glyph_
|
||||
|
||||
if(fill_draw_dsc && fill_area) {
|
||||
vglite_draw_task_t * vglite_task = lv_malloc_zeroed(sizeof(vglite_draw_task_t));
|
||||
LV_ASSERT(vglite_task != NULL);
|
||||
LV_ASSERT_MALLOC(vglite_task);
|
||||
|
||||
t->draw_dsc = fill_draw_dsc;
|
||||
t->area = *fill_area;
|
||||
|
||||
@@ -31,6 +31,18 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Set line path data
|
||||
*
|
||||
* @param[in/out] line_path Coordinates of the line
|
||||
* @param[in/out] path_data_size Size of path_data (bytes)
|
||||
* @param[in] p1 First point of the line
|
||||
* @patam[in] p2 Second point of the line
|
||||
*
|
||||
*/
|
||||
static void _vglite_set_line(int32_t * line_path, uint32_t * path_data_size,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
|
||||
/**
|
||||
* Draw line shape with effects
|
||||
*
|
||||
@@ -98,7 +110,7 @@ static void _vglite_set_line(int32_t * line_path, uint32_t * path_data_size, con
|
||||
line_path[pidx++] = VLC_OP_LINE;
|
||||
line_path[pidx++] = point2->x;
|
||||
line_path[pidx++] = point2->y;
|
||||
line_path[pidx] = VLC_OP_END;
|
||||
line_path[pidx++] = VLC_OP_END;
|
||||
|
||||
*path_data_size = pidx * sizeof(int32_t);
|
||||
}
|
||||
@@ -107,7 +119,7 @@ static void _vglite_draw_line(vglite_draw_task_t * vglite_task, const lv_point_t
|
||||
const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc)
|
||||
{
|
||||
vg_lite_path_t * path = lv_malloc_zeroed(sizeof(vg_lite_path_t));
|
||||
LV_ASSERT(path != NULL);
|
||||
LV_ASSERT_MALLOC(path);
|
||||
vglite_task->path = path;
|
||||
vg_lite_buffer_t * dest_buf = vglite_get_dest_buf();
|
||||
vg_lite_cap_style_t cap_style = (dsc->round_start || dsc->round_end) ? VG_LITE_CAP_ROUND : VG_LITE_CAP_BUTT;
|
||||
@@ -130,7 +142,7 @@ static void _vglite_draw_line(vglite_draw_task_t * vglite_task, const lv_point_t
|
||||
|
||||
uint32_t path_data_size = 0;
|
||||
int32_t * line_path = lv_malloc_zeroed(7 * sizeof(int32_t));
|
||||
LV_ASSERT(line_path != NULL);
|
||||
LV_ASSERT_MALLOC(line_path);
|
||||
vglite_task->path_data = line_path;
|
||||
_vglite_set_line(line_path, &path_data_size, point1, point2);
|
||||
|
||||
|
||||
@@ -34,9 +34,21 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Set triangle path data
|
||||
*
|
||||
* @param[in/out] path_data Coordinates of the triangle
|
||||
* @param[in/out] path_data_size Size of path_data (bytes)
|
||||
* @param[in] p Points of the triangle
|
||||
*
|
||||
*/
|
||||
static void _vglite_set_triangle(int32_t * path_data, uint32_t * path_data_size,
|
||||
const lv_point_precise_t * p);
|
||||
|
||||
/**
|
||||
* Draw triangle shape with effects (opacity, gradient)
|
||||
*
|
||||
* @param[in] vglite_task The current vglite task
|
||||
* @param[in] coords Coordinates of the triangle (relative to dest buff)
|
||||
* @param[in] clip_area Clipping area with relative coordinates to dest buff
|
||||
* @param[in] dsc Description of the triangle
|
||||
@@ -127,13 +139,13 @@ static void _vglite_draw_triangle(vglite_draw_task_t * vglite_task, const lv_are
|
||||
/* Init path */
|
||||
uint32_t path_data_size;
|
||||
int32_t * triangle_path = lv_malloc_zeroed(13 * sizeof(int32_t));
|
||||
LV_ASSERT(triangle_path != NULL);
|
||||
LV_ASSERT_MALLOC(triangle_path);
|
||||
vglite_task->path_data = triangle_path;
|
||||
_vglite_set_triangle(triangle_path, &path_data_size, dsc->p);
|
||||
|
||||
|
||||
vg_lite_path_t * path = lv_malloc_zeroed(sizeof(vg_lite_path_t));
|
||||
LV_ASSERT(path != NULL);
|
||||
LV_ASSERT_MALLOC(path);
|
||||
vglite_task->path = path;
|
||||
VGLITE_CHECK_ERROR(vg_lite_init_path(path, VG_LITE_S32, VG_LITE_HIGH, path_data_size, triangle_path,
|
||||
(vg_lite_float_t)clip_area->x1, (vg_lite_float_t)clip_area->y1,
|
||||
@@ -150,7 +162,7 @@ static void _vglite_draw_triangle(vglite_draw_task_t * vglite_task, const lv_are
|
||||
/* Init Gradient*/
|
||||
if(has_gradient) {
|
||||
gradient = lv_malloc_zeroed(sizeof(vg_lite_linear_gradient_t));
|
||||
LV_ASSERT(gradient != NULL);
|
||||
LV_ASSERT_MALLOC(gradient);
|
||||
vglite_task->gradient = gradient;
|
||||
|
||||
vg_lite_matrix_t * grad_matrix;
|
||||
|
||||
+12
-1
@@ -4265,7 +4265,18 @@
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if LV_USE_DEMO_BENCHMARK
|
||||
/** Use fonts where bitmaps are aligned 16 byte and has Nx16 byte stride */
|
||||
#ifndef LV_DEMO_BENCHMARK_ALIGNED_FONTS
|
||||
#ifdef CONFIG_LV_DEMO_BENCHMARK_ALIGNED_FONTS
|
||||
#define LV_DEMO_BENCHMARK_ALIGNED_FONTS CONFIG_LV_DEMO_BENCHMARK_ALIGNED_FONTS
|
||||
#else
|
||||
#define LV_DEMO_BENCHMARK_ALIGNED_FONTS 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Render test for each primitive.
|
||||
* - Requires at least 480x272 display. */
|
||||
#ifndef LV_USE_DEMO_RENDER
|
||||
|
||||
Reference in New Issue
Block a user