1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

mask and blend fixes

This commit is contained in:
Gabor Kiss-Vamosi 2019-08-26 05:06:49 +02:00
parent 3b54976227
commit 6b4db6e9fc
3 changed files with 5 additions and 8 deletions

View File

@ -159,7 +159,7 @@ void lv_blend_fill(const lv_area_t * disp_area, const lv_area_t * clip_area, con
if(opa_tmp > LV_OPA_MAX) last_res_color = color;
else if(opa_tmp < LV_OPA_MIN) last_res_color = disp_buf_tmp[x];
else last_res_color = lv_color_mix(color, disp_buf_tmp[x],opa_tmp);
last_mask = mask[x];
last_mask = mask_tmp[x];
last_dest_color.full = disp_buf_tmp[x].full;
}
disp_buf_tmp[x] = last_res_color;

View File

@ -93,7 +93,7 @@ static void draw_line_hor(const lv_point_t * point1, const lv_point_t * point2,
draw_area.y2 = point1->y + w_half0;
/*If there is no mask then simply draw a rectangle*/
if(other_mask_cnt == 20) {
if(other_mask_cnt == 0) {
lv_blend_fill(disp_area, clip, &draw_area,
disp_buf, LV_IMG_CF_TRUE_COLOR, style->line.color,
NULL, LV_MASK_RES_FULL_COVER, style->line.opa, LV_BLIT_MODE_NORMAL);
@ -136,7 +136,6 @@ static void draw_line_hor(const lv_point_t * point1, const lv_point_t * point2,
fill_area.y2++;
}
}
}

View File

@ -95,10 +95,8 @@ static void draw_bg(const lv_area_t * coords, const lv_area_t * clip, const lv_s
/*Get the real radius*/
lv_coord_t rout = style->body.radius;
if(rout == LV_RADIUS_CIRCLE) {
lv_coord_t short_side = LV_MATH_MIN(lv_area_get_width(coords), lv_area_get_height(coords));
if(rout > short_side >> 1) rout = short_side >> 1;
}
/*Most simple case: just a plain rectangle*/
if(other_mask_cnt == 0 && rout == 0 && style->body.main_color.full == style->body.grad_color.full) {
@ -181,7 +179,7 @@ static void draw_bg(const lv_area_t * coords, const lv_area_t * clip, const lv_s
area_small.y2 -= border_width;
/*Create the mask*/
lv_mask_radius_init(&mask_rsmall_param, &area_small, style->body.radius - border_width, true);
lv_mask_radius_init(&mask_rsmall_param, &area_small, rout - border_width, true);
int16_t mask_rsmall_id = lv_mask_add(lv_mask_radius, &mask_rsmall_param, NULL);
lv_coord_t corner_size = LV_MATH_MAX(rout, border_width);