feat(draw_buf): update lv_draw_buf_invalidate_cache API

This commit is contained in:
Gabor Kiss-Vamosi
2023-10-12 16:32:52 +02:00
parent 5e0d063086
commit d975e398d1
2 changed files with 8 additions and 5 deletions

View File

@@ -88,9 +88,9 @@ void * lv_draw_buf_align(void * data, lv_color_format_t color_format)
else return NULL;
}
void lv_draw_buf_invalidate_cache(void * buf, size_t size)
void lv_draw_buf_invalidate_cache(void * buf, uint32_t stride, lv_color_format_t color_format, const lv_area_t * area)
{
if(handlers.invalidate_cache_cb) handlers.invalidate_cache_cb(buf, size);
if(handlers.invalidate_cache_cb) handlers.invalidate_cache_cb(buf, stride, color_format, area);
}
void * lv_draw_buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, lv_coord_t x,

View File

@@ -30,7 +30,8 @@ typedef void (*lv_draw_buf_free_cb)(void * draw_buf);
typedef void * (*lv_draw_buf_align_cb)(void * buf, lv_color_format_t color_format);
typedef void (*lv_draw_buf_invalidate_cache_cb)(void * buf, size_t size);
typedef void (*lv_draw_buf_invalidate_cache_cb)(void * buf, uint32_t stride, lv_color_format_t color_format,
const lv_area_t * area);
typedef uint32_t (*lv_draw_buf_width_to_stride_cb)(uint32_t w, lv_color_format_t color_format);
@@ -96,9 +97,11 @@ void * lv_draw_buf_align(void * buf, lv_color_format_t color_format);
/**
* Invalidate the cache of the buffer
* @param buf a memory address to invalidate
* @param size length of the memory to invalidate in bytes
* @param stride stride of the buffer
* @param color_format color format of the buffer
* @param area the area to invalidate in the buffer
*/
void lv_draw_buf_invalidate_cache(void * buf, size_t size);
void lv_draw_buf_invalidate_cache(void * buf, uint32_t stride, lv_color_format_t color_format, const lv_area_t * area);
/**
* Calculate the stride in bytes based on a width and color format