fix(dave2d): make it work without software render too (#6290)

This commit is contained in:
Gabor Kiss-Vamosi
2024-06-06 08:54:28 +02:00
committed by GitHub
parent ceadda8a46
commit 59277de9f4
4 changed files with 8 additions and 9 deletions
+2 -2
View File
@@ -179,7 +179,7 @@ bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
while(t) { while(t) {
lv_draw_task_t * t_next = t->next; lv_draw_task_t * t_next = t->next;
if(t->state == LV_DRAW_TASK_STATE_READY) { if(t->state == LV_DRAW_TASK_STATE_READY) {
if(t_prev) t_prev->next = t->next; /*Remove by it by assigning the next task to the previous*/ if(t_prev) t_prev->next = t->next; /*Remove it by assigning the next task to the previous*/
else layer->draw_task_head = t_next; /*If it was the head, set the next as head*/ else layer->draw_task_head = t_next; /*If it was the head, set the next as head*/
/*If it was layer drawing free the layer too*/ /*If it was layer drawing free the layer too*/
@@ -301,7 +301,7 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
while(t) { while(t) {
/*Find a queued and independent task*/ /*Find a queued and independent task*/
if(t->state == LV_DRAW_TASK_STATE_QUEUED && if(t->state == LV_DRAW_TASK_STATE_QUEUED &&
(t->preferred_draw_unit_id == LV_DRAW_UNIT_ID_ANY || t->preferred_draw_unit_id == draw_unit_id) && (t->preferred_draw_unit_id == LV_DRAW_UNIT_NONE || t->preferred_draw_unit_id == draw_unit_id) &&
is_independent(layer, t)) { is_independent(layer, t)) {
LV_PROFILER_END; LV_PROFILER_END;
return t; return t;
+2 -2
View File
@@ -26,7 +26,7 @@ extern "C" {
/********************* /*********************
* DEFINES * DEFINES
*********************/ *********************/
#define LV_DRAW_UNIT_ID_ANY 0 #define LV_DRAW_UNIT_NONE 0
/********************** /**********************
* TYPEDEFS * TYPEDEFS
@@ -264,7 +264,7 @@ void lv_draw_dispatch_request(void);
* Find and available draw task * Find and available draw task
* @param layer the draw ctx to search in * @param layer the draw ctx to search in
* @param t_prev continue searching from this task * @param t_prev continue searching from this task
* @param draw_unit_id check the task where `preferred_draw_unit_id` equals this value or `LV_DRAW_UNIT_ID_ANY` * @param draw_unit_id check the task where `preferred_draw_unit_id` equals this value or `LV_DRAW_UNIT_NONE`
* @return tan available draw task or NULL if there is no any * @return tan available draw task or NULL if there is no any
*/ */
lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id); lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id);
+4 -3
View File
@@ -344,6 +344,10 @@ static int32_t lv_draw_dave2d_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t *
lv_draw_task_t * t = NULL; lv_draw_task_t * t = NULL;
t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_DAVE2D); t = lv_draw_get_next_available_task(layer, NULL, DRAW_UNIT_ID_DAVE2D);
while(t && t->preferred_draw_unit_id != DRAW_UNIT_ID_DAVE2D) {
t->state = LV_DRAW_TASK_STATE_READY;
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. */ /* Return 0 is no selection, some tasks can be supported by other units. */
if(t == NULL) { if(t == NULL) {
@@ -356,9 +360,6 @@ static int32_t lv_draw_dave2d_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t *
return 0; return 0;
} }
if(t->preferred_draw_unit_id != DRAW_UNIT_ID_DAVE2D) {
return 0;
}
void * buf = lv_draw_layer_alloc_buf(layer); void * buf = lv_draw_layer_alloc_buf(layer);
if(buf == NULL) { if(buf == NULL) {
@@ -157,7 +157,6 @@ static void dave2d_draw_border_complex(lv_draw_dave2d_unit_t * u, const lv_area_
const lv_area_t * orig_inner_area, const lv_area_t * orig_inner_area,
int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa) int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa)
{ {
#if LV_DRAW_SW_COMPLEX
/*Get clipped draw area which is the real draw area. /*Get clipped draw area which is the real draw area.
*It is always the same or inside `coords`*/ *It is always the same or inside `coords`*/
lv_area_t draw_area; lv_area_t draw_area;
@@ -411,7 +410,6 @@ static void dave2d_draw_border_complex(lv_draw_dave2d_unit_t * u, const lv_area_
LV_ASSERT(LV_RESULT_OK == status); LV_ASSERT(LV_RESULT_OK == status);
#endif #endif
#endif /*LV_DRAW_SW_COMPLEX*/
} }
#endif /*LV_USE_DRAW_DAVE2D*/ #endif /*LV_USE_DRAW_DAVE2D*/