mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-06 00:54:24 +08:00
perf(vg_lite): balancing performance and memory consumption (#6823)
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com> Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
/* Magic number from https://spencermortensen.com/articles/bezier-circle/ */
|
||||
#define PATH_ARC_MAGIC 0.55191502449351f
|
||||
|
||||
#define PATH_MEM_SIZE_MIN 128
|
||||
|
||||
#define SIGN(x) (math_zero(x) ? 0 : ((x) > 0 ? 1 : -1))
|
||||
|
||||
#define VLC_OP_ARG_LEN(OP, LEN) \
|
||||
@@ -260,10 +262,11 @@ static void lv_vg_lite_path_append_data(lv_vg_lite_path_t * path, const void * d
|
||||
|
||||
if(path->base.path_length + len > path->mem_size) {
|
||||
if(path->mem_size == 0) {
|
||||
path->mem_size = len;
|
||||
path->mem_size = LV_MAX(len, PATH_MEM_SIZE_MIN);
|
||||
}
|
||||
else {
|
||||
path->mem_size *= 2;
|
||||
/* Increase memory size by 1.5 times */
|
||||
path->mem_size = path->mem_size * 3 / 2;
|
||||
}
|
||||
path->base.path = lv_realloc(path->base.path, path->mem_size);
|
||||
LV_ASSERT_MALLOC(path->base.path);
|
||||
|
||||
Reference in New Issue
Block a user