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

perf(draw): use lv_memzero to quickly clean up transparent masks (#5401)

Signed-off-by: FASTSHIFT <vifextech@foxmail.com>
This commit is contained in:
_VIFEXTech 2024-01-22 19:50:16 +08:00 committed by GitHub
parent d26eac8f3a
commit 59c624aa38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -171,14 +171,14 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
if(dsc->rounded) {
if(blend_area.y1 >= round_area_1.y1 && blend_area.y1 <= round_area_1.y2) {
if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_TRANSP) {
lv_memset(mask_buf, 0x00, blend_w);
lv_memzero(mask_buf, blend_w);
blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED;
}
add_circle(circle_mask, &blend_area, &round_area_1, mask_buf, width);
}
if(blend_area.y1 >= round_area_2.y1 && blend_area.y1 <= round_area_2.y2) {
if(blend_dsc.mask_res == LV_DRAW_SW_MASK_RES_TRANSP) {
lv_memset(mask_buf, 0x00, blend_w);
lv_memzero(mask_buf, blend_w);
blend_dsc.mask_res = LV_DRAW_SW_MASK_RES_CHANGED;
}
add_circle(circle_mask, &blend_area, &round_area_2, mask_buf, width);

View File

@ -97,10 +97,7 @@ void lv_draw_sw_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_ds
y - buf_area->y1);
if(res == LV_DRAW_SW_MASK_RES_TRANSP) {
uint32_t i;
for(i = 0; i < area_w; i++) {
c32_buf[i].alpha = 0x00;
}
lv_memzero(c32_buf, area_w * sizeof(lv_color32_t));
}
else {
uint32_t i;