mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
feat(math): add LV_ALIGN_UP macro (#5053)
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
cdf97139ca
commit
deb43a2333
@ -399,8 +399,8 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
|
||||
}
|
||||
|
||||
uint32_t bitmap_size = lv_draw_buf_width_to_stride(g.box_w, LV_COLOR_FORMAT_A8) * g.box_h;
|
||||
bitmap_size = (bitmap_size + 63) &
|
||||
(~63); /*Round up to avoid many allocations if the next buffer is just slightly larger*/
|
||||
/*Round up to avoid many allocations if the next buffer is just slightly larger*/
|
||||
bitmap_size = LV_ALIGN_UP(bitmap_size, 64);
|
||||
if(dsc->_bitmap_buf_size < bitmap_size) {
|
||||
lv_draw_buf_free(dsc->_bitmap_buf_unaligned);
|
||||
dsc->_bitmap_buf_unaligned = lv_draw_buf_malloc(bitmap_size, LV_COLOR_FORMAT_A8);
|
||||
|
@ -27,6 +27,9 @@ extern "C" {
|
||||
#define LV_BEZIER_VAL_MAX (1L << LV_BEZIER_VAL_SHIFT) /**< Max time in Bezier functions (not [0..1] to use integers)*/
|
||||
#define LV_BEZIER_VAL_FLOAT(f) ((int32_t)((f) * LV_BEZIER_VAL_MAX)) /**< Convert const float number cubic-bezier values to fix-point value*/
|
||||
|
||||
/*Align up value x to align, align must be a power of two*/
|
||||
#define LV_ALIGN_UP(x, align) (((x) + ((align) - 1)) & ~((align) - 1))
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
Loading…
x
Reference in New Issue
Block a user