mirror of
https://github.com/lvgl/lvgl.git
synced 2024-11-27 11:43:43 +08:00
Merge branch 'master' of github.com:lvgl/lvgl
This commit is contained in:
commit
f04fddd481
31
Kconfig
31
Kconfig
@ -156,6 +156,15 @@ menu "LVGL configuration"
|
||||
radiuses are saved).
|
||||
Set to 0 to disable caching.
|
||||
|
||||
config LV_LAYER_SIMPLE_BUF_SIZE
|
||||
int "Optimal size to buffer the widget with opacity"
|
||||
default 24576
|
||||
help
|
||||
"Simple layers" are used when a widget has `style_opa < 255`
|
||||
to buffer the widget into a layer and blend it as an image
|
||||
with the given opacity. Note that `bg_opa`, `text_opa` etc
|
||||
don't require buffering into layer.
|
||||
|
||||
config LV_IMG_CACHE_DEF_SIZE
|
||||
int "Default image cache size. 0 to disable caching."
|
||||
default 0
|
||||
@ -205,9 +214,6 @@ menu "LVGL configuration"
|
||||
endmenu
|
||||
|
||||
menu "GPU"
|
||||
config LV_USE_EXTERNAL_RENDERER
|
||||
bool
|
||||
|
||||
config LV_USE_GPU_ARM2D
|
||||
bool "Enable Arm's 2D image processing library (Arm-2D) for all Cortex-M processors."
|
||||
default n
|
||||
@ -254,7 +260,6 @@ menu "LVGL configuration"
|
||||
|
||||
config LV_USE_GPU_SDL
|
||||
bool "Use SDL renderer API"
|
||||
select LV_USE_EXTERNAL_RENDERER
|
||||
default n
|
||||
config LV_GPU_SDL_INCLUDE_PATH
|
||||
string "include path of SDL header"
|
||||
@ -390,7 +395,7 @@ menu "LVGL configuration"
|
||||
bool "Left middle"
|
||||
config LV_PERF_MONITOR_ALIGN_RIGHT_MID
|
||||
bool "Right middle"
|
||||
config LV_PERF_MONITOR_ALIGN_BOTTOM_CENTER
|
||||
config LV_PERF_MONITOR_ALIGN_CENTER
|
||||
bool "Center"
|
||||
endchoice
|
||||
|
||||
@ -419,7 +424,7 @@ menu "LVGL configuration"
|
||||
bool "Left middle"
|
||||
config LV_MEM_MONITOR_ALIGN_RIGHT_MID
|
||||
bool "Right middle"
|
||||
config LV_MEM_MONITOR_ALIGN_BOTTOM_CENTER
|
||||
config LV_MEM_MONITOR_ALIGN_CENTER
|
||||
bool "Center"
|
||||
endchoice
|
||||
|
||||
@ -831,6 +836,13 @@ menu "LVGL configuration"
|
||||
config LV_USE_MSGBOX
|
||||
bool "Msgbox."
|
||||
default y if !LV_CONF_MINIMAL
|
||||
config LV_USE_SPAN
|
||||
bool "span"
|
||||
default y if !LV_CONF_MINIMAL
|
||||
config LV_SPAN_SNIPPET_STACK_SIZE
|
||||
int "Maximum number of span descriptor"
|
||||
default 64
|
||||
depends on LV_USE_SPAN
|
||||
config LV_USE_SPINBOX
|
||||
bool "Spinbox."
|
||||
default y if !LV_CONF_MINIMAL
|
||||
@ -846,13 +858,6 @@ menu "LVGL configuration"
|
||||
config LV_USE_WIN
|
||||
bool "Win"
|
||||
default y if !LV_CONF_MINIMAL
|
||||
config LV_USE_SPAN
|
||||
bool "span"
|
||||
default y if !LV_CONF_MINIMAL
|
||||
config LV_SPAN_SNIPPET_STACK_SIZE
|
||||
int "Maximum number of span descriptor"
|
||||
default 64
|
||||
depends on LV_USE_SPAN
|
||||
endmenu
|
||||
|
||||
menu "Themes"
|
||||
|
@ -760,6 +760,8 @@ static void generate_report(void)
|
||||
"LVGL v%d.%d.%d " LVGL_VERSION_INFO
|
||||
" Benchmark (in csv format)\r\n",
|
||||
LVGL_VERSION_MAJOR, LVGL_VERSION_MINOR, LVGL_VERSION_PATCH);
|
||||
LV_LOG("Weighted FPS: %"LV_PRIu32"\r\n", fps_weighted);
|
||||
LV_LOG("Opa. speed: %"LV_PRIu32"%%\r\n", opa_speed_pct);
|
||||
|
||||
row++;
|
||||
char buf[256];
|
||||
@ -873,13 +875,13 @@ static void report_cb(lv_timer_t * timer)
|
||||
}
|
||||
|
||||
if(opa_mode) {
|
||||
lv_label_set_text_fmt(subtitle, "Result of \"%s\": %"LV_PRId32" FPS", scenes[scene_act].name,
|
||||
lv_label_set_text_fmt(subtitle, "Result : %"LV_PRId32" FPS",
|
||||
scenes[scene_act].fps_normal);
|
||||
LV_LOG("Result of \"%s\": %"LV_PRId32" FPS", scenes[scene_act].name,
|
||||
scenes[scene_act].fps_normal);
|
||||
}
|
||||
else if(scene_act > 0) {
|
||||
lv_label_set_text_fmt(subtitle, "Result of \"%s + opa\": %"LV_PRId32" FPS", scenes[scene_act - 1].name,
|
||||
lv_label_set_text_fmt(subtitle, "Result : %"LV_PRId32" FPS",
|
||||
scenes[scene_act - 1].fps_opa);
|
||||
LV_LOG("Result of \"%s + opa\": %"LV_PRId32" FPS", scenes[scene_act - 1].name,
|
||||
scenes[scene_act - 1].fps_opa);
|
||||
@ -904,19 +906,7 @@ void lv_demo_benchmark_run_scene(int_fast16_t scene_no)
|
||||
if(scenes[scene_act].create_cb) {
|
||||
lv_label_set_text_fmt(title, "%"LV_PRId32"/%d: %s%s", scene_act * 2 + (opa_mode ? 1 : 0), (int)(dimof(scenes) * 2) - 2,
|
||||
scenes[scene_act].name, opa_mode ? " + opa" : "");
|
||||
if(opa_mode) {
|
||||
lv_label_set_text_fmt(subtitle, "Result of \"%s\": %"LV_PRId32" FPS", scenes[scene_act].name,
|
||||
scenes[scene_act].fps_normal);
|
||||
}
|
||||
else {
|
||||
if(scene_act > 0) {
|
||||
lv_label_set_text_fmt(subtitle, "Result of \"%s + opa\": %"LV_PRId32" FPS", scenes[scene_act - 1].name,
|
||||
scenes[scene_act - 1].fps_opa);
|
||||
}
|
||||
else {
|
||||
lv_label_set_text(subtitle, "");
|
||||
}
|
||||
}
|
||||
lv_label_set_text(subtitle, "");
|
||||
|
||||
rnd_reset();
|
||||
scenes[scene_act].create_cb();
|
||||
|
@ -1083,10 +1083,10 @@ static void color_event_cb(lv_event_t * e)
|
||||
lv_palette_t * palette_primary = lv_event_get_user_data(e);
|
||||
lv_palette_t palette_secondary = (*palette_primary) + 3; /*Use another palette as secondary*/
|
||||
if(palette_secondary >= _LV_PALETTE_LAST) palette_secondary = 0;
|
||||
|
||||
#if LV_USE_THEME_DEFAULT
|
||||
lv_theme_default_init(NULL, lv_palette_main(*palette_primary), lv_palette_main(palette_secondary),
|
||||
LV_THEME_DEFAULT_DARK, font_normal);
|
||||
|
||||
#endif
|
||||
lv_color_t color = lv_palette_main(*palette_primary);
|
||||
lv_style_set_text_color(&style_icon, color);
|
||||
lv_chart_set_series_color(chart1, ser1, color);
|
||||
|
@ -71,7 +71,7 @@ class LvExample(Directive):
|
||||
|
||||
if not 'c' in excluded_languages:
|
||||
if env.app.tags.has('html'):
|
||||
iframe_html = f"<div class='lv-example' data-real-src='/{env.config.version}/_static/built_lv_examples?example={example_name}&w=320&h=240'></div>"
|
||||
iframe_html = f"<div class='lv-example' data-real-src='/{env.config.version}/_static/built_lv_examples/index.html?example={example_name}&w=320&h=240'></div>"
|
||||
|
||||
description_html = f"<div class='lv-example-description'>{self.options.get('description', '')}</div>"
|
||||
layout_node = nodes.raw(text=f"<div class='lv-example-container'>{iframe_html}{description_html}</div>", format='html')
|
||||
|
@ -20,7 +20,7 @@ The parts of the Spinbox are identical to the [Text area](/widgets/core/textarea
|
||||
|
||||
`lv_spinbox_set_step(spinbox, 100)` sets which digits to change on increment/decrement. Only multiples of ten can be set, and not for example 3.
|
||||
|
||||
`lv_spinbox_set_pos(spinbox, 1)` sets the cursor to a specific digit to change on increment/decrement. For example position '0' sets the cursor to the least significant digit.
|
||||
`lv_spinbox_set_cursor_pos(spinbox, 1)` sets the cursor to a specific digit to change on increment/decrement. For example position '0' sets the cursor to the least significant digit.
|
||||
|
||||
If an encoder is used as input device, the selected digit is shifted to the right by default whenever the encoder button is clicked. To change this behaviour to shifting to the left, the `lv_spinbox_set_digit_step_direction(spinbox, LV_DIR_LEFT)` can be used
|
||||
|
||||
|
@ -35,7 +35,7 @@ void lv_example_style_15(void)
|
||||
*The button and the label is rendered to a layer first and that layer is transformed*/
|
||||
btn = lv_btn_create(lv_scr_act());
|
||||
lv_obj_set_size(btn, 100, 40);
|
||||
lv_obj_set_style_transform_angle(btn, 150, 0); /*150 deg*/
|
||||
lv_obj_set_style_transform_angle(btn, 150, 0); /*15 deg*/
|
||||
lv_obj_set_style_transform_zoom(btn, 256 + 64, 0); /*1.25x*/
|
||||
lv_obj_set_style_transform_pivot_x(btn, 50, 0);
|
||||
lv_obj_set_style_transform_pivot_y(btn, 20, 0);
|
||||
|
@ -55,8 +55,8 @@
|
||||
#define LV_MEM_ADR 0 /*0: unused*/
|
||||
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
|
||||
#if LV_MEM_ADR == 0
|
||||
//#define LV_MEM_POOL_INCLUDE your_alloc_library /* Uncomment if using an external allocator*/
|
||||
//#define LV_MEM_POOL_ALLOC your_alloc /* Uncomment if using an external allocator*/
|
||||
#undef LV_MEM_POOL_INCLUDE
|
||||
#undef LV_MEM_POOL_ALLOC
|
||||
#endif
|
||||
|
||||
#else /*LV_MEM_CUSTOM*/
|
||||
@ -135,36 +135,36 @@
|
||||
* "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers
|
||||
* and can't be drawn in chunks. So these settings affects only widgets with opacity.
|
||||
*/
|
||||
#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
|
||||
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE LV_MAX(lv_area_get_width(&draw_area) * px_size, 2048)
|
||||
#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
|
||||
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE LV_MAX(lv_area_get_width(&draw_area) * px_size, 2048)
|
||||
|
||||
/*Default image cache size. Image caching keeps the images opened.
|
||||
*If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
|
||||
*With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
|
||||
*However the opened images might consume additional RAM.
|
||||
*0: to disable caching*/
|
||||
#define LV_IMG_CACHE_DEF_SIZE 0
|
||||
#define LV_IMG_CACHE_DEF_SIZE 0
|
||||
|
||||
/*Number of stops allowed per gradient. Increase this to allow more stops.
|
||||
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
|
||||
#define LV_GRADIENT_MAX_STOPS 2
|
||||
#define LV_GRADIENT_MAX_STOPS 2
|
||||
|
||||
/*Default gradient buffer size.
|
||||
*When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again.
|
||||
*LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes.
|
||||
*If the cache is too small the map will be allocated only while it's required for the drawing.
|
||||
*0 mean no caching.*/
|
||||
#define LV_GRAD_CACHE_DEF_SIZE 0
|
||||
#define LV_GRAD_CACHE_DEF_SIZE 0
|
||||
|
||||
/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display)
|
||||
*LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface
|
||||
*The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */
|
||||
#define LV_DITHER_GRADIENT 0
|
||||
#define LV_DITHER_GRADIENT 0
|
||||
#if LV_DITHER_GRADIENT
|
||||
/*Add support for error diffusion dithering.
|
||||
*Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing.
|
||||
*The increase in memory consumption is (24 bits * object's width)*/
|
||||
#define LV_DITHER_ERROR_DIFFUSION 0
|
||||
#define LV_DITHER_ERROR_DIFFUSION 0
|
||||
#endif
|
||||
|
||||
/*Maximum buffer size to allocate for rotation.
|
||||
@ -461,8 +461,6 @@
|
||||
|
||||
#define LV_USE_ARC 1
|
||||
|
||||
#define LV_USE_ANIMIMG 1
|
||||
|
||||
#define LV_USE_BAR 1
|
||||
|
||||
#define LV_USE_BTN 1
|
||||
@ -508,6 +506,8 @@
|
||||
/*-----------
|
||||
* Widgets
|
||||
*----------*/
|
||||
#define LV_USE_ANIMIMG 1
|
||||
|
||||
#define LV_USE_CALENDAR 1
|
||||
#if LV_USE_CALENDAR
|
||||
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
|
||||
@ -540,6 +540,12 @@
|
||||
|
||||
#define LV_USE_MSGBOX 1
|
||||
|
||||
#define LV_USE_SPAN 1
|
||||
#if LV_USE_SPAN
|
||||
/*A line text can contain maximum num of span descriptor */
|
||||
#define LV_SPAN_SNIPPET_STACK_SIZE 64
|
||||
#endif
|
||||
|
||||
#define LV_USE_SPINBOX 1
|
||||
|
||||
#define LV_USE_SPINNER 1
|
||||
@ -550,12 +556,6 @@
|
||||
|
||||
#define LV_USE_WIN 1
|
||||
|
||||
#define LV_USE_SPAN 1
|
||||
#if LV_USE_SPAN
|
||||
/*A line text can contain maximum num of span descriptor */
|
||||
#define LV_SPAN_SNIPPET_STACK_SIZE 64
|
||||
#endif
|
||||
|
||||
/*-----------
|
||||
* Themes
|
||||
*----------*/
|
||||
@ -601,7 +601,7 @@
|
||||
#if LV_USE_FS_STDIO
|
||||
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for open, read, etc*/
|
||||
@ -609,19 +609,19 @@
|
||||
#if LV_USE_FS_POSIX
|
||||
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for CreateFile, ReadFile, etc*/
|
||||
#define LV_USE_FS_WIN32 0
|
||||
#if LV_USE_FS_WIN32
|
||||
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
|
||||
#define LV_USE_FS_FATFS 0
|
||||
#define LV_USE_FS_FATFS 0
|
||||
#if LV_USE_FS_FATFS
|
||||
#define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
@ -665,7 +665,7 @@
|
||||
|
||||
/*FFmpeg library for image decoding and playing videos
|
||||
*Supports all major image formats so do not enable other image decoder with it*/
|
||||
#define LV_USE_FFMPEG 0
|
||||
#define LV_USE_FFMPEG 0
|
||||
#if LV_USE_FFMPEG
|
||||
/*Dump input information to stderr*/
|
||||
#define LV_FFMPEG_DUMP_FORMAT 0
|
||||
@ -679,10 +679,10 @@
|
||||
#define LV_USE_SNAPSHOT 0
|
||||
|
||||
/*1: Enable Monkey test*/
|
||||
#define LV_USE_MONKEY 0
|
||||
#define LV_USE_MONKEY 0
|
||||
|
||||
/*1: Enable grid navigation*/
|
||||
#define LV_USE_GRIDNAV 0
|
||||
#define LV_USE_GRIDNAV 0
|
||||
|
||||
/*1: Enable lv_obj fragment*/
|
||||
#define LV_USE_FRAGMENT 0
|
||||
@ -705,28 +705,28 @@
|
||||
====================*/
|
||||
|
||||
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
|
||||
#define LV_USE_DEMO_WIDGETS 0
|
||||
#define LV_USE_DEMO_WIDGETS 0
|
||||
#if LV_USE_DEMO_WIDGETS
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW 0
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW 0
|
||||
#endif
|
||||
|
||||
/*Demonstrate the usage of encoder and keyboard*/
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
|
||||
|
||||
/*Benchmark your system*/
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
|
||||
/*Stress test for LVGL*/
|
||||
#define LV_USE_DEMO_STRESS 0
|
||||
#define LV_USE_DEMO_STRESS 0
|
||||
|
||||
/*Music player demo*/
|
||||
#define LV_USE_DEMO_MUSIC 0
|
||||
#define LV_USE_DEMO_MUSIC 0
|
||||
#if LV_USE_DEMO_MUSIC
|
||||
# define LV_DEMO_MUSIC_SQUARE 0
|
||||
# define LV_DEMO_MUSIC_LANDSCAPE 0
|
||||
# define LV_DEMO_MUSIC_ROUND 0
|
||||
# define LV_DEMO_MUSIC_LARGE 0
|
||||
# define LV_DEMO_MUSIC_AUTO_PLAY 0
|
||||
#define LV_DEMO_MUSIC_SQUARE 0
|
||||
#define LV_DEMO_MUSIC_LANDSCAPE 0
|
||||
#define LV_DEMO_MUSIC_ROUND 0
|
||||
#define LV_DEMO_MUSIC_LARGE 0
|
||||
#define LV_DEMO_MUSIC_AUTO_PLAY 0
|
||||
#endif
|
||||
|
||||
/*--END OF LV_CONF_H--*/
|
||||
|
@ -92,19 +92,19 @@ for line in fin.read().splitlines():
|
||||
if '/*--END OF LV_CONF_H--*/' in line: break
|
||||
|
||||
#Is there a #define in this line?
|
||||
r = re.search(r'^([\s]*)#[\s]*define[\s]+([^\s]+).*$', line) # \s means any white space character
|
||||
r = re.search(r'^([\s]*)#[\s]*(undef|define)[\s]+([^\s]+).*$', line) # \s means any white space character
|
||||
|
||||
if r:
|
||||
indent = r[1]
|
||||
|
||||
name = r[2]
|
||||
name = r[3]
|
||||
name = re.sub('\(.*?\)', '', name, 1) #remove parentheses from macros. E.g. MY_FUNC(5) -> MY_FUNC
|
||||
|
||||
name_and_value = re.sub('[\s]*#[\s]*define', '', line, 1)
|
||||
line = re.sub('[\s]*', '', line, 1)
|
||||
|
||||
#If the value should be 1 (enabled) by default use a more complex structure for Kconfig checks because
|
||||
#if a not defined CONFIG_... value should be interpreted as 0 and not the LVGL default
|
||||
is_one = re.search(r'[\s]*#[\s]*define[\s]*[A-Z0-9_]+[\s]+1([\s]*$|[\s]+)', line)
|
||||
is_one = re.search(r'#[\s]*define[\s]*[A-Z0-9_]+[\s]+1([\s]*$|[\s]+)', line)
|
||||
if is_one:
|
||||
#1. Use the value if already set from lv_conf.h or anything else (i.e. do nothing)
|
||||
#2. In Kconfig environment use the CONFIG_... value if set, else use 0
|
||||
@ -119,7 +119,7 @@ for line in fin.read().splitlines():
|
||||
f'{indent} #define {name} 0\n'
|
||||
f'{indent} #endif\n'
|
||||
f'{indent} #else\n'
|
||||
f'{indent} #define{name_and_value}\n'
|
||||
f'{indent} {line}\n'
|
||||
f'{indent} #endif\n'
|
||||
f'{indent}#endif\n'
|
||||
)
|
||||
@ -133,7 +133,7 @@ for line in fin.read().splitlines():
|
||||
f'{indent} #ifdef CONFIG_{name.upper()}\n'
|
||||
f'{indent} #define {name} CONFIG_{name.upper()}\n'
|
||||
f'{indent} #else\n'
|
||||
f'{indent} #define{name_and_value}\n'
|
||||
f'{indent} {line}\n'
|
||||
f'{indent} #endif\n'
|
||||
f'{indent}#endif\n'
|
||||
)
|
||||
|
@ -167,7 +167,8 @@ typedef struct {
|
||||
lv_scroll_snap_t scroll_snap_x : 2; /**< Where to align the snappable children horizontally*/
|
||||
lv_scroll_snap_t scroll_snap_y : 2; /**< Where to align the snappable children vertically*/
|
||||
lv_dir_t scroll_dir : 4; /**< The allowed scroll direction(s)*/
|
||||
uint8_t event_dsc_cnt; /**< Number of event callbacks stored in `event_dsc` array*/
|
||||
uint8_t event_dsc_cnt : 6; /**< Number of event callbacks stored in `event_dsc` array*/
|
||||
uint8_t layer_type : 2; /**< Cache the layer type here. Element of @lv_intermediate_layer_type_t */
|
||||
} _lv_obj_spec_attr_t;
|
||||
|
||||
typedef struct _lv_obj_t {
|
||||
|
@ -394,16 +394,11 @@ lv_coord_t _lv_obj_get_ext_draw_size(const lv_obj_t * obj)
|
||||
else return 0;
|
||||
}
|
||||
|
||||
lv_intermediate_layer_type_t _lv_obj_is_intermediate_layer(const lv_obj_t * obj)
|
||||
lv_layer_type_t _lv_obj_get_layer_type(const lv_obj_t * obj)
|
||||
{
|
||||
if(lv_obj_get_style_transform_angle(obj, 0) != 0) return LV_INTERMEDIATE_LAYER_TYPE_TRANSFORM;
|
||||
if(lv_obj_get_style_transform_zoom(obj, 0) != 256) return LV_INTERMEDIATE_LAYER_TYPE_TRANSFORM;
|
||||
if(lv_obj_get_style_opa(obj, 0) != LV_OPA_COVER) return LV_INTERMEDIATE_LAYER_TYPE_SIMPLE;
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
if(lv_obj_get_style_blend_mode(obj, 0) != LV_BLEND_MODE_NORMAL) return LV_INTERMEDIATE_LAYER_TYPE_SIMPLE;
|
||||
#endif
|
||||
return LV_INTERMEDIATE_LAYER_TYPE_NONE;
|
||||
if(obj->spec_attr) return obj->spec_attr->layer_type;
|
||||
else return LV_LAYER_TYPE_NONE;
|
||||
}
|
||||
|
||||
/**********************
|
||||
|
@ -34,10 +34,10 @@ typedef enum {
|
||||
} lv_cover_res_t;
|
||||
|
||||
typedef enum {
|
||||
LV_INTERMEDIATE_LAYER_TYPE_NONE,
|
||||
LV_INTERMEDIATE_LAYER_TYPE_SIMPLE,
|
||||
LV_INTERMEDIATE_LAYER_TYPE_TRANSFORM,
|
||||
} lv_intermediate_layer_type_t;
|
||||
LV_LAYER_TYPE_NONE,
|
||||
LV_LAYER_TYPE_SIMPLE,
|
||||
LV_LAYER_TYPE_TRANSFORM,
|
||||
} lv_layer_type_t;
|
||||
|
||||
typedef struct {
|
||||
lv_draw_ctx_t * draw_ctx; /**< Draw context*/
|
||||
@ -159,7 +159,7 @@ void lv_obj_refresh_ext_draw_size(struct _lv_obj_t * obj);
|
||||
lv_coord_t _lv_obj_get_ext_draw_size(const struct _lv_obj_t * obj);
|
||||
|
||||
|
||||
lv_intermediate_layer_type_t _lv_obj_is_intermediate_layer(const struct _lv_obj_t * obj);
|
||||
lv_layer_type_t _lv_obj_get_layer_type(const struct _lv_obj_t * obj);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
@ -798,12 +798,14 @@ void lv_obj_move_children_by(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_dif
|
||||
void lv_obj_transform_point(const lv_obj_t * obj, lv_point_t * p, bool recursive, bool inv)
|
||||
{
|
||||
if(obj) {
|
||||
lv_layer_type_t layer_type = _lv_obj_get_layer_type(obj);
|
||||
bool do_tranf = layer_type == LV_LAYER_TYPE_TRANSFORM;
|
||||
if(inv) {
|
||||
if(recursive) lv_obj_transform_point(lv_obj_get_parent(obj), p, recursive, inv);
|
||||
transform_point(obj, p, inv);
|
||||
if(do_tranf) transform_point(obj, p, inv);
|
||||
}
|
||||
else {
|
||||
transform_point(obj, p, inv);
|
||||
if(do_tranf) transform_point(obj, p, inv);
|
||||
if(recursive) lv_obj_transform_point(lv_obj_get_parent(obj), p, recursive, inv);
|
||||
}
|
||||
}
|
||||
@ -818,6 +820,7 @@ void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, bool re
|
||||
{area->x2, area->y1},
|
||||
{area->x2, area->y2},
|
||||
};
|
||||
|
||||
lv_obj_transform_point(obj, &p[0], recursive, inv);
|
||||
lv_obj_transform_point(obj, &p[1], recursive, inv);
|
||||
lv_obj_transform_point(obj, &p[2], recursive, inv);
|
||||
|
@ -51,6 +51,7 @@ static bool trans_del(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, tran
|
||||
static void trans_anim_cb(void * _tr, int32_t v);
|
||||
static void trans_anim_start_cb(lv_anim_t * a);
|
||||
static void trans_anim_ready_cb(lv_anim_t * a);
|
||||
static lv_layer_type_t calculate_layer_type(lv_obj_t * obj);
|
||||
static void fade_anim_cb(void * obj, int32_t v);
|
||||
static void fade_in_anim_ready(lv_anim_t * a);
|
||||
|
||||
@ -176,6 +177,7 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style
|
||||
bool is_layout_refr = lv_style_prop_has_flag(prop, LV_STYLE_PROP_LAYOUT_REFR);
|
||||
bool is_ext_draw = lv_style_prop_has_flag(prop, LV_STYLE_PROP_EXT_DRAW);
|
||||
bool is_inherit = lv_style_prop_has_flag(prop, LV_STYLE_PROP_INHERIT);
|
||||
bool is_layer_refr = lv_style_prop_has_flag(prop, LV_STYLE_PROP_LAYER_REFR);
|
||||
|
||||
if(is_layout_refr) {
|
||||
if(part == LV_PART_ANY ||
|
||||
@ -191,6 +193,16 @@ void lv_obj_refresh_style(lv_obj_t * obj, lv_style_selector_t selector, lv_style
|
||||
if(parent) lv_obj_mark_layout_as_dirty(parent);
|
||||
}
|
||||
|
||||
/*Cache the layer type*/
|
||||
if((part == LV_PART_ANY || part == LV_PART_MAIN) && is_layer_refr) {
|
||||
lv_layer_type_t layer_type = calculate_layer_type(obj);
|
||||
if(obj->spec_attr) obj->spec_attr->layer_type = layer_type;
|
||||
else if(layer_type != LV_LAYER_TYPE_NONE) {
|
||||
lv_obj_allocate_spec_attr(obj);
|
||||
obj->spec_attr->layer_type = layer_type;
|
||||
}
|
||||
}
|
||||
|
||||
if(prop == LV_STYLE_PROP_ANY || is_ext_draw) {
|
||||
lv_obj_refresh_ext_draw_size(obj);
|
||||
}
|
||||
@ -810,6 +822,18 @@ static void trans_anim_ready_cb(lv_anim_t * a)
|
||||
}
|
||||
}
|
||||
|
||||
static lv_layer_type_t calculate_layer_type(lv_obj_t * obj)
|
||||
{
|
||||
if(lv_obj_get_style_transform_angle(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM;
|
||||
if(lv_obj_get_style_transform_zoom(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM;
|
||||
if(lv_obj_get_style_opa(obj, 0) != LV_OPA_COVER) return LV_LAYER_TYPE_SIMPLE;
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
if(lv_obj_get_style_blend_mode(obj, 0) != LV_BLEND_MODE_NORMAL) return LV_LAYER_TYPE_SIMPLE;
|
||||
#endif
|
||||
return LV_LAYER_TYPE_NONE;
|
||||
}
|
||||
|
||||
static void fade_anim_cb(void * obj, int32_t v)
|
||||
{
|
||||
lv_obj_set_style_opa(obj, v, 0);
|
||||
|
@ -731,7 +731,7 @@ static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj)
|
||||
|
||||
if(_lv_area_is_in(area_p, &obj->coords, 0) == false) return NULL;
|
||||
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return NULL;
|
||||
if(_lv_obj_is_intermediate_layer(obj)) return NULL;
|
||||
if(_lv_obj_get_layer_type(obj)) return NULL;
|
||||
|
||||
/*If this object is fully cover the draw area then check the children too*/
|
||||
lv_cover_check_info_t info;
|
||||
@ -815,8 +815,8 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
|
||||
{
|
||||
/*Do not refresh hidden objects*/
|
||||
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return;
|
||||
lv_intermediate_layer_type_t inlayer = _lv_obj_is_intermediate_layer(obj);
|
||||
if(inlayer == LV_INTERMEDIATE_LAYER_TYPE_NONE) {
|
||||
lv_layer_type_t inlayer = _lv_obj_get_layer_type(obj);
|
||||
if(inlayer == LV_LAYER_TYPE_NONE) {
|
||||
lv_obj_redraw(draw_ctx, obj);
|
||||
}
|
||||
else {
|
||||
@ -831,7 +831,7 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
|
||||
lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size);
|
||||
uint32_t buf_size_sub;
|
||||
|
||||
if(inlayer == LV_INTERMEDIATE_LAYER_TYPE_TRANSFORM) {
|
||||
if(inlayer == LV_LAYER_TYPE_TRANSFORM) {
|
||||
lv_area_t clip_coords_for_obj;
|
||||
lv_area_t tranf_coords = obj_coords_ext;
|
||||
lv_obj_get_transformed_area(obj, &tranf_coords, false, false);
|
||||
@ -847,7 +847,7 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
|
||||
|
||||
draw_area = inverse_clip_coords_for_obj;
|
||||
}
|
||||
else if(inlayer == LV_INTERMEDIATE_LAYER_TYPE_SIMPLE) {
|
||||
else if(inlayer == LV_LAYER_TYPE_SIMPLE) {
|
||||
lv_area_t clip_coords_for_obj;
|
||||
if(!_lv_area_intersect(&clip_coords_for_obj, clip_area_ori, &obj_coords_ext)) {
|
||||
return;
|
||||
@ -875,7 +875,7 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
|
||||
|
||||
uint32_t px_size = full_cover ? sizeof(lv_color_t) : LV_IMG_PX_SIZE_ALPHA_BYTE;
|
||||
|
||||
if(inlayer == LV_INTERMEDIATE_LAYER_TYPE_SIMPLE) {
|
||||
if(inlayer == LV_LAYER_TYPE_SIMPLE) {
|
||||
buf_size_sub = LV_LAYER_SIMPLE_BUF_SIZE;
|
||||
}
|
||||
else {
|
||||
@ -887,7 +887,7 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
|
||||
|
||||
uint8_t * layer_buf = lv_mem_alloc(buf_size_sub);
|
||||
/*Try again with a smaller buf size*/
|
||||
if(inlayer == LV_INTERMEDIATE_LAYER_TYPE_SIMPLE) {
|
||||
if(inlayer == LV_LAYER_TYPE_SIMPLE) {
|
||||
if(layer_buf == NULL) {
|
||||
LV_LOG_WARN("Cannot allocate %"LV_PRIu32" bytes for layer buffer. Allocating %"LV_PRIu32" bytes instead. (Reduced performance)",
|
||||
(uint32_t)buf_size_sub * px_size, (uint32_t)LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE * px_size);
|
||||
@ -902,7 +902,7 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t row_cnt;
|
||||
int32_t row_cnt = 0;
|
||||
lv_draw_ctx_t * new_draw_ctx = lv_mem_alloc(disp_refr->driver->draw_ctx_size);
|
||||
LV_ASSERT_MALLOC(new_draw_ctx);
|
||||
if(new_draw_ctx == NULL) {
|
||||
|
@ -6,13 +6,49 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wreserved-identifier"
|
||||
#pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers"
|
||||
#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
|
||||
#pragma clang diagnostic ignored "-Wcast-qual"
|
||||
#pragma clang diagnostic ignored "-Wcast-align"
|
||||
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
|
||||
#pragma clang diagnostic ignored "-Wsign-conversion"
|
||||
#pragma clang diagnostic ignored "-Wunused-function"
|
||||
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
|
||||
#pragma clang diagnostic ignored "-Wdouble-promotion"
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wimplicit-float-conversion"
|
||||
#pragma clang diagnostic ignored "-Wimplicit-int-conversion"
|
||||
#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
|
||||
#pragma clang diagnostic ignored "-Wsign-compare"
|
||||
#pragma clang diagnostic ignored "-Wfloat-conversion"
|
||||
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma clang diagnostic ignored "-Wpadded"
|
||||
#pragma clang diagnostic ignored "-Wundef"
|
||||
#pragma clang diagnostic ignored "-Wdeclaration-after-statement"
|
||||
#pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
|
||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
|
||||
|
||||
#include "lv_gpu_arm2d.h"
|
||||
#include "../../core/lv_refr.h"
|
||||
|
||||
#if LV_USE_GPU_ARM2D
|
||||
#include "arm_2d.h"
|
||||
#include "__arm_2d_impl.h"
|
||||
#include "__arm_2d_direct.h"
|
||||
|
||||
|
||||
#if defined(__IS_COMPILER_ARM_COMPILER_5__)
|
||||
#pragma diag_suppress 174,177,188,68,513,144,1296
|
||||
#elif defined(__IS_COMPILER_IAR__)
|
||||
#pragma diag_suppress=Pa093
|
||||
#elif defined(__IS_COMPILER_GCC__)
|
||||
#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@ -43,6 +79,9 @@
|
||||
#define __arm_2d_impl_alpha_blending __arm_2d_impl_rgb565_alpha_blending
|
||||
#define __arm_2d_impl_src_msk_copy __arm_2d_impl_rgb565_src_msk_copy
|
||||
#define __arm_2d_impl_src_chn_msk_copy __arm_2d_impl_rgb565_src_chn_msk_copy
|
||||
#define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb16_cl_key_copy
|
||||
#define __arm_2d_impl_alpha_blending_colour_keying \
|
||||
__arm_2d_impl_rgb565_alpha_blending_colour_keying
|
||||
#define color_int uint16_t
|
||||
|
||||
#elif LV_COLOR_DEPTH == 32
|
||||
@ -68,12 +107,44 @@
|
||||
#define __arm_2d_impl_alpha_blending __arm_2d_impl_cccn888_alpha_blending
|
||||
#define __arm_2d_impl_src_msk_copy __arm_2d_impl_cccn888_src_msk_copy
|
||||
#define __arm_2d_impl_src_chn_msk_copy __arm_2d_impl_cccn888_src_chn_msk_copy
|
||||
#define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb32_cl_key_copy
|
||||
#define __arm_2d_impl_alpha_blending_colour_keying \
|
||||
__arm_2d_impl_cccn888_alpha_blending_colour_keying
|
||||
|
||||
#define color_int uint32_t
|
||||
|
||||
#else
|
||||
#error The specified LV_COLOR_DEPTH is not supported by this version of lv_gpu_arm2d.c.
|
||||
#endif
|
||||
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#define __ACCELERATE_PREPARE__() \
|
||||
int32_t src_stride = lv_area_get_width(coords); \
|
||||
uint8_t px_size_byte = cf == LV_IMG_CF_TRUE_COLOR_ALPHA \
|
||||
? LV_IMG_PX_SIZE_ALPHA_BYTE \
|
||||
: sizeof(lv_color_t); \
|
||||
const uint8_t * src_buf_tmp = src_buf; \
|
||||
src_buf_tmp += src_stride \
|
||||
* (draw_area.y1 - coords->y1) \
|
||||
* px_size_byte; \
|
||||
src_buf_tmp += (draw_area.x1 - coords->x1) * px_size_byte; \
|
||||
lv_area_t blend_area2; \
|
||||
if(!_lv_area_intersect(&blend_area2, \
|
||||
&draw_area, \
|
||||
draw_ctx->clip_area)) return; \
|
||||
int32_t w = lv_area_get_width(&blend_area2); \
|
||||
int32_t h = lv_area_get_height(&blend_area2); \
|
||||
lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); \
|
||||
lv_color_t * dest_buf = draw_ctx->buf; \
|
||||
dest_buf += dest_stride * (blend_area2.y1 - draw_ctx->buf_area->y1) \
|
||||
+ (blend_area2.x1 - draw_ctx->buf_area->x1); \
|
||||
arm_2d_size_t copy_size = { \
|
||||
.iWidth = lv_area_get_width(&blend_area2), \
|
||||
.iHeight = lv_area_get_height(&blend_area2), \
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@ -763,59 +834,106 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
|
||||
LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER;
|
||||
blend_dsc.mask_res = mask_res_def;
|
||||
|
||||
while(blend_area.y1 <= y_last) {
|
||||
/*Apply transformations if any or separate the channels*/
|
||||
lv_area_t transform_area;
|
||||
lv_area_copy(&transform_area, &blend_area);
|
||||
lv_area_move(&transform_area, -coords->x1, -coords->y1);
|
||||
if(transform) {
|
||||
lv_draw_transform(draw_ctx, &transform_area, src_buf, src_w, src_h, src_w,
|
||||
draw_dsc, cf, rgb_buf, mask_buf);
|
||||
if((LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf) && (!transform)) {
|
||||
/* copy with colour keying */
|
||||
|
||||
__ACCELERATE_PREPARE__();
|
||||
|
||||
//lv_area_move(&blend_area2, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1);
|
||||
if(blend_dsc.opa >= LV_OPA_MAX) {
|
||||
__arm_2d_impl_cl_key_copy(
|
||||
(color_int *)src_buf_tmp,
|
||||
src_stride,
|
||||
(color_int *)dest_buf,
|
||||
dest_stride,
|
||||
©_size,
|
||||
(color_int)LV_COLOR_CHROMA_KEY.full);
|
||||
}
|
||||
else {
|
||||
convert_cb(&transform_area, src_buf, src_w, src_h, src_w, draw_dsc, cf, rgb_buf, mask_buf);
|
||||
__arm_2d_impl_alpha_blending_colour_keying(
|
||||
(color_int *)src_buf_tmp,
|
||||
src_stride,
|
||||
(color_int *)dest_buf,
|
||||
dest_stride,
|
||||
©_size,
|
||||
blend_dsc.opa,
|
||||
(color_int)LV_COLOR_CHROMA_KEY.full);
|
||||
}
|
||||
}
|
||||
else if((LV_COLOR_DEPTH == 32)
|
||||
&& !mask_any
|
||||
&& !transform
|
||||
&& (draw_dsc->recolor_opa == LV_OPA_TRANSP)
|
||||
&& (cf == LV_IMG_CF_TRUE_COLOR_ALPHA)
|
||||
&& (blend_dsc.opa >= LV_OPA_MAX)) {
|
||||
/* accelerate copy-with-source-masks-and-opacity */
|
||||
|
||||
/*Apply recolor*/
|
||||
if(draw_dsc->recolor_opa > LV_OPA_MIN) {
|
||||
uint16_t premult_v[3];
|
||||
lv_opa_t recolor_opa = draw_dsc->recolor_opa;
|
||||
lv_color_t recolor = draw_dsc->recolor;
|
||||
lv_color_premult(recolor, recolor_opa, premult_v);
|
||||
uint32_t i;
|
||||
for(i = 0; i < buf_size; i++) {
|
||||
rgb_buf[i] = lv_color_mix_premult(premult_v, rgb_buf[i], recolor_opa);
|
||||
__ACCELERATE_PREPARE__();
|
||||
|
||||
__arm_2d_impl_src_chn_msk_copy(
|
||||
(color_int *)src_buf_tmp,
|
||||
src_stride,
|
||||
(uint32_t *)((uintptr_t)src_buf_tmp + LV_IMG_PX_SIZE_ALPHA_BYTE - 1),
|
||||
src_stride,
|
||||
©_size,
|
||||
(color_int *)dest_buf,
|
||||
dest_stride,
|
||||
©_size);
|
||||
}
|
||||
else while(blend_area.y1 <= y_last) {
|
||||
/*Apply transformations if any or separate the channels*/
|
||||
lv_area_t transform_area;
|
||||
lv_area_copy(&transform_area, &blend_area);
|
||||
lv_area_move(&transform_area, -coords->x1, -coords->y1);
|
||||
if(transform) {
|
||||
lv_draw_transform(draw_ctx, &transform_area, src_buf, src_w, src_h, src_w,
|
||||
draw_dsc, cf, rgb_buf, mask_buf);
|
||||
}
|
||||
else {
|
||||
convert_cb(&transform_area, src_buf, src_w, src_h, src_w, draw_dsc, cf, rgb_buf, mask_buf);
|
||||
}
|
||||
|
||||
/*Apply recolor*/
|
||||
if(draw_dsc->recolor_opa > LV_OPA_MIN) {
|
||||
uint16_t premult_v[3];
|
||||
lv_opa_t recolor_opa = draw_dsc->recolor_opa;
|
||||
lv_color_t recolor = draw_dsc->recolor;
|
||||
lv_color_premult(recolor, recolor_opa, premult_v);
|
||||
recolor_opa = 255 - recolor_opa;
|
||||
uint32_t i;
|
||||
for(i = 0; i < buf_size; i++) {
|
||||
rgb_buf[i] = lv_color_mix_premult(premult_v, rgb_buf[i], recolor_opa);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if LV_DRAW_COMPLEX
|
||||
/*Apply the masks if any*/
|
||||
if(mask_any) {
|
||||
lv_coord_t y;
|
||||
lv_opa_t * mask_buf_tmp = mask_buf;
|
||||
for(y = blend_area.y1; y <= blend_area.y2; y++) {
|
||||
lv_draw_mask_res_t mask_res_line;
|
||||
mask_res_line = lv_draw_mask_apply(mask_buf_tmp, blend_area.x1, y, blend_w);
|
||||
/*Apply the masks if any*/
|
||||
if(mask_any) {
|
||||
lv_coord_t y;
|
||||
lv_opa_t * mask_buf_tmp = mask_buf;
|
||||
for(y = blend_area.y1; y <= blend_area.y2; y++) {
|
||||
lv_draw_mask_res_t mask_res_line;
|
||||
mask_res_line = lv_draw_mask_apply(mask_buf_tmp, blend_area.x1, y, blend_w);
|
||||
|
||||
if(mask_res_line == LV_DRAW_MASK_RES_TRANSP) {
|
||||
lv_memset_00(mask_buf_tmp, blend_w);
|
||||
blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED;
|
||||
if(mask_res_line == LV_DRAW_MASK_RES_TRANSP) {
|
||||
lv_memset_00(mask_buf_tmp, blend_w);
|
||||
blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
else if(mask_res_line == LV_DRAW_MASK_RES_CHANGED) {
|
||||
blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
mask_buf_tmp += blend_w;
|
||||
}
|
||||
else if(mask_res_line == LV_DRAW_MASK_RES_CHANGED) {
|
||||
blend_dsc.mask_res = LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
mask_buf_tmp += blend_w;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*Blend*/
|
||||
lv_draw_sw_blend(draw_ctx, &blend_dsc);
|
||||
/*Blend*/
|
||||
lv_draw_sw_blend(draw_ctx, &blend_dsc);
|
||||
|
||||
/*Go the the next lines*/
|
||||
blend_area.y1 = blend_area.y2 + 1;
|
||||
blend_area.y2 = blend_area.y1 + buf_h - 1;
|
||||
if(blend_area.y2 > y_last) blend_area.y2 = y_last;
|
||||
}
|
||||
/*Go the the next lines*/
|
||||
blend_area.y1 = blend_area.y2 + 1;
|
||||
blend_area.y2 = blend_area.y1 + buf_h - 1;
|
||||
if(blend_area.y2 > y_last) blend_area.y2 = y_last;
|
||||
}
|
||||
|
||||
lv_mem_buf_release(mask_buf);
|
||||
lv_mem_buf_release(rgb_buf);
|
||||
|
@ -1325,7 +1325,8 @@ static void draw_cursors(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx)
|
||||
cy += obj->coords.y1;
|
||||
|
||||
lv_area_t point_area;
|
||||
if(point_w && point_h) {
|
||||
bool draw_point = point_w && point_h;
|
||||
if(draw_point) {
|
||||
point_area.x1 = cx - point_w;
|
||||
point_area.x2 = cx + point_w;
|
||||
point_area.y1 = cy - point_h;
|
||||
@ -1345,7 +1346,11 @@ static void draw_cursors(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx)
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc);
|
||||
lv_draw_line(draw_ctx, &line_dsc_tmp, &p1, &p2);
|
||||
lv_draw_rect(draw_ctx, &point_dsc_tmp, &point_area);
|
||||
|
||||
if(draw_point) {
|
||||
lv_draw_rect(draw_ctx, &point_dsc_tmp, &point_area);
|
||||
}
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc);
|
||||
}
|
||||
|
||||
@ -1357,7 +1362,11 @@ static void draw_cursors(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx)
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &part_draw_dsc);
|
||||
lv_draw_line(draw_ctx, &line_dsc_tmp, &p1, &p2);
|
||||
lv_draw_rect(draw_ctx, &point_dsc_tmp, &point_area);
|
||||
|
||||
if(draw_point) {
|
||||
lv_draw_rect(draw_ctx, &point_dsc_tmp, &point_area);
|
||||
}
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &part_draw_dsc);
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max)
|
||||
* @param spinbox pointer to spinbox
|
||||
* @param pos selected position in spinbox
|
||||
*/
|
||||
void lv_spinbox_set_pos(lv_obj_t * obj, uint8_t pos)
|
||||
void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
lv_spinbox_t * spinbox = (lv_spinbox_t *)obj;
|
||||
|
@ -105,7 +105,7 @@ void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max);
|
||||
* @param obj pointer to spinbox
|
||||
* @param pos selected position in spinbox
|
||||
*/
|
||||
void lv_spinbox_set_pos(lv_obj_t * obj, uint8_t pos);
|
||||
void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint8_t pos);
|
||||
|
||||
/**
|
||||
* Set direction of digit step when clicking an encoder button while in editing mode
|
||||
@ -170,6 +170,10 @@ void lv_spinbox_decrement(lv_obj_t * obj);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/* It was ambiguous in MicroPython. See https://github.com/lvgl/lvgl/issues/3301
|
||||
* TODO remove in v9*/
|
||||
#define lv_spinbox_set_pos lv_spinbox_set_cursor_pos
|
||||
|
||||
#endif /*LV_USE_SPINBOX*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -141,8 +141,20 @@
|
||||
#endif
|
||||
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
|
||||
#if LV_MEM_ADR == 0
|
||||
//#define LV_MEM_POOL_INCLUDE your_alloc_library /* Uncomment if using an external allocator*/
|
||||
//#define LV_MEM_POOL_ALLOC your_alloc /* Uncomment if using an external allocator*/
|
||||
#ifndef LV_MEM_POOL_INCLUDE
|
||||
#ifdef CONFIG_LV_MEM_POOL_INCLUDE
|
||||
#define LV_MEM_POOL_INCLUDE CONFIG_LV_MEM_POOL_INCLUDE
|
||||
#else
|
||||
#undef LV_MEM_POOL_INCLUDE
|
||||
#endif
|
||||
#endif
|
||||
#ifndef LV_MEM_POOL_ALLOC
|
||||
#ifdef CONFIG_LV_MEM_POOL_ALLOC
|
||||
#define LV_MEM_POOL_ALLOC CONFIG_LV_MEM_POOL_ALLOC
|
||||
#else
|
||||
#undef LV_MEM_POOL_ALLOC
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else /*LV_MEM_CUSTOM*/
|
||||
@ -319,14 +331,14 @@
|
||||
#ifdef CONFIG_LV_LAYER_SIMPLE_BUF_SIZE
|
||||
#define LV_LAYER_SIMPLE_BUF_SIZE CONFIG_LV_LAYER_SIMPLE_BUF_SIZE
|
||||
#else
|
||||
#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
|
||||
#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
|
||||
#endif
|
||||
#endif
|
||||
#ifndef LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE
|
||||
#ifdef CONFIG_LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE
|
||||
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE CONFIG_LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE
|
||||
#else
|
||||
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE LV_MAX(lv_area_get_width(&draw_area) * px_size, 2048)
|
||||
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE LV_MAX(lv_area_get_width(&draw_area) * px_size, 2048)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -339,7 +351,7 @@
|
||||
#ifdef CONFIG_LV_IMG_CACHE_DEF_SIZE
|
||||
#define LV_IMG_CACHE_DEF_SIZE CONFIG_LV_IMG_CACHE_DEF_SIZE
|
||||
#else
|
||||
#define LV_IMG_CACHE_DEF_SIZE 0
|
||||
#define LV_IMG_CACHE_DEF_SIZE 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -349,7 +361,7 @@
|
||||
#ifdef CONFIG_LV_GRADIENT_MAX_STOPS
|
||||
#define LV_GRADIENT_MAX_STOPS CONFIG_LV_GRADIENT_MAX_STOPS
|
||||
#else
|
||||
#define LV_GRADIENT_MAX_STOPS 2
|
||||
#define LV_GRADIENT_MAX_STOPS 2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -362,7 +374,7 @@
|
||||
#ifdef CONFIG_LV_GRAD_CACHE_DEF_SIZE
|
||||
#define LV_GRAD_CACHE_DEF_SIZE CONFIG_LV_GRAD_CACHE_DEF_SIZE
|
||||
#else
|
||||
#define LV_GRAD_CACHE_DEF_SIZE 0
|
||||
#define LV_GRAD_CACHE_DEF_SIZE 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -373,7 +385,7 @@
|
||||
#ifdef CONFIG_LV_DITHER_GRADIENT
|
||||
#define LV_DITHER_GRADIENT CONFIG_LV_DITHER_GRADIENT
|
||||
#else
|
||||
#define LV_DITHER_GRADIENT 0
|
||||
#define LV_DITHER_GRADIENT 0
|
||||
#endif
|
||||
#endif
|
||||
#if LV_DITHER_GRADIENT
|
||||
@ -384,7 +396,7 @@
|
||||
#ifdef CONFIG_LV_DITHER_ERROR_DIFFUSION
|
||||
#define LV_DITHER_ERROR_DIFFUSION CONFIG_LV_DITHER_ERROR_DIFFUSION
|
||||
#else
|
||||
#define LV_DITHER_ERROR_DIFFUSION 0
|
||||
#define LV_DITHER_ERROR_DIFFUSION 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@ -1333,18 +1345,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_ANIMIMG
|
||||
#ifdef _LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_ANIMIMG
|
||||
#define LV_USE_ANIMIMG CONFIG_LV_USE_ANIMIMG
|
||||
#else
|
||||
#define LV_USE_ANIMIMG 0
|
||||
#endif
|
||||
#else
|
||||
#define LV_USE_ANIMIMG 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_BAR
|
||||
#ifdef _LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_BAR
|
||||
@ -1562,6 +1562,18 @@
|
||||
/*-----------
|
||||
* Widgets
|
||||
*----------*/
|
||||
#ifndef LV_USE_ANIMIMG
|
||||
#ifdef _LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_ANIMIMG
|
||||
#define LV_USE_ANIMIMG CONFIG_LV_USE_ANIMIMG
|
||||
#else
|
||||
#define LV_USE_ANIMIMG 0
|
||||
#endif
|
||||
#else
|
||||
#define LV_USE_ANIMIMG 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_CALENDAR
|
||||
#ifdef _LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_CALENDAR
|
||||
@ -1738,6 +1750,28 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_SPAN
|
||||
#ifdef _LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_SPAN
|
||||
#define LV_USE_SPAN CONFIG_LV_USE_SPAN
|
||||
#else
|
||||
#define LV_USE_SPAN 0
|
||||
#endif
|
||||
#else
|
||||
#define LV_USE_SPAN 1
|
||||
#endif
|
||||
#endif
|
||||
#if LV_USE_SPAN
|
||||
/*A line text can contain maximum num of span descriptor */
|
||||
#ifndef LV_SPAN_SNIPPET_STACK_SIZE
|
||||
#ifdef CONFIG_LV_SPAN_SNIPPET_STACK_SIZE
|
||||
#define LV_SPAN_SNIPPET_STACK_SIZE CONFIG_LV_SPAN_SNIPPET_STACK_SIZE
|
||||
#else
|
||||
#define LV_SPAN_SNIPPET_STACK_SIZE 64
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_SPINBOX
|
||||
#ifdef _LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_SPINBOX
|
||||
@ -1798,28 +1832,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LV_USE_SPAN
|
||||
#ifdef _LV_KCONFIG_PRESENT
|
||||
#ifdef CONFIG_LV_USE_SPAN
|
||||
#define LV_USE_SPAN CONFIG_LV_USE_SPAN
|
||||
#else
|
||||
#define LV_USE_SPAN 0
|
||||
#endif
|
||||
#else
|
||||
#define LV_USE_SPAN 1
|
||||
#endif
|
||||
#endif
|
||||
#if LV_USE_SPAN
|
||||
/*A line text can contain maximum num of span descriptor */
|
||||
#ifndef LV_SPAN_SNIPPET_STACK_SIZE
|
||||
#ifdef CONFIG_LV_SPAN_SNIPPET_STACK_SIZE
|
||||
#define LV_SPAN_SNIPPET_STACK_SIZE CONFIG_LV_SPAN_SNIPPET_STACK_SIZE
|
||||
#else
|
||||
#define LV_SPAN_SNIPPET_STACK_SIZE 64
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*-----------
|
||||
* Themes
|
||||
*----------*/
|
||||
@ -1959,7 +1971,7 @@
|
||||
#ifdef CONFIG_LV_FS_STDIO_CACHE_SIZE
|
||||
#define LV_FS_STDIO_CACHE_SIZE CONFIG_LV_FS_STDIO_CACHE_SIZE
|
||||
#else
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@ -1991,7 +2003,7 @@
|
||||
#ifdef CONFIG_LV_FS_POSIX_CACHE_SIZE
|
||||
#define LV_FS_POSIX_CACHE_SIZE CONFIG_LV_FS_POSIX_CACHE_SIZE
|
||||
#else
|
||||
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@ -2009,7 +2021,7 @@
|
||||
#ifdef CONFIG_LV_FS_WIN32_LETTER
|
||||
#define LV_FS_WIN32_LETTER CONFIG_LV_FS_WIN32_LETTER
|
||||
#else
|
||||
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#endif
|
||||
#endif
|
||||
#ifndef LV_FS_WIN32_PATH
|
||||
@ -2033,7 +2045,7 @@
|
||||
#ifdef CONFIG_LV_USE_FS_FATFS
|
||||
#define LV_USE_FS_FATFS CONFIG_LV_USE_FS_FATFS
|
||||
#else
|
||||
#define LV_USE_FS_FATFS 0
|
||||
#define LV_USE_FS_FATFS 0
|
||||
#endif
|
||||
#endif
|
||||
#if LV_USE_FS_FATFS
|
||||
@ -2161,7 +2173,7 @@
|
||||
#ifdef CONFIG_LV_USE_FFMPEG
|
||||
#define LV_USE_FFMPEG CONFIG_LV_USE_FFMPEG
|
||||
#else
|
||||
#define LV_USE_FFMPEG 0
|
||||
#define LV_USE_FFMPEG 0
|
||||
#endif
|
||||
#endif
|
||||
#if LV_USE_FFMPEG
|
||||
@ -2193,7 +2205,7 @@
|
||||
#ifdef CONFIG_LV_USE_MONKEY
|
||||
#define LV_USE_MONKEY CONFIG_LV_USE_MONKEY
|
||||
#else
|
||||
#define LV_USE_MONKEY 0
|
||||
#define LV_USE_MONKEY 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -2202,7 +2214,7 @@
|
||||
#ifdef CONFIG_LV_USE_GRIDNAV
|
||||
#define LV_USE_GRIDNAV CONFIG_LV_USE_GRIDNAV
|
||||
#else
|
||||
#define LV_USE_GRIDNAV 0
|
||||
#define LV_USE_GRIDNAV 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -2259,7 +2271,7 @@
|
||||
#ifdef CONFIG_LV_USE_DEMO_WIDGETS
|
||||
#define LV_USE_DEMO_WIDGETS CONFIG_LV_USE_DEMO_WIDGETS
|
||||
#else
|
||||
#define LV_USE_DEMO_WIDGETS 0
|
||||
#define LV_USE_DEMO_WIDGETS 0
|
||||
#endif
|
||||
#endif
|
||||
#if LV_USE_DEMO_WIDGETS
|
||||
@ -2267,7 +2279,7 @@
|
||||
#ifdef CONFIG_LV_DEMO_WIDGETS_SLIDESHOW
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW CONFIG_LV_DEMO_WIDGETS_SLIDESHOW
|
||||
#else
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW 0
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@ -2277,7 +2289,7 @@
|
||||
#ifdef CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER
|
||||
#else
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -2286,7 +2298,7 @@
|
||||
#ifdef CONFIG_LV_USE_DEMO_BENCHMARK
|
||||
#define LV_USE_DEMO_BENCHMARK CONFIG_LV_USE_DEMO_BENCHMARK
|
||||
#else
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -2295,7 +2307,7 @@
|
||||
#ifdef CONFIG_LV_USE_DEMO_STRESS
|
||||
#define LV_USE_DEMO_STRESS CONFIG_LV_USE_DEMO_STRESS
|
||||
#else
|
||||
#define LV_USE_DEMO_STRESS 0
|
||||
#define LV_USE_DEMO_STRESS 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -2304,46 +2316,46 @@
|
||||
#ifdef CONFIG_LV_USE_DEMO_MUSIC
|
||||
#define LV_USE_DEMO_MUSIC CONFIG_LV_USE_DEMO_MUSIC
|
||||
#else
|
||||
#define LV_USE_DEMO_MUSIC 0
|
||||
#define LV_USE_DEMO_MUSIC 0
|
||||
#endif
|
||||
#endif
|
||||
#if LV_USE_DEMO_MUSIC
|
||||
#ifndef LV_DEMO_MUSIC_SQUARE
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_SQUARE
|
||||
#define LV_DEMO_MUSIC_SQUARE CONFIG_LV_DEMO_MUSIC_SQUARE
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_SQUARE 0
|
||||
#ifndef LV_DEMO_MUSIC_SQUARE
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_SQUARE
|
||||
#define LV_DEMO_MUSIC_SQUARE CONFIG_LV_DEMO_MUSIC_SQUARE
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_SQUARE 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifndef LV_DEMO_MUSIC_LANDSCAPE
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_LANDSCAPE
|
||||
#define LV_DEMO_MUSIC_LANDSCAPE CONFIG_LV_DEMO_MUSIC_LANDSCAPE
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_LANDSCAPE 0
|
||||
#ifndef LV_DEMO_MUSIC_LANDSCAPE
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_LANDSCAPE
|
||||
#define LV_DEMO_MUSIC_LANDSCAPE CONFIG_LV_DEMO_MUSIC_LANDSCAPE
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_LANDSCAPE 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifndef LV_DEMO_MUSIC_ROUND
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_ROUND
|
||||
#define LV_DEMO_MUSIC_ROUND CONFIG_LV_DEMO_MUSIC_ROUND
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_ROUND 0
|
||||
#ifndef LV_DEMO_MUSIC_ROUND
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_ROUND
|
||||
#define LV_DEMO_MUSIC_ROUND CONFIG_LV_DEMO_MUSIC_ROUND
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_ROUND 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifndef LV_DEMO_MUSIC_LARGE
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_LARGE
|
||||
#define LV_DEMO_MUSIC_LARGE CONFIG_LV_DEMO_MUSIC_LARGE
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_LARGE 0
|
||||
#ifndef LV_DEMO_MUSIC_LARGE
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_LARGE
|
||||
#define LV_DEMO_MUSIC_LARGE CONFIG_LV_DEMO_MUSIC_LARGE
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_LARGE 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifndef LV_DEMO_MUSIC_AUTO_PLAY
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_AUTO_PLAY
|
||||
#define LV_DEMO_MUSIC_AUTO_PLAY CONFIG_LV_DEMO_MUSIC_AUTO_PLAY
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_AUTO_PLAY 0
|
||||
#ifndef LV_DEMO_MUSIC_AUTO_PLAY
|
||||
#ifdef CONFIG_LV_DEMO_MUSIC_AUTO_PLAY
|
||||
#define LV_DEMO_MUSIC_AUTO_PLAY CONFIG_LV_DEMO_MUSIC_AUTO_PLAY
|
||||
#else
|
||||
#define LV_DEMO_MUSIC_AUTO_PLAY 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -41,6 +41,50 @@ extern "C" {
|
||||
# define CONFIG_LV_MEM_SIZE (CONFIG_LV_MEM_SIZE_KILOBYTES * 1024U)
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* MONITOR POSITION
|
||||
*-----------------*/
|
||||
|
||||
#ifdef CONFIG_LV_PERF_MONITOR_ALIGN_TOP_LEFT
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_LEFT
|
||||
#elif defined(CONFIG_LV_USE_PERF_MONITOR_ALIGN_TOP_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_TOP_RIGHT)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_RIGHT
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_LEFT)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_LEFT_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_LEFT_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_RIGHT_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_RIGHT_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_CENTER)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_CENTER
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LV_MEM_MONITOR_ALIGN_TOP_LEFT
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_LEFT
|
||||
#elif defined(CONFIG_LV_USE_MEM_MONITOR_ALIGN_TOP_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_TOP_RIGHT)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_RIGHT
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_RIGHT)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_LEFT_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_LEFT_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_RIGHT_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_RIGHT_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_CENTER)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_CENTER
|
||||
#endif
|
||||
|
||||
/********************
|
||||
* FONT SELECTION
|
||||
*******************/
|
||||
@ -131,50 +175,6 @@ extern "C" {
|
||||
# define CONFIG_LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
|
||||
#endif
|
||||
|
||||
/*------------------
|
||||
* MONITOR POSITION
|
||||
*-----------------*/
|
||||
|
||||
#ifdef CONFIG_LV_PERF_MONITOR_ALIGN_TOP_LEFT
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_LEFT
|
||||
#elif defined(CONFIG_LV_USE_PERF_MONITOR_ALIGN_TOP_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_TOP_RIGHT)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_RIGHT
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_LEFT)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_LEFT_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_LEFT_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_RIGHT_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_RIGHT_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_CENTER)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_CENTER
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LV_MEM_MONITOR_ALIGN_TOP_LEFT
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_LEFT
|
||||
#elif defined(CONFIG_LV_USE_MEM_MONITOR_ALIGN_TOP_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_TOP_RIGHT)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_RIGHT
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_BOTTOM_RIGHT)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_LEFT_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_LEFT_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_RIGHT_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_RIGHT_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_CENTER)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_CENTER
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
@ -177,6 +177,11 @@ lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct _lv_timer_t * lv_anim_get_timer(void)
|
||||
{
|
||||
return _lv_anim_tmr;
|
||||
}
|
||||
|
||||
uint16_t lv_anim_count_running(void)
|
||||
{
|
||||
uint16_t cnt = 0;
|
||||
|
@ -40,6 +40,7 @@ typedef enum {
|
||||
} lv_anim_enable_t;
|
||||
|
||||
struct _lv_anim_t;
|
||||
struct _lv_timer_t;
|
||||
|
||||
/** Get the current value during an animation*/
|
||||
typedef int32_t (*lv_anim_path_cb_t)(const struct _lv_anim_t *);
|
||||
@ -345,6 +346,12 @@ void lv_anim_del_all(void);
|
||||
*/
|
||||
lv_anim_t * lv_anim_get(void * var, lv_anim_exec_xcb_t exec_cb);
|
||||
|
||||
/**
|
||||
* Get global animation refresher timer.
|
||||
* @return pointer to the animation refresher timer.
|
||||
*/
|
||||
struct _lv_timer_t * lv_anim_get_timer(void);
|
||||
|
||||
/**
|
||||
* Delete an animation by getting the animated variable from `a`.
|
||||
* Only animations with `exec_cb` will be deleted.
|
||||
|
@ -40,8 +40,8 @@ const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PR
|
||||
[LV_STYLE_TRANSFORM_HEIGHT] = LV_STYLE_PROP_EXT_DRAW,
|
||||
[LV_STYLE_TRANSLATE_X] = LV_STYLE_PROP_LAYOUT_REFR | LV_STYLE_PROP_PARENT_LAYOUT_REFR,
|
||||
[LV_STYLE_TRANSLATE_Y] = LV_STYLE_PROP_LAYOUT_REFR | LV_STYLE_PROP_PARENT_LAYOUT_REFR,
|
||||
[LV_STYLE_TRANSFORM_ZOOM] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR | LV_STYLE_PROP_PARENT_LAYOUT_REFR,
|
||||
[LV_STYLE_TRANSFORM_ANGLE] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR | LV_STYLE_PROP_PARENT_LAYOUT_REFR,
|
||||
[LV_STYLE_TRANSFORM_ZOOM] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYER_REFR,
|
||||
[LV_STYLE_TRANSFORM_ANGLE] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYER_REFR,
|
||||
|
||||
[LV_STYLE_PAD_TOP] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR,
|
||||
[LV_STYLE_PAD_BOTTOM] = LV_STYLE_PROP_EXT_DRAW | LV_STYLE_PROP_LAYOUT_REFR,
|
||||
@ -110,13 +110,13 @@ const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PR
|
||||
|
||||
[LV_STYLE_RADIUS] = 0,
|
||||
[LV_STYLE_CLIP_CORNER] = 0,
|
||||
[LV_STYLE_OPA] = 0,
|
||||
[LV_STYLE_OPA] = LV_STYLE_PROP_LAYER_REFR,
|
||||
[LV_STYLE_COLOR_FILTER_DSC] = LV_STYLE_PROP_INHERIT,
|
||||
[LV_STYLE_COLOR_FILTER_OPA] = LV_STYLE_PROP_INHERIT,
|
||||
[LV_STYLE_ANIM_TIME] = 0,
|
||||
[LV_STYLE_ANIM_SPEED] = 0,
|
||||
[LV_STYLE_TRANSITION] = 0,
|
||||
[LV_STYLE_BLEND_MODE] = 0,
|
||||
[LV_STYLE_BLEND_MODE] = LV_STYLE_PROP_LAYER_REFR,
|
||||
[LV_STYLE_LAYOUT] = LV_STYLE_PROP_LAYOUT_REFR,
|
||||
[LV_STYLE_BASE_DIR] = LV_STYLE_PROP_INHERIT | LV_STYLE_PROP_LAYOUT_REFR,
|
||||
};
|
||||
|
@ -40,7 +40,8 @@ extern "C" {
|
||||
#define LV_STYLE_PROP_EXT_DRAW (1 << 1) /*Requires ext. draw size update when changed*/
|
||||
#define LV_STYLE_PROP_LAYOUT_REFR (1 << 2) /*Requires layout update when changed*/
|
||||
#define LV_STYLE_PROP_PARENT_LAYOUT_REFR (1 << 3) /*Requires layout update on parent when changed*/
|
||||
#define LV_STYLE_PROP_ALL (0xf) /*Indicating all flags*/
|
||||
#define LV_STYLE_PROP_LAYER_REFR (1 << 4) /*Affects layer handling*/
|
||||
#define LV_STYLE_PROP_ALL (0x1F) /*Indicating all flags*/
|
||||
|
||||
/**
|
||||
* Other constants
|
||||
|
Loading…
Reference in New Issue
Block a user