mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-24 08:16:29 +08:00
fix(dave2d): make it work without software render too (#6290)
This commit is contained in:
committed by
GitHub
parent
ceadda8a46
commit
59277de9f4
+2
-2
@@ -179,7 +179,7 @@ bool lv_draw_dispatch_layer(lv_display_t * disp, lv_layer_t * layer)
|
||||
while(t) {
|
||||
lv_draw_task_t * t_next = t->next;
|
||||
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*/
|
||||
|
||||
/*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) {
|
||||
/*Find a queued and independent task*/
|
||||
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)) {
|
||||
LV_PROFILER_END;
|
||||
return t;
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ extern "C" {
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define LV_DRAW_UNIT_ID_ANY 0
|
||||
#define LV_DRAW_UNIT_NONE 0
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@@ -264,7 +264,7 @@ void lv_draw_dispatch_request(void);
|
||||
* Find and available draw task
|
||||
* @param layer the draw ctx to search in
|
||||
* @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
|
||||
*/
|
||||
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);
|
||||
|
||||
@@ -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;
|
||||
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. */
|
||||
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;
|
||||
}
|
||||
|
||||
if(t->preferred_draw_unit_id != DRAW_UNIT_ID_DAVE2D) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void * buf = lv_draw_layer_alloc_buf(layer);
|
||||
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,
|
||||
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.
|
||||
*It is always the same or inside `coords`*/
|
||||
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);
|
||||
#endif
|
||||
|
||||
#endif /*LV_DRAW_SW_COMPLEX*/
|
||||
}
|
||||
|
||||
#endif /*LV_USE_DRAW_DAVE2D*/
|
||||
|
||||
Reference in New Issue
Block a user