mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-26 19:23:46 +08:00
add LV_DRAW_UNIT_IDLE
This commit is contained in:
parent
4ac8ef198c
commit
5ea7ec4924
@ -253,7 +253,7 @@ bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
|
||||
lv_draw_unit_t * u = _draw_info.unit_head;
|
||||
while(u) {
|
||||
int32_t taken_cnt = u->dispatch_cb(u, layer);
|
||||
if(taken_cnt >= 0) render_running = true;
|
||||
if(taken_cnt != LV_DRAW_UNIT_IDLE) render_running = true;
|
||||
u = u->next;
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ extern "C" {
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_DRAW_UNIT_NONE 0
|
||||
#define LV_DRAW_UNIT_IDLE -1 /*The draw unit is idle, new dispatching might be requested to try again*/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
|
@ -319,11 +319,11 @@ static int32_t _pxp_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
||||
lv_draw_task_t * t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_PXP);
|
||||
|
||||
if(t == NULL || t->preferred_draw_unit_id != DRAW_UNIT_ID_PXP)
|
||||
return -1;
|
||||
return LV_DRAW_UNIT_IDLE;
|
||||
|
||||
void * buf = lv_draw_layer_alloc_buf(layer);
|
||||
if(buf == NULL)
|
||||
return -1;
|
||||
return LV_DRAW_UNIT_IDLE;
|
||||
|
||||
t->state = LV_DRAW_TASK_STATE_IN_PROGRESS;
|
||||
draw_pxp_unit->base_unit.target_layer = layer;
|
||||
|
@ -285,11 +285,11 @@ static int32_t _vglite_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
||||
lv_draw_task_t * t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_VGLITE);
|
||||
|
||||
if(t == NULL || t->preferred_draw_unit_id != DRAW_UNIT_ID_VGLITE)
|
||||
return -1;
|
||||
return LV_DRAW_UNIT_IDLE;
|
||||
|
||||
void * buf = lv_draw_layer_alloc_buf(layer);
|
||||
if(buf == NULL)
|
||||
return -1;
|
||||
return LV_DRAW_UNIT_IDLE;
|
||||
|
||||
t->state = LV_DRAW_TASK_STATE_IN_PROGRESS;
|
||||
draw_vglite_unit->base_unit.target_layer = layer;
|
||||
|
@ -349,7 +349,6 @@ static int32_t lv_draw_dave2d_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t *
|
||||
t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_DAVE2D);
|
||||
}
|
||||
|
||||
/* Return 0 is no selection, some tasks can be supported by other units. */
|
||||
if(t == NULL) {
|
||||
#if (0 == D2_RENDER_EACH_OPERATION)
|
||||
if(false == _lv_ll_is_empty(&_ll_Dave2D_Tasks)) {
|
||||
@ -357,12 +356,12 @@ static int32_t lv_draw_dave2d_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t *
|
||||
dave2d_execute_dlist_and_flush();
|
||||
}
|
||||
#endif
|
||||
return -1; /*Couldn't start rendering*/
|
||||
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
||||
}
|
||||
|
||||
void * buf = lv_draw_layer_alloc_buf(layer);
|
||||
if(buf == NULL) {
|
||||
return -1; /*Couldn't start rendering*/
|
||||
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
||||
}
|
||||
|
||||
#if (0 == D2_RENDER_EACH_OPERATION)
|
||||
|
@ -372,13 +372,13 @@ static int32_t dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
||||
t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_SW);
|
||||
if(t == NULL) {
|
||||
LV_PROFILER_END;
|
||||
return -1; /*Couldn't start rendering*/
|
||||
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
||||
}
|
||||
|
||||
void * buf = lv_draw_layer_alloc_buf(layer);
|
||||
if(buf == NULL) {
|
||||
LV_PROFILER_END;
|
||||
return -1; /*Couldn't start rendering*/
|
||||
return LV_DRAW_UNIT_IDLE; /*Couldn't start rendering*/
|
||||
}
|
||||
|
||||
t->state = LV_DRAW_TASK_STATE_IN_PROGRESS;
|
||||
|
@ -172,17 +172,17 @@ static int32_t draw_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer)
|
||||
/* Return 0 is no selection, some tasks can be supported by other units. */
|
||||
if(!t || t->preferred_draw_unit_id != VG_LITE_DRAW_UNIT_ID) {
|
||||
lv_vg_lite_finish(u);
|
||||
return -1;
|
||||
return LV_DRAW_UNIT_IDLE;
|
||||
}
|
||||
|
||||
/* Return if target buffer format is not supported. */
|
||||
if(!lv_vg_lite_is_dest_cf_supported(layer->color_format)) {
|
||||
return -1;
|
||||
return LV_DRAW_UNIT_IDLE;
|
||||
}
|
||||
|
||||
void * buf = lv_draw_layer_alloc_buf(layer);
|
||||
if(!buf) {
|
||||
return -1;
|
||||
return LV_DRAW_UNIT_IDLE;
|
||||
}
|
||||
|
||||
t->state = LV_DRAW_TASK_STATE_IN_PROGRESS;
|
||||
|
Loading…
Reference in New Issue
Block a user