lv_draw_private.h

API reference for lv_draw_private.h

Report on GitHub
See Also: Public APIThis is the private implementation. See the public header for the stable interface.lv_draw.h
Summary

Structs

struct

_lv_draw_task_t

Modified by NXP in 2024

MemberTypeDescription
nextlv_draw_task_t *
typelv_draw_task_type_t
arealv_area_tThe area where to draw
_real_arealv_area_tThe real draw area. E.g. for shadow, outline, or transformed images it's different from area
clip_area_originallv_area_tThe original area which is updated
clip_arealv_area_tThe clip area of the layer is saved here when the draw task is created. As the clip area of the layer can be changed as new draw tasks are added its current value needs to be saved. Therefore during drawing the layer's clip area shouldn't be used as it might be already changed for other draw tasks.
target_layerlv_layer_t *
draw_unitlv_draw_unit_t *
statevolatile int
draw_dscvoid *int instead of lv_draw_task_state_t to be sure its atomic
opalv_opa_tOpacity of the layer
preferred_draw_unit_iduint8_tThe ID of the draw_unit which should take this task
preference_scoreuint8_tSet to which extent preferred_draw_unit_id is good at this task. 80: means 20% better (faster) than software rendering 100: the default value 110: means 10% worse (slower) than software rendering
struct

_lv_draw_mask_t

MemberTypeDescription
user_datavoid *
struct

_lv_draw_unit_t

MemberTypeDescription
nextlv_draw_unit_t *
nameconst char *Name and ID of the draw unit, for debugging purposes only.
idxint32_t
dispatch_cbint32_t(*)(lv_draw_unit_t *draw_unit, lv_layer_t *layer)Called to try to assign a draw task to itself. lv_draw_get_next_available_task can be used to get an independent draw task. A draw task should be assign only if the draw unit can draw it too
evaluate_cbint32_t(*)(lv_draw_unit_t *draw_unit, lv_draw_task_t *task)
wait_for_finish_cbint32_t(*)(lv_draw_unit_t *draw_unit)Called to signal the unit to complete all tasks in order to return their ready status. This callback can be implemented in case of asynchronous task processing. Below is an example to show the difference between synchronous and asynchronous:

Synchronous: LVGL thread DRAW thread HW

task1 --> submit --> Receive task1 wait_for_finish() <– task1->state = READY <– Complete task1 task2 --> submit --> Receive task2 wait_for_finish() task2->state = READY <– Complete task2 task3 --> submit --> Receive task3 wait_for_finish() <– task3->state = READY <– Complete task3 task4 --> submit --> Receive task4 wait_for_finish() <– task4->state = READY <– Complete task4 NO MORE TASKS

Asynchronous: LVGL thread DRAW thread HW is IDLE task1 --> queue task1 submit --> Receive task1 task2 --> queue task2 is BUSY (with task1) task3 --> queue task3 still BUSY (with task1) task4 --> queue task4 becomes IDLE <– task1->state = READY <– Complete task1 submit --> Receive task2, task3, task4 NO MORE TASKS wait_for_finish_cb() wait_for_finish() <– Complete task2, task3, task4 <– task2->state = READY <– <– task3->state = READY <– <– task4->state = READY <–
delete_cbint32_t(*)(lv_draw_unit_t *draw_unit)Called to delete draw unit.
event_cbvoid(*)(lv_event_t *event)Called when an event is sent to the draw unit.
struct

lv_draw_global_info_t

MemberTypeDescription
unit_headlv_draw_unit_t *
unit_cntuint32_t
used_memory_for_layersuint32_t
synclv_thread_sync_t
circle_cache_mutexlv_mutex_t
task_runningbool

Dependencies

How is this guide?

Last updated on

On this page