# lv_draw.h (/api/draw/lv_draw_h)



<RelatedHeaders name="lv_draw_private.h" isPrivate="false" />

<ApiSummary functions="26" enums="2" structs="2" macros="2" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (7)&#x22;,&#x22;Other (19)&#x22;]">
  <ApiTab value="Getters (7)">
    <ApiMember kind="function" name="lv_draw_get_unit_count" file="draw/lv_draw.h" line="265" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L265">
      lv_draw_get_unit_count [#lv_draw_get_unit_count]

      Get the total number of draw units.

      ```c title=" " lineNumbers=1
      uint32_t lv_draw_get_unit_count(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_get_available_task" file="draw/lv_draw.h" line="275" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L275">
      lv_draw_get_available_task [#lv_draw_get_available_task]

      If there is only one draw unit check the first draw task if it's available. If there are multiple draw units call `lv_draw_get_next_available_task` to find a task.

      ```c title=" " lineNumbers=1
      lv_draw_task_t * lv_draw_get_available_task(lv_layer_t *layer, lv_draw_task_t *t_prev, uint8_t draw_unit_id)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                                         | Description                                                                            |
      | -------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
      | `layer`        | <ApiLink name="lv_layer_t" display="lv_layer_t *" />         | the draw layer to search in                                                            |
      | `t_prev`       | <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> | continue searching from this task                                                      |
      | `draw_unit_id` | <ApiLink name="uint8_t" />                                   | check the task where `preferred_draw_unit_id` equals this value or `LV_DRAW_UNIT_NONE` |

      **Returns:** <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> — an available draw task or NULL if there is not any
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_get_next_available_task" file="draw/lv_draw.h" line="284" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L284">
      lv_draw_get_next_available_task [#lv_draw_get_next_available_task]

      Find and available draw task

      ```c title=" " lineNumbers=1
      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)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                                         | Description                                                                            |
      | -------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
      | `layer`        | <ApiLink name="lv_layer_t" display="lv_layer_t *" />         | the draw layer to search in                                                            |
      | `t_prev`       | <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> | continue searching from this task                                                      |
      | `draw_unit_id` | <ApiLink name="uint8_t" />                                   | check the task where `preferred_draw_unit_id` equals this value or `LV_DRAW_UNIT_NONE` |

      **Returns:** <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> — an available draw task or NULL if there is not any
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_get_dependent_count" file="draw/lv_draw.h" line="294" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L294">
      lv_draw_get_dependent_count [#lv_draw_get_dependent_count]

      Tell how many draw task are waiting to be drawn on the area of `t_check`. It can be used to determine if a GPU shall combine many draw tasks into one or not. If a lot of tasks are waiting for the current ones it makes sense to draw them one-by-one to not block the dependent tasks' rendering

      ```c title=" " lineNumbers=1
      uint32_t lv_draw_get_dependent_count(lv_draw_task_t *t_check)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                                         | Description                                     |
      | --------- | ------------------------------------------------------------ | ----------------------------------------------- |
      | `t_check` | <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> | the task whose dependent tasks shall be counted |

      **Returns:** <ApiLink name="uint32_t" /> — number of tasks depending on `t_check`
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_task_get_type" file="draw/lv_draw.h" line="358" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L358">
      lv_draw_task_get_type [#lv_draw_task_get_type]

      Get the type of a draw task

      ```c title=" " lineNumbers=1
      lv_draw_task_type_t lv_draw_task_get_type(const lv_draw_task_t *t)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                               | Description                      |
      | ---- | ------------------------------------------------------------------ | -------------------------------- |
      | `t`  | <ApiLink name="lv_draw_task_t" display="const lv_draw_task_t *" /> | the draw task to get the type of |

      **Returns:** <ApiLink name="lv_draw_task_type_t" /> — the draw task type
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_task_get_draw_dsc" file="draw/lv_draw.h" line="365" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L365">
      lv_draw_task_get_draw_dsc [#lv_draw_task_get_draw_dsc]

      Get the draw descriptor of a draw task

      ```c title=" " lineNumbers=1
      void * lv_draw_task_get_draw_dsc(const lv_draw_task_t *t)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                               | Description                                 |
      | ---- | ------------------------------------------------------------------ | ------------------------------------------- |
      | `t`  | <ApiLink name="lv_draw_task_t" display="const lv_draw_task_t *" /> | the draw task to get the draw descriptor of |

      **Returns:** `void *` — a void pointer to the draw descriptor
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_task_get_area" file="draw/lv_draw.h" line="372" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L372">
      lv_draw_task_get_area [#lv_draw_task_get_area]

      Get the draw area of a draw task

      ```c title=" " lineNumbers=1
      void lv_draw_task_get_area(const lv_draw_task_t *t, lv_area_t *area)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                                               | Description                                        |
      | ------ | ------------------------------------------------------------------ | -------------------------------------------------- |
      | `t`    | <ApiLink name="lv_draw_task_t" display="const lv_draw_task_t *" /> | the draw task to get the draw area of              |
      | `area` | <ApiLink name="lv_area_t" display="lv_area_t *" />                 | the destination where the draw area will be stored |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (19)">
    <ApiMember kind="function" name="lv_draw_init" file="draw/lv_draw.h" line="199" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L199">
      lv_draw_init [#lv_draw_init]

      Used internally to initialize the drawing module

      ```c title=" " lineNumbers=1
      void lv_draw_init(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_deinit" file="draw/lv_draw.h" line="204" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L204">
      lv_draw_deinit [#lv_draw_deinit]

      Deinitialize the drawing module

      ```c title=" " lineNumbers=1
      void lv_draw_deinit(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_create_unit" file="draw/lv_draw.h" line="211" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L211">
      lv_draw_create_unit [#lv_draw_create_unit]

      Allocate a new draw unit with the given size and appends it to the list of draw units

      ```c title=" " lineNumbers=1
      void * lv_draw_create_unit(size_t size)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                      | Description                                                                                                           |
      | ------ | ------------------------- | --------------------------------------------------------------------------------------------------------------------- |
      | `size` | <ApiLink name="size_t" /> | the size to allocate. E.g. `sizeof(my_draw_unit_t)`, where the first element of `my_draw_unit_t` is `lv_draw_unit_t`. |
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_add_task" file="draw/lv_draw.h" line="220" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L220">
      lv_draw_add_task [#lv_draw_add_task]

      Add an empty draw task to the draw task list of a layer.

      ```c title=" " lineNumbers=1
      lv_draw_task_t * lv_draw_add_task(lv_layer_t *layer, const lv_area_t *coords, lv_draw_task_type_t type)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                                     | Description                      |
      | -------- | -------------------------------------------------------- | -------------------------------- |
      | `layer`  | <ApiLink name="lv_layer_t" display="lv_layer_t *" />     | pointer to a layer               |
      | `coords` | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | the coordinates of the draw task |
      | `type`   | <ApiLink name="lv_draw_task_type_t" />                   |                                  |

      **Returns:** <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> — the created draw task which needs to be further configured e.g. by added a draw descriptor
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_finalize_task_creation" file="draw/lv_draw.h" line="229" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L229">
      lv_draw_finalize_task_creation [#lv_draw_finalize_task_creation]

      Needs to be called when a draw task is created and configured. It will send an event about the new draw task to the widget and assign it to a draw unit.

      ```c title=" " lineNumbers=1
      void lv_draw_finalize_task_creation(lv_layer_t *layer, lv_draw_task_t *t)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                         | Description            |
      | ------- | ------------------------------------------------------------ | ---------------------- |
      | `layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" />         | pointer to a layer     |
      | `t`     | <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> | pointer to a draw task |
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_dispatch" file="draw/lv_draw.h" line="234" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L234">
      lv_draw_dispatch [#lv_draw_dispatch]

      Try dispatching draw tasks to draw units

      ```c title=" " lineNumbers=1
      void lv_draw_dispatch(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_dispatch_layer" file="draw/lv_draw.h" line="242" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L242">
      lv_draw_dispatch_layer [#lv_draw_dispatch_layer]

      Used internally to try dispatching draw tasks of a specific layer

      ```c title=" " lineNumbers=1
      bool lv_draw_dispatch_layer(lv_display_t *disp, lv_layer_t *layer)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                     | Description                                                 |
      | ------- | -------------------------------------------------------- | ----------------------------------------------------------- |
      | `disp`  | <ApiLink name="lv_display_t" display="lv_display_t *" /> | pointer to a display on which the dispatching was requested |
      | `layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" />     | pointer to a layer                                          |

      **Returns:** <ApiLink name="bool" /> — at least one draw task is being rendered (maybe it was taken earlier)
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_dispatch_wait_for_request" file="draw/lv_draw.h" line="248" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L248">
      lv_draw_dispatch_wait_for_request [#lv_draw_dispatch_wait_for_request]

      Wait for a new dispatch request. It's blocking if `LV_USE_OS == 0` else it yields

      ```c title=" " lineNumbers=1
      void lv_draw_dispatch_wait_for_request(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_wait_for_finish" file="draw/lv_draw.h" line="254" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L254">
      lv_draw_wait_for_finish [#lv_draw_wait_for_finish]

      Wait for draw finish in case of asynchronous task execution. If `LV_USE_OS == 0` it just return.

      ```c title=" " lineNumbers=1
      void lv_draw_wait_for_finish(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_dispatch_request" file="draw/lv_draw.h" line="260" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L260">
      lv_draw_dispatch_request [#lv_draw_dispatch_request]

      When a draw unit finished a draw task it needs to request dispatching to let LVGL assign a new draw task to it

      ```c title=" " lineNumbers=1
      void lv_draw_dispatch_request(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_unit_send_event" file="draw/lv_draw.h" line="303" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L303">
      lv_draw_unit_send_event [#lv_draw_unit_send_event]

      Send an event to the draw units

      ```c title=" " lineNumbers=1
      void lv_draw_unit_send_event(const char *name, lv_event_code_t code, void *param)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                               | Description                                    |
      | ------- | ---------------------------------- | ---------------------------------------------- |
      | `name`  | `const char *`                     | the name of the draw unit to send the event to |
      | `code`  | <ApiLink name="lv_event_code_t" /> | the event code                                 |
      | `param` | `void *`                           | the event parameter                            |
    </ApiMember>

    <ApiMember kind="function" name="lv_layer_init" file="draw/lv_draw.h" line="309" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L309">
      lv_layer_init [#lv_layer_init]

      Initialize a layer

      ```c title=" " lineNumbers=1
      void lv_layer_init(lv_layer_t *layer)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                 | Description                      |
      | ------- | ---------------------------------------------------- | -------------------------------- |
      | `layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" /> | pointer to a layer to initialize |
    </ApiMember>

    <ApiMember kind="function" name="lv_layer_reset" file="draw/lv_draw.h" line="315" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L315">
      lv_layer_reset [#lv_layer_reset]

      Reset the layer to a drawable state

      ```c title=" " lineNumbers=1
      void lv_layer_reset(lv_layer_t *layer)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                 | Description                 |
      | ------- | ---------------------------------------------------- | --------------------------- |
      | `layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" /> | pointer to a layer to reset |
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_layer_create" file="draw/lv_draw.h" line="324" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L324">
      lv_draw_layer_create [#lv_draw_layer_create]

      Create (allocate) a new layer on a parent layer

      ```c title=" " lineNumbers=1
      lv_layer_t * lv_draw_layer_create(lv_layer_t *parent_layer, lv_color_format_t color_format, const lv_area_t *area)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                                     | Description                                                           |
      | -------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
      | `parent_layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" />     | the parent layer to which the layer will be merged when it's rendered |
      | `color_format` | <ApiLink name="lv_color_format_t" />                     | the color format of the layer                                         |
      | `area`         | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | the areas of the layer (absolute coordinates)                         |

      **Returns:** <ApiLink name="lv_layer_t" display="lv_layer_t *" /> — the new target\_layer or NULL on error
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_layer_init" file="draw/lv_draw.h" line="334" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L334">
      lv_draw_layer_init [#lv_draw_layer_init]

      Initialize a layer which is allocated by the user

      ```c title=" " lineNumbers=1
      void lv_draw_layer_init(lv_layer_t *layer, lv_layer_t *parent_layer, lv_color_format_t color_format, const lv_area_t *area)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                                     | Description                                                                    |
      | -------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------ |
      | `layer`        | <ApiLink name="lv_layer_t" display="lv_layer_t *" />     | pointer the layer to initialize (its lifetime needs to be managed by the user) |
      | `parent_layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" />     | the parent layer to which the layer will be merged when it's rendered          |
      | `color_format` | <ApiLink name="lv_color_format_t" />                     | the color format of the layer                                                  |
      | `area`         | <ApiLink name="lv_area_t" display="const lv_area_t *" /> | the areas of the layer (absolute coordinates)                                  |
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_layer_alloc_buf" file="draw/lv_draw.h" line="342" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L342">
      lv_draw_layer_alloc_buf [#lv_draw_layer_alloc_buf]

      Try to allocate a buffer for the layer.

      ```c title=" " lineNumbers=1
      void * lv_draw_layer_alloc_buf(lv_layer_t *layer)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                 | Description        |
      | ------- | ---------------------------------------------------- | ------------------ |
      | `layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" /> | pointer to a layer |

      **Returns:** `void *` — pointer to the allocated aligned buffer or NULL on failure
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_layer_go_to_xy" file="draw/lv_draw.h" line="351" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L351">
      lv_draw_layer_go_to_xy [#lv_draw_layer_go_to_xy]

      Got to a pixel at X and Y coordinate on a layer

      ```c title=" " lineNumbers=1
      void * lv_draw_layer_go_to_xy(lv_layer_t *layer, int32_t x, int32_t y)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                 | Description             |
      | ------- | ---------------------------------------------------- | ----------------------- |
      | `layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" /> | pointer to a layer      |
      | `x`     | <ApiLink name="int32_t" />                           | the target X coordinate |
      | `y`     | <ApiLink name="int32_t" />                           | the target X coordinate |

      **Returns:** `void *` — `buf` offset to point to the given X and Y coordinate
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_layer_create_drop_shadow" file="draw/lv_draw.h" line="376" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L376">
      lv_draw_layer_create_drop_shadow [#lv_draw_layer_create_drop_shadow]

      ```c title=" " lineNumbers=1
      lv_layer_t * lv_draw_layer_create_drop_shadow(lv_layer_t *parent_layer, const lv_draw_dsc_base_t *base, const lv_area_t *area)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                                                       |
      | -------------- | -------------------------------------------------------------------------- |
      | `parent_layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" />                       |
      | `base`         | <ApiLink name="lv_draw_dsc_base_t" display="const lv_draw_dsc_base_t *" /> |
      | `area`         | <ApiLink name="lv_area_t" display="const lv_area_t *" />                   |
    </ApiMember>

    <ApiMember kind="function" name="lv_draw_layer_finish_drop_shadow" file="draw/lv_draw.h" line="379" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L379">
      lv_draw_layer_finish_drop_shadow [#lv_draw_layer_finish_drop_shadow]

      ```c title=" " lineNumbers=1
      void lv_draw_layer_finish_drop_shadow(lv_layer_t *drop_shadow_layer, const lv_draw_dsc_base_t *base)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name                | Type                                                                       |
      | ------------------- | -------------------------------------------------------------------------- |
      | `drop_shadow_layer` | <ApiLink name="lv_layer_t" display="lv_layer_t *" />                       |
      | `base`              | <ApiLink name="lv_draw_dsc_base_t" display="const lv_draw_dsc_base_t *" /> |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_draw_task_type_t" file="draw/lv_draw.h" line="47" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L47">
  lv_draw_task_type_t [#lv_draw_task_type_t]

  | Name                               | Value |
  | ---------------------------------- | ----- |
  | `LV_DRAW_TASK_TYPE_NONE`           | `0`   |
  | `LV_DRAW_TASK_TYPE_FILL`           |       |
  | `LV_DRAW_TASK_TYPE_BORDER`         |       |
  | `LV_DRAW_TASK_TYPE_BOX_SHADOW`     |       |
  | `LV_DRAW_TASK_TYPE_LETTER`         |       |
  | `LV_DRAW_TASK_TYPE_LABEL`          |       |
  | `LV_DRAW_TASK_TYPE_IMAGE`          |       |
  | `LV_DRAW_TASK_TYPE_LAYER`          |       |
  | `LV_DRAW_TASK_TYPE_LINE`           |       |
  | `LV_DRAW_TASK_TYPE_ARC`            |       |
  | `LV_DRAW_TASK_TYPE_TRIANGLE`       |       |
  | `LV_DRAW_TASK_TYPE_MASK_RECTANGLE` |       |
  | `LV_DRAW_TASK_TYPE_MASK_BITMAP`    |       |
  | `LV_DRAW_TASK_TYPE_BLUR`           |       |
  | `LV_DRAW_TASK_TYPE_VECTOR`         |       |
  | `LV_DRAW_TASK_TYPE_3D`             |       |
</ApiMember>

<TypeUsedBy name="lv_draw_task_type_t" count="1">
  * `lv_draw_add_task` — param `type`
</TypeUsedBy>

<ApiMember kind="enum" name="lv_draw_task_state_t" file="draw/lv_draw.h" line="70" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L70">
  lv_draw_task_state_t [#lv_draw_task_state_t]

  | Name                             | Description                                                                                                                                                                                                                                                                                                                                                                                           |
  | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `LV_DRAW_TASK_STATE_BLOCKED`     | Waiting for an other task to be finished. For example in case of `LV_DRAW_TASK_TYPE_LAYER` (used to blend a layer) is blocked until all the draw tasks of the layer is rendered.                                                                                                                                                                                                                      |
  | `LV_DRAW_TASK_STATE_WAITING`     | The draw task is added to the layers list and waits to be rendered.                                                                                                                                                                                                                                                                                                                                   |
  | `LV_DRAW_TASK_STATE_QUEUED`      | The draw task is added to the command queue of the draw unit. As the queued task are executed in order it's possible to queue multiple draw task (for the same draw unit) even if they are depending on each other. Therefore `lv_draw_get_available_task` and `lv_draw_get_next_available_task` can return draw task for the same draw unit even if a dependent draw task is not finished ready yet. |
  | `LV_DRAW_TASK_STATE_IN_PROGRESS` | The draw task is being rendered. This draw task needs to be finished before `lv_draw_get_available_task` and `lv_draw_get_next_available_task` would return any depending draw tasks.                                                                                                                                                                                                                 |
  | `LV_DRAW_TASK_STATE_FINISHED`    | The draw task is rendered. It will be removed from the draw task list of the layer and freed automatically.                                                                                                                                                                                                                                                                                           |
</ApiMember>

Structs [#structs]

<ApiMember kind="struct" name="_lv_layer_t">
  \_lv_layer_t [#_lv_layer_t]

  | Member             | Type                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
  | ------------------ | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `draw_buf`         | <ApiLink name="lv_draw_buf_t" display="lv_draw_buf_t *" />   | Target draw buffer of the layer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | `draw_task_head`   | <ApiLink name="lv_draw_task_t" display="lv_draw_task_t *" /> | Linked list of draw tasks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  | `parent`           | <ApiLink name="lv_layer_t" display="lv_layer_t *" />         | Parent layer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  | `next`             | <ApiLink name="lv_layer_t" display="lv_layer_t *" />         | Next layer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
  | `user_data`        | `void *`                                                     | User data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  | `buf_area`         | <ApiLink name="lv_area_t" />                                 | The absolute coordinates of the buffer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
  | `phy_clip_area`    | <ApiLink name="lv_area_t" />                                 | The physical clipping area relative to the display                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
  | `_clip_area`       | <ApiLink name="lv_area_t" />                                 | NEVER USE IT DRAW UNITS. USED INTERNALLY DURING DRAW TASK CREATION. The current clip area with absolute coordinates, always the same or smaller than `buf_area` Can be set before new draw tasks are added to indicate the clip area of the draw tasks. Therefore <ApiLink name="lv_draw_add_task" display="lv_draw_add_task()" /> always saves it in the new draw task to know the clip area when the draw task was added. During drawing the draw units also sees the saved clip\_area and should use it during drawing. During drawing the layer's clip area shouldn't be used as it might be already changed for other draw tasks. |
  | `partial_y_offset` | <ApiLink name="int32_t" />                                   | Partial y offset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | `recolor`          | <ApiLink name="lv_color32_t" />                              | Recolor of the layer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
  | `color_format`     | <ApiLink name="lv_color_format_t" />                         | The color format of the layer. LV\_COLOR\_FORMAT\_...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
  | `all_tasks_added`  | <ApiLink name="bool" />                                      | Flag indicating all tasks are added                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | `opa`              | <ApiLink name="lv_opa_t" />                                  | Opacity of the layer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
</ApiMember>

<ApiMember kind="struct" name="lv_draw_dsc_base_t">
  lv_draw_dsc_base_t [#lv_draw_dsc_base_t]

  | Member                    | Type                                                 | Description                                                                            |
  | ------------------------- | ---------------------------------------------------- | -------------------------------------------------------------------------------------- |
  | `obj`                     | <ApiLink name="lv_obj_t" display="lv_obj_t *" />     | The widget for which draw descriptor was created                                       |
  | `part`                    | <ApiLink name="uint32_t" />                          | The widget part for which draw descriptor was created                                  |
  | `id1`                     | <ApiLink name="uint32_t" />                          | A widget type specific ID (e.g. table row index). See the docs of the given widget.    |
  | `id2`                     | <ApiLink name="uint32_t" />                          | A widget type specific ID (e.g. table column index). See the docs of the given widget. |
  | `layer`                   | <ApiLink name="lv_layer_t" display="lv_layer_t *" /> | The target layer                                                                       |
  | `drop_shadow_ofs_x`       | <ApiLink name="int16_t" />                           | Drop shadow offset in X                                                                |
  | `drop_shadow_ofs_y`       | <ApiLink name="int16_t" />                           | Drop shadow offset in Y                                                                |
  | `drop_shadow_color`       | <ApiLink name="lv_color_t" />                        | Drop shadow color                                                                      |
  | `drop_shadow_opa`         | <ApiLink name="lv_opa_t" />                          | Drop shadow opacity                                                                    |
  | `drop_shadow_blur_radius` | <ApiLink name="int32_t" />                           | Drop shadow blur radius                                                                |
  | `drop_shadow_quality`     | <ApiLink name="lv_blur_quality_t" />                 | Drop shadow blur quality                                                               |
  | `dsc_size`                | <ApiLink name="size_t" />                            | Size of the specific draw descriptor into which this base descriptor is embedded       |
  | `user_data`               | `void *`                                             | Any custom user data                                                                   |
</ApiMember>

<TypeUsedBy name="lv_draw_dsc_base_t" count="2">
  * `lv_draw_layer_create_drop_shadow` — param `base`
  * `lv_draw_layer_finish_drop_shadow` — param `base`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LV_DRAW_UNIT_NONE" file="draw/lv_draw.h" line="34" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L34">
  LV_DRAW_UNIT_NONE [#lv_draw_unit_none]

  ```c title=" " lineNumbers=1
  #define LV_DRAW_UNIT_NONE 0
  ```

  Modified by NXP in 2024
</ApiMember>

<ApiMember kind="macro" name="LV_DRAW_UNIT_IDLE" file="draw/lv_draw.h" line="35" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_draw.h#L35">
  LV_DRAW_UNIT_IDLE [#lv_draw_unit_idle]

  ```c title=" " lineNumbers=1
  #define LV_DRAW_UNIT_IDLE -1
  ```

  The draw unit is idle, new dispatching might be requested to try again
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_draw_buf.h&#x22;]" includedBy="[&#x22;lv_global.h&#x22;, &#x22;lv_display_private.h&#x22;, &#x22;lv_draw_3d.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_mask.h&#x22;, &#x22;lv_draw_private.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_nanovg_private.h&#x22;, &#x22;lv_draw_opengles.h&#x22;, &#x22;lv_draw_dave2d.h&#x22;, &#x22;lv_draw_sdl.h&#x22;, &#x22;lv_draw_sw.h&#x22;, &#x22;lv_text_ap.h&#x22;, &#x22;lv_image.h&#x22;, &#x22;lv_label.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;]" />
