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

chore(draw): optimize sw execute_drawing (#4954)

Signed-off-by: YanXiaowei <yanxiaowei@xiaomi.com>
Co-authored-by: YanXiaowei <yanxiaowei@xiaomi.com>
This commit is contained in:
bjsylvia 2023-12-08 03:25:16 +08:00 committed by GitHub
parent 07bd3587ce
commit 76f82598eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,6 +190,16 @@ void lv_draw_sw_rotate(const void * src, void * dest, int32_t src_width, int32_t
/**********************
* STATIC FUNCTIONS
**********************/
static inline void execute_drawing_unit(lv_draw_sw_unit_t * u)
{
execute_drawing(u);
u->task_act->state = LV_DRAW_TASK_STATE_READY;
u->task_act = NULL;
/*The draw unit is free now. Request a new dispatching as it can get a new task*/
lv_draw_dispatch_request();
}
static int32_t evaluate(lv_draw_unit_t * draw_unit, lv_draw_task_t * task)
{
@ -225,14 +235,7 @@ static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
/*Let the render thread work*/
if(draw_sw_unit->inited) lv_thread_sync_signal(&draw_sw_unit->sync);
#else
execute_drawing(draw_sw_unit);
draw_sw_unit->task_act->state = LV_DRAW_TASK_STATE_READY;
draw_sw_unit->task_act = NULL;
/*The draw unit is free now. Request a new dispatching as it can get a new task*/
lv_draw_dispatch_request();
execute_drawing_unit(draw_sw_unit);
#endif
return 1;
}
@ -258,14 +261,7 @@ static void render_thread_cb(void * ptr)
break;
}
execute_drawing(u);
/*Cleanup*/
u->task_act->state = LV_DRAW_TASK_STATE_READY;
u->task_act = NULL;
/*The draw unit is free now. Request a new dispatching as it can get a new task*/
lv_draw_dispatch_request();
execute_drawing_unit(u);
}
u->inited = false;