From ad1bfa64126dee1c9c4659f96dc81d9629453be9 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 18 Mar 2024 03:26:23 +0100 Subject: [PATCH] refactor(conf): rename LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE to LV_DRAW_LAYER_SIMPLE_BUF_SIZE (#5798) --- Kconfig | 24 ++++++++++++------------ lv_conf_template.h | 16 ++++++++-------- src/core/lv_refr.c | 4 ++-- src/lv_api_map_v9_0.h | 4 ++++ src/lv_conf_internal.h | 28 ++++++++++++++-------------- 5 files changed, 40 insertions(+), 36 deletions(-) diff --git a/Kconfig b/Kconfig index 44540c9fa..f5aab0db9 100644 --- a/Kconfig +++ b/Kconfig @@ -174,6 +174,15 @@ menu "LVGL configuration" help Align the start address of draw_buf addresses to this bytes. + config LV_DRAW_LAYER_SIMPLE_BUF_SIZE + int "Optimal size to buffer the widget with opacity" + default 24576 + depends on LV_USE_DRAW_SW + help + If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode + it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. + "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers and can't be drawn in chunks. + config LV_USE_DRAW_SW bool "Enable software rendering" default y @@ -202,15 +211,6 @@ menu "LVGL configuration" help Disabling this allows arm2d to work on its own (for testing only) - config LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE - int "Optimal size to buffer the widget with opacity" - default 24576 - depends on LV_USE_DRAW_SW - help - If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode - it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. - "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers and can't be drawn in chunks. - config LV_DRAW_SW_COMPLEX bool "Enable complex draw engine" default y @@ -1087,7 +1087,7 @@ menu "LVGL configuration" config LV_GIF_CACHE_DECODE_DATA bool "Use extra 16KB RAM to cache decoded data to accerlate" depends on LV_USE_GIF - + config LV_BIN_DECODER_RAM_LOAD bool "Decode whole image to RAM for bin decoder" default n @@ -1306,7 +1306,7 @@ menu "LVGL configuration" string "SDL include path" depends on LV_USE_SDL default "SDL2/SDL.h" - + choice prompt "SDL rendering mode" depends on LV_USE_SDL @@ -1323,7 +1323,7 @@ menu "LVGL configuration" config LV_SDL_RENDER_MODE_FULL bool "Always redraw the whole screen even if only one pixel has been changed with 2 screen sized buffers" endchoice - + choice prompt "SDL buffer size" depends on LV_USE_SDL diff --git a/lv_conf_template.h b/lv_conf_template.h index e21e12b73..6b6b9212e 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -99,6 +99,14 @@ /*Align the start address of draw_buf addresses to this bytes*/ #define LV_DRAW_BUF_ALIGN 4 +/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode + * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. + * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers + * and can't be drawn in chunks. */ + +/*The target buffer size for simple layer chunks.*/ +#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + #define LV_USE_DRAW_SW 1 #if LV_USE_DRAW_SW == 1 /* Set the number of draw unit. @@ -112,14 +120,6 @@ /* Enable native helium assembly to be compiled */ #define LV_USE_NATIVE_HELIUM_ASM 1 - /* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode - * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. - * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers - * and can't be drawn in chunks. */ - - /*The target buffer size for simple layer chunks.*/ - #define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ - /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ #define LV_DRAW_SW_COMPLEX 1 diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c index 107e732e3..fbd1c8a87 100644 --- a/src/core/lv_refr.c +++ b/src/core/lv_refr.c @@ -906,8 +906,8 @@ void refr_obj(lv_layer_t * layer, lv_obj_t * obj) if(layer_type == LV_LAYER_TYPE_SIMPLE) { int32_t w = lv_area_get_width(&layer_area_full); uint8_t px_size = lv_color_format_get_size(disp_refr->color_format); - max_rgb_row_height = LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE / w / px_size; - max_argb_row_height = LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE / w / sizeof(lv_color32_t); + max_rgb_row_height = LV_DRAW_LAYER_SIMPLE_BUF_SIZE / w / px_size; + max_argb_row_height = LV_DRAW_LAYER_SIMPLE_BUF_SIZE / w / sizeof(lv_color32_t); } lv_area_t layer_area_act; diff --git a/src/lv_api_map_v9_0.h b/src/lv_api_map_v9_0.h index 0626f0da3..f82e8d859 100644 --- a/src/lv_api_map_v9_0.h +++ b/src/lv_api_map_v9_0.h @@ -33,6 +33,10 @@ extern "C" { #define lv_image_set_align lv_image_set_inner_align #define lv_image_get_align lv_image_get_inner_align +#ifndef LV_DRAW_LAYER_SIMPLE_BUF_SIZE +#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE +#endif + /********************** * MACROS **********************/ diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index a8f753130..80141a1ad 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -249,6 +249,20 @@ #endif #endif +/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode + * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. + * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers + * and can't be drawn in chunks. */ + +/*The target buffer size for simple layer chunks.*/ +#ifndef LV_DRAW_LAYER_SIMPLE_BUF_SIZE + #ifdef CONFIG_LV_DRAW_LAYER_SIMPLE_BUF_SIZE + #define LV_DRAW_LAYER_SIMPLE_BUF_SIZE CONFIG_LV_DRAW_LAYER_SIMPLE_BUF_SIZE + #else + #define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + #endif +#endif + #ifndef LV_USE_DRAW_SW #ifdef _LV_KCONFIG_PRESENT #ifdef CONFIG_LV_USE_DRAW_SW @@ -298,20 +312,6 @@ #endif #endif - /* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode - * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. - * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers - * and can't be drawn in chunks. */ - - /*The target buffer size for simple layer chunks.*/ - #ifndef LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE - #ifdef CONFIG_LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE - #define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE CONFIG_LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE - #else - #define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ - #endif - #endif - /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ #ifndef LV_DRAW_SW_COMPLEX