# lv_draw_buf_private.h (/api/private/draw/lv_draw_buf_private_h)



<RelatedHeaders name="lv_draw_buf.h" isPrivate="true" />

<ApiSummary functions="2" structs="1" />

Functions [#functions]

<ApiMember kind="function" name="lv_draw_buf_init_handlers" file="private/draw/lv_draw_buf_private.h" line="45" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/draw/lv_draw_buf_private.h#L45">
  lv_draw_buf_init_handlers [#lv_draw_buf_init_handlers]

  Called internally to initialize the draw\_buf\_handlers in lv\_global

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

<ApiMember kind="function" name="lv_draw_buf_clear_ex" file="private/draw/lv_draw_buf_private.h" line="55" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/draw/lv_draw_buf_private.h#L55">
  lv_draw_buf_clear_ex [#lv_draw_buf_clear_ex]

  TODO(v10): the draw buffer should describe its own storage well enough that the layer isn't needed. Merge this back into <ApiLink name="lv_draw_buf_clear" display="lv_draw_buf_clear()" /> then.

  ```c title=" " lineNumbers=1
  void lv_draw_buf_clear_ex(lv_draw_buf_t *draw_buf, const lv_area_t *a, lv_layer_t *layer)
  ```

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

  | Name       | Type                                                       | Description                                                                 |
  | ---------- | ---------------------------------------------------------- | --------------------------------------------------------------------------- |
  | `draw_buf` | <ApiLink name="lv_draw_buf_t" display="lv_draw_buf_t *" /> | pointer to draw buffer                                                      |
  | `a`        | <ApiLink name="lv_area_t" display="const lv_area_t *" />   | the area to clear **May** be `NULL`.. When NULL the whole buffer is cleared |
  | `layer`    | <ApiLink name="lv_layer_t" display="lv_layer_t *" />       | the layer `draw_buf` belongs to **May** be `NULL`.                          |
</ApiMember>

Structs [#structs]

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

  | Member                | Type                                                | Description |
  | --------------------- | --------------------------------------------------- | ----------- |
  | `buf_malloc_cb`       | <ApiLink name="lv_draw_buf_malloc_cb_t" />          |             |
  | `buf_free_cb`         | <ApiLink name="lv_draw_buf_free_cb_t" />            |             |
  | `buf_copy_cb`         | <ApiLink name="lv_draw_buf_copy_cb_t" />            |             |
  | `align_pointer_cb`    | <ApiLink name="lv_draw_buf_align_cb_t" />           |             |
  | `invalidate_cache_cb` | <ApiLink name="lv_draw_buf_cache_operation_cb_t" /> |             |
  | `flush_cache_cb`      | <ApiLink name="lv_draw_buf_cache_operation_cb_t" /> |             |
  | `width_to_stride_cb`  | <ApiLink name="lv_draw_buf_width_to_stride_cb_t" /> |             |
  | `buf_clear_cb`        | <ApiLink name="lv_draw_buf_clear_cb_t" />           |             |
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lvgl_public.h&#x22;]" includedBy="[&#x22;lv_global.h&#x22;, &#x22;lv_draw_nema_gfx.h&#x22;, &#x22;lvgl_private.h&#x22;]" />
