lib/lvgl: update from v8.3.1 to latest v8.3.11

git subtree --prefix=lib/lvgl --squash pull \
      https://github.com/lvgl/lvgl v8.3.11

v8.3 release notes: https://docs.lvgl.io/8.3/CHANGELOG.html
master
alex 9 months ago
commit bc87a57de2
Signed by: x1ddos
GPG Key ID: FDEFB4A63CBD8460

@ -8,7 +8,7 @@ jobs:
build: build:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
name: Build ${{ matrix.port }} port name: Build ${{ matrix.port }} port
runs-on: ubuntu-latest runs-on: ubuntu-20.04
continue-on-error: true continue-on-error: true
strategy: strategy:
matrix: matrix:
@ -23,7 +23,7 @@ jobs:
- name: Clone lv_micropython - name: Clone lv_micropython
run: | run: |
git clone https://github.com/lvgl/lv_micropython.git . git clone https://github.com/lvgl/lv_micropython.git .
git checkout master git checkout release/v8
- name: Initialize lv_bindings submodule - name: Initialize lv_bindings submodule
run: git submodule update --init --recursive lib/lv_bindings run: git submodule update --init --recursive lib/lv_bindings
- name: Update ${{ matrix.port }} port submodules - name: Update ${{ matrix.port }} port submodules

@ -3,21 +3,21 @@ name: Push LVGL release to Espressif Component Service
# If the commit is tagged, it will be uploaded. Other scenario silently fail. # If the commit is tagged, it will be uploaded. Other scenario silently fail.
on: on:
push: push:
branches: tags:
- master - v*
jobs: jobs:
upload_components: upload_components:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@v2
with: with:
submodules: "recursive" submodules: "recursive"
- name: Upload component to component registry - name: Upload component to component registry
uses: espressif/github-actions/upload_components@master uses: espressif/upload-components-ci-action@v1
with: with:
name: "lvgl" name: "lvgl"
version: "git" version: ${{ github.ref_name }}
namespace: "lvgl" namespace: "lvgl"
api_token: ${{ secrets.ESP_IDF_COMPONENT_API_TOKEN }} api_token: ${{ secrets.ESP_IDF_COMPONENT_API_TOKEN }}

@ -42,11 +42,9 @@ menu "LVGL configuration"
config LV_COLOR_SCREEN_TRANSP config LV_COLOR_SCREEN_TRANSP
bool "Enable more complex drawing routines to manage screens transparency." bool "Enable more complex drawing routines to manage screens transparency."
depends on LV_COLOR_DEPTH_32
help help
Can be used if the UI is above another layer, e.g. an OSD menu or video player. Can be used if the UI is above another layer, e.g. an OSD menu or video player.
Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to The screen's `bg_opa` should be set to non LV_OPA_COVER value
non LV_OPA_COVER value
config LV_COLOR_MIX_ROUND_OFS config LV_COLOR_MIX_ROUND_OFS
int "Adjust color mix functions rounding" int "Adjust color mix functions rounding"
@ -230,6 +228,16 @@ menu "LVGL configuration"
Must be defined to include path of CMSIS header of target processor Must be defined to include path of CMSIS header of target processor
e.g. "stm32f769xx.h" or "stm32f429xx.h" e.g. "stm32f769xx.h" or "stm32f429xx.h"
config LV_USE_GPU_RA6M3_G2D
bool "Enable RA6M3 G2D GPU."
config LV_GPU_RA6M3_G2D_INCLUDE
string "include path of target processor"
depends on LV_USE_GPU_RA6M3_G2D
default "hal_data.h"
help
Must be defined to include path of target processor
e.g. "hal_data.h"
config LV_USE_GPU_SWM341_DMA2D config LV_USE_GPU_SWM341_DMA2D
bool "Enable SWM341 DMA2D GPU." bool "Enable SWM341 DMA2D GPU."
config LV_GPU_SWM341_DMA2D_INCLUDE config LV_GPU_SWM341_DMA2D_INCLUDE
@ -913,7 +921,8 @@ menu "LVGL configuration"
string "Set the working directory" string "Set the working directory"
depends on LV_USE_FS_STDIO depends on LV_USE_FS_STDIO
config LV_FS_STDIO_CACHE_SIZE config LV_FS_STDIO_CACHE_SIZE
string ">0 to cache this number of bytes in lv_fs_read()" int ">0 to cache this number of bytes in lv_fs_read()"
default 0
depends on LV_USE_FS_STDIO depends on LV_USE_FS_STDIO
config LV_USE_FS_POSIX config LV_USE_FS_POSIX
@ -955,6 +964,17 @@ menu "LVGL configuration"
default 0 default 0
depends on LV_USE_FS_FATFS depends on LV_USE_FS_FATFS
config LV_USE_FS_LITTLEFS
bool "File system on top of LittleFS"
config LV_FS_LITTLEFS_LETTER
int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)"
default 0
depends on LV_USE_FS_LITTLEFS
config LV_FS_LITTLEFS_CACHE_SIZE
int ">0 to cache this number of bytes in lv_fs_read()"
default 0
depends on LV_USE_FS_LITTLEFS
config LV_USE_PNG config LV_USE_PNG
bool "PNG decoder library" bool "PNG decoder library"
@ -991,6 +1011,13 @@ menu "LVGL configuration"
endmenu endmenu
endif endif
config LV_USE_TINY_TTF
bool "Tiny TTF library"
config LV_TINY_TTF_FILE_SUPPORT
bool "Load TTF data from files"
depends on LV_USE_TINY_TTF
default n
config LV_USE_RLOTTIE config LV_USE_RLOTTIE
bool "Lottie library" bool "Lottie library"

@ -1,9 +1,4 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE) #include "../../../lvgl.h"
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN #ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN #define LV_ATTRIBUTE_MEM_ALIGN

@ -89,7 +89,7 @@ LV_FONT_DECLARE(lv_font_benchmark_montserrat_16_compr_az);
LV_FONT_DECLARE(lv_font_benchmark_montserrat_28_compr_az); LV_FONT_DECLARE(lv_font_benchmark_montserrat_28_compr_az);
static void monitor_cb(lv_disp_drv_t * drv, uint32_t time, uint32_t px); static void monitor_cb(lv_disp_drv_t * drv, uint32_t time, uint32_t px);
static void scene_next_task_cb(lv_timer_t * timer); static void next_scene_timer_cb(lv_timer_t * timer);
static void rect_create(lv_style_t * style); static void rect_create(lv_style_t * style);
static void img_create(lv_style_t * style, const void * src, bool rotate, bool zoom, bool aa); static void img_create(lv_style_t * style, const void * src, bool rotate, bool zoom, bool aa);
static void txt_create(lv_style_t * style); static void txt_create(lv_style_t * style);
@ -636,7 +636,7 @@ static lv_obj_t * scene_bg;
static lv_obj_t * title; static lv_obj_t * title;
static lv_obj_t * subtitle; static lv_obj_t * subtitle;
static uint32_t rnd_act; static uint32_t rnd_act;
static lv_timer_t * next_scene_timer;
static const uint32_t rnd_map[] = { static const uint32_t rnd_map[] = {
0xbd13204f, 0x67d8167f, 0x20211c99, 0xb0a7cc05, 0xbd13204f, 0x67d8167f, 0x20211c99, 0xb0a7cc05,
@ -708,9 +708,21 @@ void lv_demo_benchmark(void)
benchmark_init(); benchmark_init();
/*Manually start scenes*/ /*Manually start scenes*/
scene_next_task_cb(NULL); next_scene_timer_cb(NULL);
} }
void lv_demo_benchmark_close(void)
{
if(next_scene_timer) lv_timer_del(next_scene_timer);
next_scene_timer = NULL;
lv_anim_del(NULL, NULL);
lv_style_reset(&style_common);
lv_obj_clean(lv_scr_act());
}
void lv_demo_benchmark_run_scene(int_fast16_t scene_no) void lv_demo_benchmark_run_scene(int_fast16_t scene_no)
{ {
@ -725,7 +737,8 @@ void lv_demo_benchmark_run_scene(int_fast16_t scene_no)
scene_act = scene_no >> 1; scene_act = scene_no >> 1;
if(scenes[scene_act].create_cb) { 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, lv_label_set_text_fmt(title, "%"LV_PRId32"/%"LV_PRId32": %s%s", scene_act * 2 + (opa_mode ? 1 : 0),
(int32_t)(dimof(scenes) * 2) - 2,
scenes[scene_act].name, opa_mode ? " + opa" : ""); scenes[scene_act].name, opa_mode ? " + opa" : "");
lv_label_set_text(subtitle, ""); lv_label_set_text(subtitle, "");
@ -972,11 +985,13 @@ static void report_cb(lv_timer_t * timer)
} }
} }
static void scene_next_task_cb(lv_timer_t * timer) static void next_scene_timer_cb(lv_timer_t * timer)
{ {
LV_UNUSED(timer); LV_UNUSED(timer);
lv_obj_clean(scene_bg); lv_obj_clean(scene_bg);
next_scene_timer = NULL;
if(opa_mode) { if(opa_mode) {
if(scene_act >= 0) { if(scene_act >= 0) {
if(scenes[scene_act].time_sum_opa == 0) scenes[scene_act].time_sum_opa = 1; if(scenes[scene_act].time_sum_opa == 0) scenes[scene_act].time_sum_opa = 1;
@ -995,8 +1010,8 @@ static void scene_next_task_cb(lv_timer_t * timer)
} }
if(scenes[scene_act].create_cb) { if(scenes[scene_act].create_cb) {
lv_label_set_text_fmt(title, "%"LV_PRId32"/%d: %s%s", scene_act * 2 + (opa_mode ? 1 : 0), lv_label_set_text_fmt(title, "%"LV_PRId32"/%"LV_PRId32": %s%s", scene_act * 2 + (opa_mode ? 1 : 0),
(int)(dimof(scenes) * 2) - 2, scenes[scene_act].name, opa_mode ? " + opa" : ""); (int32_t)(dimof(scenes) * 2) - 2, scenes[scene_act].name, opa_mode ? " + opa" : "");
if(opa_mode) { 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 of \"%s\": %"LV_PRId32" FPS", scenes[scene_act].name,
scenes[scene_act].fps_normal); scenes[scene_act].fps_normal);
@ -1013,8 +1028,8 @@ static void scene_next_task_cb(lv_timer_t * timer)
rnd_reset(); rnd_reset();
scenes[scene_act].create_cb(); scenes[scene_act].create_cb();
lv_timer_t * t = lv_timer_create(scene_next_task_cb, SCENE_TIME, NULL); next_scene_timer = lv_timer_create(next_scene_timer_cb, SCENE_TIME, NULL);
lv_timer_set_repeat_count(t, 1); lv_timer_set_repeat_count(next_scene_timer, 1);
} }
/*Ready*/ /*Ready*/

@ -30,6 +30,8 @@ typedef void finished_cb_t(void);
**********************/ **********************/
void lv_demo_benchmark(void); void lv_demo_benchmark(void);
void lv_demo_benchmark_close(void);
void lv_demo_benchmark_run_scene(int_fast16_t scene_no); void lv_demo_benchmark_run_scene(int_fast16_t scene_no);
void lv_demo_benchmark_set_finished_cb(finished_cb_t * finished_cb); void lv_demo_benchmark_set_finished_cb(finished_cb_t * finished_cb);

@ -46,8 +46,11 @@ static lv_obj_t * t2;
void lv_demo_keypad_encoder(void) void lv_demo_keypad_encoder(void)
{ {
g = lv_group_get_default();
if(g == NULL) {
g = lv_group_create(); g = lv_group_create();
lv_group_set_default(g); lv_group_set_default(g);
}
lv_indev_t * cur_drv = NULL; lv_indev_t * cur_drv = NULL;
for(;;) { for(;;) {
@ -76,6 +79,12 @@ void lv_demo_keypad_encoder(void)
msgbox_create(); msgbox_create();
} }
void lv_demo_keypad_encoder_close(void)
{
lv_obj_clean(lv_scr_act());
lv_obj_clean(lv_layer_top());
}
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/

@ -27,6 +27,7 @@ extern "C" {
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
void lv_demo_keypad_encoder(void); void lv_demo_keypad_encoder(void);
void lv_demo_keypad_encoder_close(void);
/********************** /**********************
* MACROS * MACROS

@ -103,6 +103,12 @@ static const uint32_t time_list[] = {
2 * 60 + 19, 2 * 60 + 19,
}; };
#if LV_DEMO_MUSIC_AUTO_PLAY
static lv_timer_t * auto_step_timer;
#endif
static lv_color_t original_screen_bg_color;
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/
@ -113,14 +119,31 @@ static const uint32_t time_list[] = {
void lv_demo_music(void) void lv_demo_music(void)
{ {
original_screen_bg_color = lv_obj_get_style_bg_color(lv_scr_act(), 0);
lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x343247), 0); lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x343247), 0);
list = _lv_demo_music_list_create(lv_scr_act()); list = _lv_demo_music_list_create(lv_scr_act());
ctrl = _lv_demo_music_main_create(lv_scr_act()); ctrl = _lv_demo_music_main_create(lv_scr_act());
#if LV_DEMO_MUSIC_AUTO_PLAY #if LV_DEMO_MUSIC_AUTO_PLAY
lv_timer_create(auto_step_cb, 1000, NULL); auto_step_timer = lv_timer_create(auto_step_cb, 1000, NULL);
#endif
}
void lv_demo_music_close(void)
{
/*Delete all aniamtions*/
lv_anim_del(NULL, NULL);
#if LV_DEMO_MUSIC_AUTO_PLAY
lv_timer_del(auto_step_timer);
#endif #endif
_lv_demo_music_list_close();
_lv_demo_music_main_close();
lv_obj_clean(lv_scr_act());
lv_obj_set_style_bg_color(lv_scr_act(), original_screen_bg_color, 0);
} }
const char * _lv_demo_music_get_title(uint32_t track_id) const char * _lv_demo_music_get_title(uint32_t track_id)

@ -36,6 +36,8 @@ extern "C" {
**********************/ **********************/
void lv_demo_music(void); void lv_demo_music(void);
void lv_demo_music_close(void);
const char * _lv_demo_music_get_title(uint32_t track_id); const char * _lv_demo_music_get_title(uint32_t track_id);
const char * _lv_demo_music_get_artist(uint32_t track_id); const char * _lv_demo_music_get_artist(uint32_t track_id);
const char * _lv_demo_music_get_genre(uint32_t track_id); const char * _lv_demo_music_get_genre(uint32_t track_id);

@ -130,6 +130,19 @@ lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent)
return list; return list;
} }
void _lv_demo_music_list_close(void)
{
lv_style_reset(&style_scrollbar);
lv_style_reset(&style_btn);
lv_style_reset(&style_btn_pr);
lv_style_reset(&style_btn_chk);
lv_style_reset(&style_btn_dis);
lv_style_reset(&style_title);
lv_style_reset(&style_artist);
lv_style_reset(&style_time);
}
void _lv_demo_music_list_btn_check(uint32_t track_id, bool state) void _lv_demo_music_list_btn_check(uint32_t track_id, bool state)
{ {
lv_obj_t * btn = lv_obj_get_child(list, track_id); lv_obj_t * btn = lv_obj_get_child(list, track_id);

@ -28,6 +28,8 @@ extern "C" {
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent); lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent);
void _lv_demo_music_list_close(void);
void _lv_demo_music_list_btn_check(uint32_t track_id, bool state); void _lv_demo_music_list_btn_check(uint32_t track_id, bool state);
/********************** /**********************

@ -60,7 +60,7 @@ static void prev_click_event_cb(lv_event_t * e);
static void next_click_event_cb(lv_event_t * e); static void next_click_event_cb(lv_event_t * e);
static void timer_cb(lv_timer_t * t); static void timer_cb(lv_timer_t * t);
static void track_load(uint32_t id); static void track_load(uint32_t id);
static void stop_start_anim(lv_timer_t * t); static void stop_start_anim_timer_cb(lv_timer_t * t);
static void spectrum_end_cb(lv_anim_t * a); static void spectrum_end_cb(lv_anim_t * a);
static void album_fade_anim_cb(void * var, int32_t v); static void album_fade_anim_cb(void * var, int32_t v);
static int32_t get_cos(int32_t deg, int32_t a); static int32_t get_cos(int32_t deg, int32_t a);
@ -84,6 +84,7 @@ static uint32_t spectrum_lane_ofs_start = 0;
static uint32_t bar_rot = 0; static uint32_t bar_rot = 0;
static uint32_t time_act; static uint32_t time_act;
static lv_timer_t * sec_counter_timer; static lv_timer_t * sec_counter_timer;
static lv_timer_t * stop_start_anim_timer;
static const lv_font_t * font_small; static const lv_font_t * font_small;
static const lv_font_t * font_large; static const lv_font_t * font_large;
static uint32_t track_id; static uint32_t track_id;
@ -232,8 +233,8 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
start_anim = true; start_anim = true;
lv_timer_t * timer = lv_timer_create(stop_start_anim, INTRO_TIME + 6000, NULL); stop_start_anim_timer = lv_timer_create(stop_start_anim_timer_cb, INTRO_TIME + 6000, NULL);
lv_timer_set_repeat_count(timer, 1); lv_timer_set_repeat_count(stop_start_anim_timer, 1);
lv_anim_init(&a); lv_anim_init(&a);
lv_anim_set_path_cb(&a, lv_anim_path_bounce); lv_anim_set_path_cb(&a, lv_anim_path_bounce);
@ -292,6 +293,12 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
return main_cont; return main_cont;
} }
void _lv_demo_music_main_close(void)
{
if(stop_start_anim_timer) lv_timer_del(stop_start_anim_timer);
lv_timer_del(sec_counter_timer);
}
void _lv_demo_music_album_next(bool next) void _lv_demo_music_album_next(bool next)
{ {
uint32_t id = track_id; uint32_t id = track_id;
@ -762,7 +769,7 @@ static void spectrum_draw_event_cb(lv_event_t * e)
lv_obj_t * obj = lv_event_get_target(e); lv_obj_t * obj = lv_event_get_target(e);
lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e); lv_draw_ctx_t * draw_ctx = lv_event_get_draw_ctx(e);
lv_opa_t opa = lv_obj_get_style_opa(obj, LV_PART_MAIN); lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, LV_PART_MAIN);
if(opa < LV_OPA_MIN) return; if(opa < LV_OPA_MIN) return;
lv_point_t poly[4]; lv_point_t poly[4];
@ -990,10 +997,11 @@ static void spectrum_end_cb(lv_anim_t * a)
} }
static void stop_start_anim(lv_timer_t * t) static void stop_start_anim_timer_cb(lv_timer_t * t)
{ {
LV_UNUSED(t); LV_UNUSED(t);
start_anim = false; start_anim = false;
stop_start_anim_timer = NULL;
lv_obj_refresh_ext_draw_size(spectrum_obj); lv_obj_refresh_ext_draw_size(spectrum_obj);
} }

@ -28,6 +28,8 @@ extern "C" {
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent); lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent);
void _lv_demo_music_main_close(void);
void _lv_demo_music_play(uint32_t id); void _lv_demo_music_play(uint32_t id);
void _lv_demo_music_resume(void); void _lv_demo_music_resume(void);
void _lv_demo_music_pause(void); void _lv_demo_music_pause(void);

@ -25,7 +25,7 @@ static void msgbox_del(lv_timer_t * tmr);
static void set_y_anim(void * obj, int32_t v); static void set_y_anim(void * obj, int32_t v);
static void set_width_anim(void * obj, int32_t v); static void set_width_anim(void * obj, int32_t v);
static void arc_set_end_angle_anim(void * obj, int32_t v); static void arc_set_end_angle_anim(void * obj, int32_t v);
static void obj_test_task_cb(lv_timer_t * tmr); static void obj_test_timer_cb(lv_timer_t * tmr);
/********************** /**********************
* STATIC VARIABLES * STATIC VARIABLES
@ -34,6 +34,10 @@ static lv_obj_t * main_page;
static lv_obj_t * ta; static lv_obj_t * ta;
static const char * mbox_btns[] = {"Ok", "Cancel", ""}; static const char * mbox_btns[] = {"Ok", "Cancel", ""};
static uint32_t mem_free_start = 0; static uint32_t mem_free_start = 0;
static lv_timer_t * obj_test_timer;
static int16_t state;
static lv_timer_t * msgbox_tmr;
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/
@ -45,23 +49,34 @@ static uint32_t mem_free_start = 0;
void lv_demo_stress(void) void lv_demo_stress(void)
{ {
LV_LOG_USER("Starting stress test. (< 100 bytes permanent memory leak is normal due to fragmentation)"); LV_LOG_USER("Starting stress test. (< 100 bytes permanent memory leak is normal due to fragmentation)");
lv_timer_create(obj_test_task_cb, LV_DEMO_STRESS_TIME_STEP, NULL); obj_test_timer = lv_timer_create(obj_test_timer_cb, LV_DEMO_STRESS_TIME_STEP, NULL);
state = -1;
}
void lv_demo_stress_close(void)
{
lv_timer_del(obj_test_timer);
obj_test_timer = NULL;
if(msgbox_tmr) {
lv_timer_del(msgbox_tmr);
msgbox_tmr = NULL;
}
lv_obj_clean(lv_scr_act());
lv_obj_clean(lv_layer_top());
} }
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
static void obj_test_task_cb(lv_timer_t * tmr) static void obj_test_timer_cb(lv_timer_t * tmr)
{ {
(void) tmr; /*Unused*/ (void) tmr; /*Unused*/
static int16_t state = -1;
lv_anim_t a; lv_anim_t a;
lv_obj_t * obj; lv_obj_t * obj;
// printf("step start: %d\n", state);
switch(state) { switch(state) {
case -1: { case -1: {
lv_res_t res = lv_mem_test(); lv_res_t res = lv_mem_test();
@ -246,8 +261,7 @@ static void obj_test_task_cb(lv_timer_t * tmr)
case 14: case 14:
obj = lv_msgbox_create(NULL, "Title", "Some text on the message box with average length", mbox_btns, true); obj = lv_msgbox_create(NULL, "Title", "Some text on the message box with average length", mbox_btns, true);
msgbox_tmr = lv_timer_create(msgbox_del, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj);
lv_timer_t * msgbox_tmr = lv_timer_create(msgbox_del, LV_DEMO_STRESS_TIME_STEP * 5 + 30, obj);
lv_timer_set_repeat_count(msgbox_tmr, 1); lv_timer_set_repeat_count(msgbox_tmr, 1);
lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0); lv_obj_align(obj, LV_ALIGN_RIGHT_MID, -10, 0);
break; break;
@ -439,6 +453,7 @@ static void auto_del(lv_obj_t * obj, uint32_t delay)
static void msgbox_del(lv_timer_t * tmr) static void msgbox_del(lv_timer_t * tmr)
{ {
msgbox_tmr = NULL;
lv_msgbox_close(tmr->user_data); lv_msgbox_close(tmr->user_data);
} }

@ -30,6 +30,8 @@ extern "C" {
**********************/ **********************/
void lv_demo_stress(void); void lv_demo_stress(void);
void lv_demo_stress_close(void);
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/

@ -86,6 +86,8 @@ static uint32_t session_desktop = 1000;
static uint32_t session_tablet = 1000; static uint32_t session_tablet = 1000;
static uint32_t session_mobile = 1000; static uint32_t session_mobile = 1000;
static lv_timer_t * meter2_timer;
/********************** /**********************
* MACROS * MACROS
**********************/ **********************/
@ -196,6 +198,22 @@ void lv_demo_widgets(void)
color_changer_create(tv); color_changer_create(tv);
} }
void lv_demo_widgets_close(void)
{
/*Delete all animation*/
lv_anim_del(NULL, NULL);
lv_timer_del(meter2_timer);
meter2_timer = NULL;
lv_obj_clean(lv_scr_act());
lv_style_reset(&style_text_muted);
lv_style_reset(&style_title);
lv_style_reset(&style_icon);
lv_style_reset(&style_bullet);
}
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
@ -205,6 +223,7 @@ static void profile_create(lv_obj_t * parent)
lv_obj_t * panel1 = lv_obj_create(parent); lv_obj_t * panel1 = lv_obj_create(parent);
lv_obj_set_height(panel1, LV_SIZE_CONTENT); lv_obj_set_height(panel1, LV_SIZE_CONTENT);
LV_IMG_DECLARE(img_demo_widgets_avatar); LV_IMG_DECLARE(img_demo_widgets_avatar);
lv_obj_t * avatar = lv_img_create(panel1); lv_obj_t * avatar = lv_img_create(panel1);
lv_img_set_src(avatar, &img_demo_widgets_avatar); lv_img_set_src(avatar, &img_demo_widgets_avatar);
@ -698,7 +717,7 @@ static void analytics_create(lv_obj_t * parent)
lv_meter_set_indicator_start_value(meter2, meter2_indic[2], 70); lv_meter_set_indicator_start_value(meter2, meter2_indic[2], 70);
lv_meter_set_indicator_end_value(meter2, meter2_indic[2], 99); lv_meter_set_indicator_end_value(meter2, meter2_indic[2], 99);
lv_timer_create(meter2_timer_cb, 100, meter2_indic); meter2_timer = lv_timer_create(meter2_timer_cb, 100, meter2_indic);
meter3 = create_meter_box(parent, "Network Speed", "Low speed", "Normal Speed", "High Speed"); meter3 = create_meter_box(parent, "Network Speed", "Low speed", "Normal Speed", "High Speed");
if(disp_size < DISP_LARGE) lv_obj_add_flag(lv_obj_get_parent(meter3), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); if(disp_size < DISP_LARGE) lv_obj_add_flag(lv_obj_get_parent(meter3), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);

@ -27,6 +27,7 @@ extern "C" {
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
void lv_demo_widgets(void); void lv_demo_widgets(void);
void lv_demo_widgets_close(void);
/********************** /**********************
* MACROS * MACROS

@ -1,5 +1,328 @@
# Changelog # Changelog
## [v8.3.11](https://github.com/lvgl/lvgl/compare/v8.3.11...v8.3.10) 6 December 2023
### New Features
- feat(table): add user_data to table cells [`4767`](https://github.com/lvgl/lvgl/pull/4767)
- feat(tiny_ttf): backport Tiny TTF to lvgl 8 [`4727`](https://github.com/lvgl/lvgl/pull/4727)
- feat(littlefs): add lv_fs_littlefs system as a driver [`4677`](https://github.com/lvgl/lvgl/pull/4677)
### Fixes
- fix(obj): readjust scroll after layout when child removed [`4921`](https://github.com/lvgl/lvgl/pull/4921)
- fix(rt-thread): fix create lvgl thread problem [`4862`](https://github.com/lvgl/lvgl/pull/4862)
- fix(obj): fix arduino compile warnings [`4807`](https://github.com/lvgl/lvgl/pull/4807)
- fix(table):fix issue with abnormal string output of 'lv_table_set_cell_value_fmt' [`4804`](https://github.com/lvgl/lvgl/pull/4804)
- fix(table) user data API functions renamed [`4769`](https://github.com/lvgl/lvgl/pull/4769)
- fix(ime_pinyin): keep cursor in the textarea when a candidate is pressed [`4731`](https://github.com/lvgl/lvgl/pull/4731)
- fix(draw_needles): changed needle line draw start point from scale ce… [`4682`](https://github.com/lvgl/lvgl/pull/4682)
- fix(arc): handle click outside background angle range (#4586) [`4667`](https://github.com/lvgl/lvgl/pull/4667)
- fix(meter): fix minor issues [`4657`](https://github.com/lvgl/lvgl/pull/4657)
- fix(draw): fix compiler error in lv_draw_sw_transform.c #2 [`4612`](https://github.com/lvgl/lvgl/pull/4612)
- fix(dropdown): avoid partial match in lv_dropdown_get_option_index [`4598`](https://github.com/lvgl/lvgl/pull/4598)
- fix(dropdown): reset char_i = 0, avoid access overflow [`4589`](https://github.com/lvgl/lvgl/pull/4589)
- fix(btnmatrix): set LV_BTNMATRIX_BTN_NONE when clicking of disabled button (#4571) [`4578`](https://github.com/lvgl/lvgl/pull/4578)
- fix(qrcode): use LV_ASSERT instead of assert [`1840dec`](https://github.com/lvgl/lvgl/commit/1840decb4136ba01552fcb7cedb0ff759824e2fd)
- fix: fix warning in lv_draw_sw_letter.c [`d22cda3`](https://github.com/lvgl/lvgl/commit/d22cda3cdb15cee95763491db95753980846d9f9)
- fix(arc): fix setting value by click [`20b6199`](https://github.com/lvgl/lvgl/commit/20b6199ba90319942c3cd91f2c727da6cd40cd2d)
- fix(disp): fix infinite recursive SCREEN_LOADED events [`ef76206`](https://github.com/lvgl/lvgl/commit/ef76206c75ea9de26407534a9ce1079dc8e750e3)
- fix(keyboard): add '&' character [`d20bd1c`](https://github.com/lvgl/lvgl/commit/d20bd1ca397ff954167dd496cf1a78da8814f602)
- fix(draw): fix scaling rectangle parts with opa [`7a8fcbf`](https://github.com/lvgl/lvgl/commit/7a8fcbfd3458739cbe64b29767a969ece9542039)
### Docs
- docs(obj): fix wording [`4625`](https://github.com/lvgl/lvgl/pull/4625)
- docs(label): update text for recoloring [`4606`](https://github.com/lvgl/lvgl/pull/4606)
- docs: fix typo [`9fbac75`](https://github.com/lvgl/lvgl/commit/9fbac7570bdec18ddbb157b59f5e26a2ebdf5daf)
### Others
- chore(cmsis-pack): prepare for v8.3.11 [`4936`](https://github.com/lvgl/lvgl/pull/4936)
- chore(cmake): add support for user-specified lv_conf.h path [`4689`](https://github.com/lvgl/lvgl/pull/4689)
- STM32U5 DMA2D support (8.3) [`4643`](https://github.com/lvgl/lvgl/pull/4643)
- backport: fix(lv_disp): fix lv_scr_load_anim being called twice quickly [`4629`](https://github.com/lvgl/lvgl/pull/4629)
- chore(lv_draw_sw_letter.c): Fix print format [`4615`](https://github.com/lvgl/lvgl/pull/4615)
- chore: fix compile error [`7568df7`](https://github.com/lvgl/lvgl/commit/7568df77d16ecbf2242b2bc290dc8fc0eb29cf5a)
## [v8.3.10](https://github.com/lvgl/lvgl/compare/v8.3.10...v8.3.9) 20 September 2023
### New Features
- feat(disp): add double buffered direct-mode efficient sync algorithm (v8.3) [`4497`](https://github.com/lvgl/lvgl/pull/4497)
- feat(style): backport opa_layered [`6548ea0`](https://github.com/lvgl/lvgl/commit/6548ea0f291be8a97afb3c4d7dcabbe465ae5a04)
### Fixes
- fix: build on Windows (MinGW environment) [`4538`](https://github.com/lvgl/lvgl/pull/4538)
- fix(docs): dropdown: fix function name in description of static options [`4535`](https://github.com/lvgl/lvgl/pull/4535)
- fix: do not copy invalid areas if not double buffered mode [`4526`](https://github.com/lvgl/lvgl/pull/4526)
- fix(sdl): add missing parameter in lv_draw_sdl_composite_texture_obtain [`4490`](https://github.com/lvgl/lvgl/pull/4490)
- fix(dropdown): position to the selected item in lv_dropdown_set_selected [`f174589`](https://github.com/lvgl/lvgl/commit/f174589240b099a349e54ba09aa9b39c2b347341)
- fix(vglite): be sure end_angle > start_angle in arc drawing [`01cd1fe`](https://github.com/lvgl/lvgl/commit/01cd1fed9db974aa616a6289a29171b7a971cd89)
- fix(btnmatrix): fix tapping just outside a button in a buttonmatrix [`8063fac`](https://github.com/lvgl/lvgl/commit/8063fac793b0a09add1e57c1115b734659274e6f)
### Docs
- docs(calendar): update according to v8.2 changes [`a296456`](https://github.com/lvgl/lvgl/commit/a296456591f6ff0e3b3ae6cdcdd9ec5b1711c357)
- docs(simulator): remove SDL support from the Visual Studio project [`bcebafe`](https://github.com/lvgl/lvgl/commit/bcebafe4fb72e336b7dedca89c07e334427eef8d)
### CI and tests
- ci: update screenshot compare from v9 to automatically create missing reference images [`fd21ed0`](https://github.com/lvgl/lvgl/commit/fd21ed0eb82bacb1e482180ab0aaed6a667f000d)
- ci(dropdown): fix test [`5fc488a`](https://github.com/lvgl/lvgl/commit/5fc488a088639dbfb5eb44f65b05e13b6ba881bf)
### Others
- chore(cmsis-pack): create cmsis-pack for v8.3.10 [`4572`](https://github.com/lvgl/lvgl/pull/4572)
- Update screen object opacity function documentation [`4505`](https://github.com/lvgl/lvgl/pull/4505)
- demo(sress): fix issues when the stress test is opened/clsoed multiple times [`1c5df6c`](https://github.com/lvgl/lvgl/commit/1c5df6c665b0d5f6f346d45b13109ff1f6ea78a6)
- chore: code formatting [`eb87767`](https://github.com/lvgl/lvgl/commit/eb87767cc65fec93f9cc4f87a1f8fb5b32f7e41d)
## [v8.3.9](https://github.com/lvgl/lvgl/compare/v8.3.9...v8.3.8) 6 August 2023
### Fixes
- fix(decoder): fix LV_IMG_CF_ALPHA_8BIT bin file decoder [`4406`](https://github.com/lvgl/lvgl/pull/4406)
- fix(config): fix typo in LV_USE_PERF_MONITOR and LV_USE_MEM_MONITOR [`4403`](https://github.com/lvgl/lvgl/pull/4403)
- fix(attr): refactor LV_ATTRIBUTE_* for function attributes [`4404`](https://github.com/lvgl/lvgl/pull/4404)
- fix(font): fix optimizer issue in lv_font_fmt_txt.c [`4385`](https://github.com/lvgl/lvgl/pull/4385)
- fix(btnmatrix): Hide button matrix when all buttons hidden [`65f1c93`](https://github.com/lvgl/lvgl/commit/65f1c9305e1b13356010524da4764fe20fe93030)
- fix(obj) prevent hidden objects keeping focus [`375b3b5`](https://github.com/lvgl/lvgl/commit/375b3b5d3ef2ea8c52f971a1bf20998be7940d5e)
- fix(btnmatrix): Fix typo in previous commit! [`29ed7c5`](https://github.com/lvgl/lvgl/commit/29ed7c5717f6cfbca5ce888bf4497221525aae85)
- fix(tabview): fix warning [`223dc1c`](https://github.com/lvgl/lvgl/commit/223dc1cf9d1cad0f40caf244eb435af0871f4153)
- fix(indev): fix warnings when loggin coordinates is enabled [`645006e`](https://github.com/lvgl/lvgl/commit/645006e35195cab3354f34a1a8cbc8c5ed0fdfad)
- fix: use const lv_img_dsc_t * dsc function parameter in lv_img_buf.h/ [`4f102d7`](https://github.com/lvgl/lvgl/commit/4f102d7b6b2e9f9fa68ab7b976d93762107549a4)
- fix(chart): fix lv_chart_get_point_pos_by_id [`f9ffcc9`](https://github.com/lvgl/lvgl/commit/f9ffcc9d8e11beb369dcbab0945ca85eab8f77b2)
- fix(imgbtn): support LV_OBJ_FLAG_CHECKABLE [`385d999`](https://github.com/lvgl/lvgl/commit/385d999a4a8164fcde6ae05f6a5daa5d5c209dd3)
### Docs
- docs(disp): metined that rotation rotates the touch coordinates too [`810852b`](https://github.com/lvgl/lvgl/commit/810852b41be5df66fd7b80f8af69f8b579d142ea)
### Others
- demos: add lv_demo_..._close() functions for each demo [`91038a9`](https://github.com/lvgl/lvgl/commit/91038a99e82a2522f693c7cdc77e9e7a672ee9ed)
## [v8.3.8](https://github.com/lvgl/lvgl/compare/v8.3.8...v8.3.7) 5 July 2023
### New Features
- feat(rt-thread): make the rt-thread env recursively glob the UI files [`8b83fe7`](https://github.com/lvgl/lvgl/commit/8b83fe7ea53a597cdbae8204d0aa9be8ad3d2b89)
### Performance
- perf(pxp, vglite): improve performance and add more features [`4222`](https://github.com/lvgl/lvgl/pull/4222)
### Fixes
- fix(stm32): static function prototypes moved from .h to .c [`4276`](https://github.com/lvgl/lvgl/pull/4276)
- fix(png): fix decode image size and some warnings [`4248`](https://github.com/lvgl/lvgl/pull/4248)
- fix(bidi): add more Hebrew checks to RTL characters set (#4171) [`4239`](https://github.com/lvgl/lvgl/pull/4239)
- fix(img): fix getting the image type on big endian systems [`4215`](https://github.com/lvgl/lvgl/pull/4215)
- fix(sdl): destroy texture after use if not stored in cache [`4173`](https://github.com/lvgl/lvgl/pull/4173)
- fix:(BtnMatrix) Backport https://github.com/lvgl/lvgl/pull/4185 [`cb602ea`](https://github.com/lvgl/lvgl/commit/cb602ea7785de21a187ef5ee5f7de4e3aa3f7e0e)
- fix(arduino): fix messed up variable types [`e3659c4`](https://github.com/lvgl/lvgl/commit/e3659c46b128b2b715b196c3ccfb94b3de4c89f8)
- fix:(BtnMatrix) Backport https://github.com/lvgl/lvgl/pull/4185 [`07bce74`](https://github.com/lvgl/lvgl/commit/07bce7466d471a15ba241a9db3239f7a116b0b46)
- fix(chart): fix division by zero if there are no ticks [`67b3011`](https://github.com/lvgl/lvgl/commit/67b3011f835b08c77ff60ae2d1e6592a710ca2b1)
- fix(msgbox): fix typo [`6a89bd2`](https://github.com/lvgl/lvgl/commit/6a89bd2d7409ac4d49ad32da73ba50a84f7c8990)
- fix(tabview): remove the animation if the tab is selected by clicking the button on the header [`3de61c7`](https://github.com/lvgl/lvgl/commit/3de61c76af0aed1665e9d61e47b4dd50b9e8bdf1)
- fix(btnmatrix): fix array out of bounds addressing with groups and no buttons [`edd5ad2`](https://github.com/lvgl/lvgl/commit/edd5ad28ad74d1025db0b442cfa390d8c01ae006)
- fix(btnmatrix): fix using &gt; 7 as button width [`75e6ef4`](https://github.com/lvgl/lvgl/commit/75e6ef4e1d66a85d68160b97ef931b0717e77212)
- fix(draw): typo with LV_COLOR_DEPTH 8 [`45b13c3`](https://github.com/lvgl/lvgl/commit/45b13c378f6fc1728ddf1547c25daa61d62c9f76)
- fix(disp): fix memory leak lv_scr_load_anim with auto_del and time=0 [`1caafc5`](https://github.com/lvgl/lvgl/commit/1caafc55dde46e1b7e3d17d8c5349fbf7cccba9f)
- fix(msgbox): add missing lv_obj_class_init_obj [`6843c19`](https://github.com/lvgl/lvgl/commit/6843c191b792f66829477827279adbbc763541c1)
- fix(flex): register LV_STYLE_FLEX_GROW [`5ba90a5`](https://github.com/lvgl/lvgl/commit/5ba90a5c41f584a8eb3a4fc8e2f466729652ddb3)
### Examples
- example(tabview): fix tabview disable scrollig example [`9491c3f`](https://github.com/lvgl/lvgl/commit/9491c3ff6d2f8e56b13d8fb493d4b3ee98ef1a4b)
### Docs
- docs: mention incompatibility between software rotation and `direct_mode` or `full_refresh` [`4308`](https://github.com/lvgl/lvgl/pull/4308)
- docs(faq): don't say 24 bit is support as LVGL can't render in RGB888 directly [`227ac02`](https://github.com/lvgl/lvgl/commit/227ac023419eeb253892b1c36113059f12b1f9f2)
### CI and tests
### Others
- chore(cmsis-pack): update cmsis-pack for v8.3.8 [`4340`](https://github.com/lvgl/lvgl/pull/4340)
- add(docs): add renesas-ra6m3 get-started document [`4278`](https://github.com/lvgl/lvgl/pull/4278)
- add(gpu): add renesas-ra6m3 gpu adaptation [`4270`](https://github.com/lvgl/lvgl/pull/4270)
- Revert "fix:(BtnMatrix) Backport https://github.com/lvgl/lvgl/pull/4185" [`1713cd3`](https://github.com/lvgl/lvgl/commit/1713cd3fd8f93aa575fbcf0e34b8626b6ee69ded)
## [v8.3.7](https://github.com/lvgl/lvgl/compare/v8.3.7...v8.3.6) 3 May 2023
### New Features
- feat(btnmatrix): review ctrl map and allow width values to be max 15 [`a150b15`](https://github.com/lvgl/lvgl/commit/a150b15e45a922eb5497fe5a31a480e1cd689246)
### Fixes
- fix (spinbox): doubling characters entered from the keyboard [`4190`](https://github.com/lvgl/lvgl/pull/4190)
- fix(arm-2d): fix transform-chrome-keying issue [`4178`](https://github.com/lvgl/lvgl/pull/4178)
- fix(menu): prevent setting the current page again [`4136`](https://github.com/lvgl/lvgl/pull/4136)
- fix(esp): fix ESP-IDF pedantic builds (backport v8.3) [`4135`](https://github.com/lvgl/lvgl/pull/4135)
- fix: color mixing with LV_COLOR_SWAP == 1 [`4101`](https://github.com/lvgl/lvgl/pull/4101)
- fix(indev): fix integer overflow in recursive zoom calculation [`a0795b4`](https://github.com/lvgl/lvgl/commit/a0795b49e82102ad68a27c86c36c37fffbe66d3c)
- fix(style): fix trasition on bg_grad color [`48d7878`](https://github.com/lvgl/lvgl/commit/48d7878bac3f607322957ed6f710d6615d5e72e0)
## [v8.3.6](https://github.com/lvgl/lvgl/compare/v8.3.6...v8.3.5) 3 April 2023
### New Features
- feat(msg): add lv_msg_unsubcribe_obj [`6af0179`](https://github.com/lvgl/lvgl/commit/6af01798d82f90f0c2ba6a9da39c4f10fb427df7)
### Performance
### Fixes
- fix(group): fix default_group becomes wild pointer when deleted [`4076`](https://github.com/lvgl/lvgl/pull/4076)
- fix(fs_posix): allow creating new file and set permission. [`3976`](https://github.com/lvgl/lvgl/pull/3976)
- fix(img): support negative angles [`3846`](https://github.com/lvgl/lvgl/pull/3846)
- fix(gif): synchronize with master [`4003`](https://github.com/lvgl/lvgl/pull/4003)
- fix(gpu): fix STM GPU drivers for some variants [`4004`](https://github.com/lvgl/lvgl/pull/4004)
- fix(img): possible divide by 0 exception (lvgl#3988) [`3990`](https://github.com/lvgl/lvgl/pull/3990)
- fix(arc): fix knob area invalidation [`d0e19eb`](https://github.com/lvgl/lvgl/commit/d0e19eb2d38ba8a500399b0496d7a8363be4003e)
- fix(slider): consider animations on pressing [`0b7777f`](https://github.com/lvgl/lvgl/commit/0b7777f27a7932efe3d594be426e1beb59d80ae3)
- fix(bar): delete running animations when a new value is set without animation [`aa31380`](https://github.com/lvgl/lvgl/commit/aa313806d0ebde475fc2bc360a15172cc1b658a7)
- docs: use a fixed commit of lv_web_emscripten [`501230e`](https://github.com/lvgl/lvgl/commit/501230e0fc95936199b3187d350873c3bb4a94e4)
### Examples
### Docs
- docs(arduino): add note to not use lv_examles library [`2f294aa`](https://github.com/lvgl/lvgl/commit/2f294aa76c8fece98a4fa72304bc6f267ed2a228)
- docs: use a fixed commit of lv_web_emscripten [`501230e`](https://github.com/lvgl/lvgl/commit/501230e0fc95936199b3187d350873c3bb4a94e4)
### CI and tests
### Others
- chore(cmsis-pack): update cmsis-pack for v8.3.6 [`4108`](https://github.com/lvgl/lvgl/pull/4108)
- chore: update the version numbers to v8.3.5-dev [`77670fb`](https://github.com/lvgl/lvgl/commit/77670fb1a55e0f2012ff7a057e535830e7253e22)
- Update build_html_examples.sh [`399069b`](https://github.com/lvgl/lvgl/commit/399069b4a2423c11823581668fe71ce9a7c88e7d)
## [v8.3.5](https://github.com/lvgl/lvgl/compare/v8.3.4...v8.3.5) 7 February 2023
### Performance
- perf(gpu): improve NXP's PXP and VGLite accelerators [`3952`](https://github.com/lvgl/lvgl/pull/3952)
- perf(dam2d): rework stm32 dma2d [`3904`](https://github.com/lvgl/lvgl/pull/3904)
### Fixes
- fix(monkey): remove executable permissions from source files [`3971`](https://github.com/lvgl/lvgl/pull/3971)
- fix(ci): set Ubuntu version for MicroPython test [`3865`](https://github.com/lvgl/lvgl/pull/3865)
- fix(Kconfig): fix wrong type of LV_FS_STDIO_CACHE_SIZE (v8.3) [`3906`](https://github.com/lvgl/lvgl/pull/3906)
- docs(indev): fix the name of long_press_repeat_time (was long_press_rep_time) [`34c545e`](https://github.com/lvgl/lvgl/commit/34c545ef19dc97c8952a412e533a4cd3924b9fbc)
- fix(roller): consider the recolor setting of the label [`39f4247`](https://github.com/lvgl/lvgl/commit/39f424767fa57376c4cb08cf22951fd56d854fd6)
### Examples
### Docs
- docs(indev): fix the name of long_press_repeat_time (was long_press_rep_time) [`34c545e`](https://github.com/lvgl/lvgl/commit/34c545ef19dc97c8952a412e533a4cd3924b9fbc)
### CI and tests
- ci(esp): fix push to the component registry on tag [`e529230`](https://github.com/lvgl/lvgl/commit/e529230f4bb97b4506c430aac96d5ddaef685dc4)
### Others
- chore(cmsis-pack): update cmsis-pack for v8.3.5 [`3972`](https://github.com/lvgl/lvgl/pull/3972)
- chore: add an option to "LV_TICK_CUSTOM" [`3879`](https://github.com/lvgl/lvgl/pull/3879)
- bump version numbers to v8.3.5-dev [`47c8f8f`](https://github.com/lvgl/lvgl/commit/47c8f8f9822f4c0c0ffbe2f12b380bddefcec475)
- Update layer.md [`9faca8a`](https://github.com/lvgl/lvgl/commit/9faca8a8d4125e21dedbf6e46aa1586a6b57e5b8)
## [v8.3.4](https://github.com/lvgl/lvgl/compare/v8.3.4...v8.3.3) 15 December 2022
### New Features
- feat(keyboard): ported arabic keyboard from release 7.10.0 [`3728`](https://github.com/lvgl/lvgl/pull/3728)
- feat(table): scroll to the selected cell with key navigation [`39d03a8`](https://github.com/lvgl/lvgl/commit/39d03a80f45847a1977cfe9cc6a509b1613d0aca)
### Fixes
- fix(rt-thread): sync rt-thread v5.0.0 rt_align [`3864`](https://github.com/lvgl/lvgl/pull/3864)
- fix(draw): SDL2 gradient support #3848 [`3856`](https://github.com/lvgl/lvgl/pull/3856)
- fix(esp.cmake): add demos and examples [`3784`](https://github.com/lvgl/lvgl/pull/3784)
- fix(indev): fix scrolling on transformed obejcts [`84cf05d`](https://github.com/lvgl/lvgl/commit/84cf05d8b23b31e000db757a278545e58fcbcbe8)
- fix(style): add the missing support for pct pivot in tranasform style properties [`c8e584f`](https://github.com/lvgl/lvgl/commit/c8e584f879a1e1427e7a8f5ff496af39f17df41d)
- fix(flex): be sure obj-&gt;w_layout and h_layout can't be set at the same time [`c4c4007`](https://github.com/lvgl/lvgl/commit/c4c400716e80a279e7b3d43b8992915fe94441eb)
- fix(chart): fix very dense bar charts [`bb2c2ac`](https://github.com/lvgl/lvgl/commit/bb2c2ac34ac943978513c7ed51885078979b1c10)
- fix(draw): handle LV_COLOR_DEPTH == 1 too in lv_draw_sw_transform [`bd11ad8`](https://github.com/lvgl/lvgl/commit/bd11ad8542eac9ff51420e5afb80f7e6fcf36a5c)
- fix(example): fix warnings [`1e3ca25`](https://github.com/lvgl/lvgl/commit/1e3ca25fed13bbf85c32a60d4b7041cf8bd525ab)
- fix(benchmark): fix warnings [`1ed026c`](https://github.com/lvgl/lvgl/commit/1ed026ca7307957568fe419f1ff39a15b2535b3e)
- fix(draw): fix text color with sub pixel rendering and BGR order [`e050f5c`](https://github.com/lvgl/lvgl/commit/e050f5ca156f79d752894f38f0a437c946205cb4)
- fix(meter): fix setting part_draw_dsc.id in needle img drawing [`716e5e2`](https://github.com/lvgl/lvgl/commit/716e5e2c8bd2a22e7d56e8d7ca33054a11a1f4ed)
- fix(gridnav): fix stucking in pressed state with encoder [`ad56dfa`](https://github.com/lvgl/lvgl/commit/ad56dfaf7046a9bb8c05e877a8c8852cd14a59af)
- fix(darw): add back the disappeared antialising=0 support [`2c17b28`](https://github.com/lvgl/lvgl/commit/2c17b28ac476c95a4153ab6cabb77b1c7208bb74)
- fix(msg): fix typos in API by adding wrappers [`41fa416`](https://github.com/lvgl/lvgl/commit/41fa41613455260ccdeb87ecb890ce026ff0a435)
- fix(draw): fix transformation accuracy [`e06f03d`](https://github.com/lvgl/lvgl/commit/e06f03db72f98439078118518158f52439dd7bf8)
- fix(style): remove the reduntant define of LV_GRADIENT_MAX_STOPS [`903e94b`](https://github.com/lvgl/lvgl/commit/903e94b716ca1b32cdb51de11df679953699e53b)
- demo(benchmark): fix lv_label_set_text_fmt format strings [`ae38258`](https://github.com/lvgl/lvgl/commit/ae3825871e31cd42cad2f310bdfc605150670511)
- demo(benchmark): fix warning [`1173dcb`](https://github.com/lvgl/lvgl/commit/1173dcba96621e20c9a7240c8572bd6573bce6a0)
## [v8.3.3](https://github.com/lvgl/lvgl/compare/v8.3.2...v8.3.3) 06 October 2022
v8.3.3 is the same as v8.3.2. It was released only because the version number was set incorrectly in lvgl.h.
## [v8.3.2](https://github.com/lvgl/lvgl/compare/v8.3.1...v8.3.2) 27 September 2022
### Fixes
- fix(fragment): fixed child fragment event dispatch [`3683`](https://github.com/lvgl/lvgl/pull/3683)
- fix(sdl): clear streaming/target texture with FillRect [`3682`](https://github.com/lvgl/lvgl/pull/3682)
- fix(sdl): transformation with alpha (#3576) [`3678`](https://github.com/lvgl/lvgl/pull/3678)
- fix(draw_sw): fix image cache to access the freed stack space [`3584`](https://github.com/lvgl/lvgl/pull/3584)
- fix(style): use compile time prop_cnt for const styles [`3609`](https://github.com/lvgl/lvgl/pull/3609)
- fix(demo): can not found lvgl.h file [`3477`](https://github.com/lvgl/lvgl/pull/3477)
- fix(ci) checkout lv_micropython release/v8 branch [`3524`](https://github.com/lvgl/lvgl/pull/3524)
- fix(canvas): fix clipéping on transformation [`b884aba`](https://github.com/lvgl/lvgl/commit/b884abae26f3824b27783a85d18ed51e550347c1)
- fix(draw): allow drawing outline with LV_DRAW_COMPLEX == 0 too [`ece3495`](https://github.com/lvgl/lvgl/commit/ece34950040e218fc73605a4e88f1060c2a274f8)
- fix(colorwheel): fix updating color when using lv_colorwheel_set_hsv [`d59bba1`](https://github.com/lvgl/lvgl/commit/d59bba12db115afb4b6aa53eed2625221dfff2fd)
- fix(slider): find the nearest value on click instead of floor [`dfd14fa`](https://github.com/lvgl/lvgl/commit/dfd14fa778aef25d0db61748a58aa9989ce5e2c8)
- fix(draw): fix border drawing with thick borders [`d5b2a9b`](https://github.com/lvgl/lvgl/commit/d5b2a9b2562cbfa327bf0ec03c11d28576037a14)
- fix(refr): fix true double double buffering logic with transparent screens [`8b605cc`](https://github.com/lvgl/lvgl/commit/8b605cc48224d0497cdd936fa77229e0c3d606d2)
- fix(group): be sure obj is removed from its current group in lv_group_add_obj [`5156ee0`](https://github.com/lvgl/lvgl/commit/5156ee058d5de674a00ffd84d15d460de7f0e53b)
- fix(style): add missing invalidation in lv_obj_remove_local_style_prop [`a0515ba`](https://github.com/lvgl/lvgl/commit/a0515ba30dd74b8b22a6709d334eb03782ee1a4d)
### Docs
- docs(draw) remove reference to old lv_fs_add_drv function [`3564`](https://github.com/lvgl/lvgl/pull/3564)
- docs(disp): LV_COLOR_SCREEN_TRANSP remove dependency on LV_COLOR_DEPTH_32 as transparency is supported across all color depths [`3556`](https://github.com/lvgl/lvgl/pull/3556)
### CI and tests
- ci: protect test.c with #if LV_BUILD_TEST [`be485d7`](https://github.com/lvgl/lvgl/commit/be485d7605136d2a5d6a633c7cb5b7c525cae7ee)
### Others
- chore(rt-thread) backport fixes from v9 [`3604`](https://github.com/lvgl/lvgl/pull/3604)
- chore: fix warnings [`7640950`](https://github.com/lvgl/lvgl/commit/76409502163ffe67cfbab9c7f24f2226cc8a5941)
- remove accidentally added code [`5022476`](https://github.com/lvgl/lvgl/commit/5022476edc8676f2a6ef7b919d3578159edeef7c)
## [v8.3.1](https://github.com/lvgl/lvgl/compare/v8.3.0...v8.3.1) 25 July 2022 ## [v8.3.1](https://github.com/lvgl/lvgl/compare/v8.3.0...v8.3.1) 25 July 2022
### Fixes ### Fixes

@ -52,9 +52,14 @@ In the INO file you can see how to register a display and a touchpad for LVGL an
Note that, there is no dedicated INO file for every example. Instead, you can load an example by calling an `lv_example_...` function. For example `lv_example_btn_1()`. Note that, there is no dedicated INO file for every example. Instead, you can load an example by calling an `lv_example_...` function. For example `lv_example_btn_1()`.
**IMPORTANT** **IMPORTANT NOTE 1**
Due to some the limitations of Arduino's build system you need to copy `lvgl/examples` to `lvgl/src/examples`. Similarly for the demos `lvgl/demos` to `lvgl/src/demos`. Due to some the limitations of Arduino's build system you need to copy `lvgl/examples` to `lvgl/src/examples`. Similarly for the demos `lvgl/demos` to `lvgl/src/demos`.
**IMPORTANT NOTE 2**
Note that the `lv_examples` library is for LVGL v7 and you shouldn't install it for this version (since LVGL v8)
as the examples and demos are now part of the main LVGL library.
## Debugging and logging ## Debugging and logging
LVGL can display debug information in case of trouble. LVGL can display debug information in case of trouble.

@ -9,6 +9,7 @@
nxp nxp
stm32 stm32
espressif espressif
renesas
arduino arduino
tasmota-berry tasmota-berry
cmake cmake

@ -1,6 +1,6 @@
# NXP # NXP
NXP has integrated LVGL into the MCUXpresso SDK packages for several of their general purpose and crossover NXP has integrated LVGL into the MCUXpresso SDK packages for general purpose and crossover microcontrollers, allowing
microcontrollers, allowing easy evaluation and migration into your product design. easy evaluation and migration into your product design.
[Download an SDK for a supported board](https://www.nxp.com/design/software/embedded-software/littlevgl-open-source-graphics-library:LITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY?&tid=vanLITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY) [Download an SDK for a supported board](https://www.nxp.com/design/software/embedded-software/littlevgl-open-source-graphics-library:LITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY?&tid=vanLITTLEVGL-OPEN-SOURCE-GRAPHICS-LIBRARY)
today and get started with your next GUI application. today and get started with your next GUI application.
@ -10,42 +10,40 @@ with PXP/VGLite support if the modules are present), no additional integration w
## HW acceleration for NXP iMX RT platforms ## HW acceleration for NXP iMX RT platforms
Depending on the RT platform used, the acceleration can be done by NXP PXP (PiXel Pipeline) and/or the Verisilicon GPU Depending on the RT platform used, the acceleration can be done by NXP PXP (PiXel Pipeline) and/or the Verisilicon GPU
through an API named VGLite. There is a single NXP draw context that covers both GPUs allowing to have enabled either through an API named VGLite. Each accelerator has its own context that allows them to be used individually as well
one or even both at the same time. While enableing both 2D accelerators, the VGLite can be used to accelerate widget simultaneously (in LVGL multithreading mode).
drawing while the PXP accelerated blit and fill operations.
Supported draw callbacks are available in "src/draw/nxp/lv_gpu_nxp.c": ### PXP accelerator
Several drawing features in LVGL can be offloaded to the PXP engine. The CPU is available for other operations while the
PXP is running. RTOS is required to block the LVGL drawing thread and switch to another task or suspend the CPU for
power savings.
Supported draw callbacks are available in "src/draw/nxp/pxp/lv_draw_pxp.c":
```c ```c
nxp_draw_ctx->base_draw.draw_arc = lv_draw_nxp_arc; pxp_draw_ctx->base_draw.draw_img_decoded = lv_draw_pxp_img_decoded;
nxp_draw_ctx->base_draw.draw_rect = lv_draw_nxp_rect; pxp_draw_ctx->blend = lv_draw_pxp_blend;
nxp_draw_ctx->base_draw.draw_img_decoded = lv_draw_nxp_img_decoded; pxp_draw_ctx->base_draw.wait_for_finish = lv_draw_pxp_wait_for_finish;
nxp_draw_ctx->blend = lv_draw_nxp_blend; pxp_draw_ctx->base_draw.buffer_copy = lv_draw_pxp_buffer_copy;
``` ```
If enabled both GPUs, the PXP is the preffered one to be used for drawing operation. A fallback mechanism is
implemented so that if the feature is not supported by PXP (or if PXP fails), the VGLite will take over to handle the
task. At the end, the CPU will assure that every widget drawing is fully covered (if not already done by GPU).
### PXP accelerator
Several drawing features in LVGL can be offloaded to the PXP engine. The VGLite (if supported) and CPU are available for
other operations while the PXP is running. An RTOS is required to block the LVGL drawing thread and switch to another
task or suspend the CPU for power savings.
#### Features supported: #### Features supported:
All operations can be used in conjunction with optional transparency.
- RGB565 and ARGB8888 color formats - RGB565 and ARGB8888 color formats
- Area fill + optional transparency - Area fill with color
- BLIT (BLock Image Transfer) + optional transparency - BLIT (BLock Image Transfer)
- Color keying + optional transparency
- Recoloring (color tint) + optional transparency
- Image Rotation (90, 180, 270 degree) + optional transparency
- Recoloring (color tint) + Image Rotation (90, 180, 270 degree) + optional transparency
- Screen Rotation (90, 180, 270 degree) - Screen Rotation (90, 180, 270 degree)
- Color keying
- Recoloring (color tint)
- Image Rotation (90, 180, 270 degree)
- Buffer copy
- RTOS integration layer - RTOS integration layer
- Default FreeRTOS and bare metal code provided - Default FreeRTOS and bare metal code provided
- Combination of recolor and/or rotation + color key/alpha blend/transparency is supported but PXP needs two steps. - Combination of recolor and/or rotation + color key/alpha blend/transparency is supported.
First step is to recolor/rotate the image to a temporarly buffer (please check LV_MEM_SIZE value for allocation limit) That is achieved by PXP in two steps:
and another step is required to handle color keying, alpha chanel or to apply transparency. - First step is to recolor/rotate the image to a temporary buffer (statically allocated)
- Second step is required to handle color keying, alpha channel or to apply transparency
#### Known limitations: #### Known limitations:
- Rotation is not supported for images unaligned to blocks of 16x16 pixels. - Rotation is not supported for images unaligned to blocks of 16x16 pixels.
@ -78,51 +76,71 @@ and the final output image can look shifted.
#### Project setup: #### Project setup:
- Add PXP related files to project: - Add PXP related files to project:
- src/draw/nxp/pxp/lv_gpu_nxp_pxp.c, src/draw/nxp/pxp/lv_gpu_nxp_pxp.h: init, uninit, run/wait PXP device, log/trace - src/draw/nxp/pxp/lv_draw_pxp.c[.h]: draw context callbacks
- src/draw/nxp/pxp/lv_draw_pxp_blend.c, src/draw/nxp/pxp/lv_draw_pxp_blend.h: fill and blit (w/o transformation) - src/draw/nxp/pxp/lv_draw_pxp_blend.c[.h]: fill and blit (with optional transformation)
- src/draw/nxp/pxp/lv_gpu_nxp_osa.c, src/draw/nxp/pxp/lv_gpu_osa.h: default implementation of OS-specific functions - src/draw/nxp/pxp/lv_gpu_nxp_pxp.c[.h]: init, uninit, run/wait PXP device
(bare metal and FreeRTOS only) - src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c[.h]: OS abstraction (FreeRTOS or bare metal)
- optional, required only if `LV_USE_GPU_NXP_PXP_AUTO_INIT` is set to 1 - optional, required only if `LV_USE_GPU_NXP_PXP_AUTO_INIT` is set to 1
- PXP related code depends on two drivers provided by MCU SDK. These drivers need to be added to project: - PXP related code depends on two drivers provided by MCU SDK. These drivers need to be added to project:
- fsl_pxp.c, fsl_pxp.h: PXP driver - fsl_pxp.c[.h]: PXP driver
- fsl_cache.c, fsl_cache.h: CPU cache handling functions - fsl_cache.c[.h]: CPU cache handling functions
#### Logging: #### Logging:
- By default, LV_GPU_NXP_PXP_LOG_ERRORS is enabled so that any PXP error will be seen on LVGL output - By default, `LV_GPU_NXP_PXP_LOG_ERRORS` is enabled so that any PXP error will be seen on SDK debug console
- For tracing logs about the PXP limitations or size thresholds, the user can enable LV_GPU_NXP_PXP_LOG_TRACES - By default, `LV_GPU_NXP_PXP_LOG_TRACES` is disabled. Enable it for tracing logs (like PXP limitations)
#### Advanced configuration: #### Advanced configuration:
- Implementation depends on multiple OS-specific functions. The struct `lv_nxp_pxp_cfg_t` with callback pointers is - Implementation depends on multiple OS-specific functions. The struct `lv_nxp_pxp_cfg_t` with callback pointers is
used as a parameter for the `lv_gpu_nxp_pxp_init()` function. Default implementation for FreeRTOS and bare metal is used as a parameter for the `lv_gpu_nxp_pxp_init()` function. Default implementation for FreeRTOS and bare metal is
provided in lv_gpu_nxp_osa.c provided in lv_gpu_nxp_pxp_osa.c
- `pxp_interrupt_init()`: Initialize PXP interrupt (HW setup, OS setup) - `pxp_interrupt_init()`: Initialize PXP interrupt (HW setup, OS setup)
- `pxp_interrupt_deinit()`: Deinitialize PXP interrupt (HW setup, OS setup) - `pxp_interrupt_deinit()`: Deinitialize PXP interrupt (HW setup, OS setup)
- `pxp_run()`: Start PXP job. Use OS-specific mechanism to block drawing thread. PXP must finish drawing before - `pxp_run()`: Start PXP job. Use OS-specific mechanism to block drawing thread. PXP must finish drawing before
leaving this function. leaving this function.
- There are configurable area thresholds which are used to decide whether the area will be processed by CPU or by PXP. - Area threshold (size limit) is configurable and used to decide whether the area will be processed by PXP or not.
Areas smaller than a defined value will be processed by CPU and those bigger than the threshold will be processed by Areas smaller than the defined value will be processed by CPU and those bigger than the threshold will be processed by
PXP. These thresholds may be defined as preprocessor variables. Default values are defined in lv_draw_pxp_blend.h PXP. The threshold is defined as a macro in lv_draw_pxp.c
- `LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT`: size threshold for image BLIT, BLIT with color keying, BLIT with recolor and - `LV_GPU_NXP_PXP_SIZE_LIMIT`: size threshold for fill/blit (with optional transformation)
BLIT with rotation (OPA >= LV_OPA_MAX)
- `LV_GPU_NXP_PXP_BLIT_OPA_SIZE_LIMIT`: size threshold for image BLIT, BLIT with color keying, BLIT with recolor
and BLIT with rotation and transparency (OPA < LV_OPA_MAX)
- `LV_GPU_NXP_PXP_FILL_SIZE_LIMIT`: size threshold for fill operation (OPA >= LV_OPA_MAX)
- `LV_GPU_NXP_PXP_FILL_OPA_SIZE_LIMIT`: size threshold for fill operation with transparency (OPA < LV_OPA_MAX)
### VGLite accelerator ### VGLite accelerator
Extra drawing features in LVGL can be handled by the VGLite engine. The PXP (if supported) and CPU are available for Extra drawing features in LVGL can be handled by the VGLite engine. The CPU is available for other operations while the
other operations while the VGLite is running. An RTOS is required to block the LVGL drawing thread and switch to another VGLite is running. An RTOS is required to block the LVGL drawing thread and switch to another task or suspend the CPU
task or suspend the CPU for power savings. for power savings.
Supported draw callbacks are available in "src/draw/nxp/vglite/lv_draw_vglite.c":
```c
vglite_draw_ctx->base_draw.init_buf = lv_draw_vglite_init_buf;
vglite_draw_ctx->base_draw.draw_line = lv_draw_vglite_line;
vglite_draw_ctx->base_draw.draw_arc = lv_draw_vglite_arc;
vglite_draw_ctx->base_draw.draw_rect = lv_draw_vglite_rect;
vglite_draw_ctx->base_draw.draw_img_decoded = lv_draw_vglite_img_decoded;
vglite_draw_ctx->blend = lv_draw_vglite_blend;
vglite_draw_ctx->base_draw.wait_for_finish = lv_draw_vglite_wait_for_finish;
vglite_draw_ctx->base_draw.buffer_copy = lv_draw_vglite_buffer_copy;
```
#### Features supported: #### Features supported:
All operations can be used in conjunction with optional transparency.
- RGB565 and ARGB8888 color formats - RGB565 and ARGB8888 color formats
- Area fill + optional transparency - Area fill with color
- BLIT (BLock Image Transfer) + optional transparency - BLIT (BLock Image Transfer)
- Image Rotation (any degree with decimal) + optional transparency - Image Rotation (any degree with decimal)
- Image Scale + optional transparency - Image Scale
- Draw background rectangle with radius or gradient - Draw rectangle background with optional radius or gradient
- Draw arc - Blit rectangle background image
- RTOS integration layer - Draw rectangle border/outline with optional rounded corners
- Draw arc with optional rounded ending
- Draw line or dashed line with optional rounded ending
- Buffer copy
#### Known limitations:
- Source image alignment:
The byte alignment requirement for a pixel depends on the specific pixel format. Both buffer address and buffer stride
must be aligned. As general rule, the alignment is set to 16 pixels. This makes the buffer address alignment to be
32 bytes for RGB565 and 64 bytes for ARGB8888.
- For pixel engine (PE) destination, the alignment should be 64 bytes for all tiled (4x4) buffer layouts.
The pixel engine has no additional alignment requirement for linear buffer layouts (`VG_LITE_LINEAR`).
#### Basic configuration: #### Basic configuration:
- Select NXP VGLite engine in lv_conf.h: Set `LV_USE_GPU_NXP_VG_LITE` to 1 - Select NXP VGLite engine in lv_conf.h: Set `LV_USE_GPU_NXP_VG_LITE` to 1
@ -130,8 +148,8 @@ task or suspend the CPU for power savings.
#### Basic initialization: #### Basic initialization:
- Initialize VGLite before calling `lv_init()` by specifying the width/height of tessellation window. Value should be - Initialize VGLite before calling `lv_init()` by specifying the width/height of tessellation window. Value should be
a multiple of 16; minimum value is 16 pixels, maximum cannot be greater than frame width. If less than or equal to 0, a multiple of 16; minimum value is 16 pixels, maximum cannot be greater than the frame width. If less than or equal
then no tessellation buffer is created, in which case the function is used for a blit init. to 0, then no tessellation buffer is created, in which case VGLite is initialized only for blitting.
```c ```c
#if LV_USE_GPU_NXP_VG_LITE #if LV_USE_GPU_NXP_VG_LITE
#include "vg_lite.h" #include "vg_lite.h"
@ -144,25 +162,21 @@ task or suspend the CPU for power savings.
#### Project setup: #### Project setup:
- Add VGLite related files to project: - Add VGLite related files to project:
- src/draw/nxp/vglite/lv_gpu_nxp_vglite.c, src/draw/nxp/vglite/lv_gpu_nxp_vglite.h: buffer init, log/trace - src/draw/nxp/vglite/lv_draw_vglite.c[.h]: draw context callbacks
- src/draw/nxp/vglite/lv_draw_vglite_blend.c, src/draw/nxp/vglite/lv_draw_vglite_blend.h: fill and blit - src/draw/nxp/vglite/lv_draw_vglite_blend.c[.h]: fill and blit (with optional transformation)
(w/o transformation) - src/draw/nxp/vglite/lv_draw_vglite_rect.c[.h]: draw rectangle
- src/draw/nxp/vglite/lv_draw_vglite_rect.c, src/draw/nxp/vglite/lv_draw_vglite_rect.h: rectangle draw - src/draw/nxp/vglite/lv_draw_vglite_arc.c[.h]: draw arc
- src/draw/nxp/vglite/lv_draw_vglite_arc.c, src/draw/nxp/vglite/lv_draw_vglite_arc.h: arc draw - src/draw/nxp/vglite/lv_draw_vglite_line.c[.h]: draw line
- src/draw/nxp/vglite/lv_vglite_buf.c[.h]: init/get vglite buffer
- src/draw/nxp/vglite/lv_vglite_utils.c[.h]: function helpers
#### Logging: #### Logging:
- By default, LV_GPU_NXP_VG_LITE_LOG_ERRORS is enabled so that any VGLite error will be seen on LVGL output - By default, `LV_GPU_NXP_VG_LITE_LOG_ERRORS` is enabled so that any VGLite error will be seen on SDK debug console
- For tracing logs about the VGLite limitations, size thresholds or stride alignment, the user can enable - By default, `LV_GPU_NXP_VG_LITE_LOG_TRACES` is disabled. Enable it for tracing logs (like blit split workaround or
LV_GPU_NXP_VG_LITE_LOG_TRACES VGLite fallback to CPU due to any error on the driver)
#### Advanced configuration: #### Advanced configuration:
- There are configurable area thresholds which are used to decide whether the area will be processed by CPU or by - Area threshold (size limit) is configurable and used to decide whether the area will be processed by VGLite or not.
VGLite. Areas smaller than a defined value will be processed by CPU and those bigger than the threshold will be Areas smaller than the defined value will be processed by CPU and those bigger than the threshold will be processed by
processed by VGLite. These thresholds may be defined as preprocessor variables. Default values are defined in VGLite. The threshold is defined as a macro in lv_draw_vglite.c
lv_draw_vglite_blend.h - `LV_GPU_NXP_VG_LITE_SIZE_LIMIT`: size threshold for fill/blit (with optional transformation)
- `LV_GPU_NXP_VG_LITE_BLIT_SIZE_LIMIT`: size threshold for image BLIT, BLIT with scale and BLIT with rotation
(OPA >= LV_OPA_MAX)
- `LV_GPU_NXP_VG_LITE_BLIT_OPA_SIZE_LIMIT`: size threshold for image BLIT, BLIT with scale and BLIT with rotation
and transparency (OPA < LV_OPA_MAX)
- `LV_GPU_NXP_VG_LITE_FILL_SIZE_LIMIT`: size threshold for fill operation (OPA >= LV_OPA_MAX)
- `LV_GPU_NXP_VG_LITE_FILL_OPA_SIZE_LIMIT`: size threshold for fill operation with transparency (OPA < LV_OPA_MAX)

@ -15,7 +15,7 @@ The simulator is ported to various IDEs (Integrated Development Environments). C
- [Eclipse with SDL driver](https://github.com/lvgl/lv_sim_eclipse_sdl): Recommended on Linux and Mac - [Eclipse with SDL driver](https://github.com/lvgl/lv_sim_eclipse_sdl): Recommended on Linux and Mac
- [CodeBlocks](https://github.com/lvgl/lv_sim_codeblocks_win): Recommended on Windows - [CodeBlocks](https://github.com/lvgl/lv_sim_codeblocks_win): Recommended on Windows
- [VisualStudio with SDL driver](https://github.com/lvgl/lv_sim_visual_studio_sdl): For Windows - [VisualStudio](https://github.com/lvgl/lv_sim_visual_studio_sdl): For Windows
- [VSCode with SDL driver](https://github.com/lvgl/lv_sim_vscode_sdl): Recommended on Linux and Mac - [VSCode with SDL driver](https://github.com/lvgl/lv_sim_vscode_sdl): Recommended on Linux and Mac
- [PlatformIO with SDL driver](https://github.com/lvgl/lv_platformio): Recommended on Linux and Mac - [PlatformIO with SDL driver](https://github.com/lvgl/lv_platformio): Recommended on Linux and Mac
- [MDK with FastModel](https://github.com/lvgl/lv_port_an547_cm55_sim): For Windows - [MDK with FastModel](https://github.com/lvgl/lv_port_an547_cm55_sim): For Windows

@ -0,0 +1,129 @@
# Renesas
The [HMI-Board](https://bit.ly/3I9nfUo) development board SDK now comes with LVGL integration for quick evaluation. Simply download the [SDK](https://github.com/RT-Thread-Studio/sdk-bsp-ra6m3-hmi-board/tree/main/projects/hmi-board-lvgl) for the supported motherboard and youll be on your way to creating your next GUI application in no time. For more information, check out the [Software design description](https://github.com/RT-Thread-Studio/sdk-bsp-ra6m3-hmi-board/blob/main/projects/hmi-board-lvgl/README.md).
## Creating new project with LVGL
It is recommended to start your project by downloading the HMI-Board SDK example project. It comes fully equipped with LVGL and dave-2d support (if the modules are present), so you wont need to do any additional integration work.
## HW acceleration for Renesas RA6M3 platforms
For RA6M3 platforms, hardware acceleration can be achieved using the dave-2d GPU, depending on the platform used. Each accelerator has its own context, allowing them to be used individually or simultaneously in LVGLs multithreading mode.
### Dave-2d accelerator
LVGL can offload several drawing features to the dave-2d engine, freeing up the CPU for other operations while dave-2d runs. An RTOS is required to block the LVGL drawing thread and switch to another task or suspend the CPU for power savings. Supported draw callbacks can be found in “src/draw/renesas/lv_gpu_d2_ra6m3.c”.
LVGL can offload several drawing features to the dave-2d engine, freeing up the CPU for other operations while dave-2d runs. An RTOS is required to block the LVGL drawing thread and switch to another task or suspend the CPU for power savings. Supported draw callbacks can be found in “src/draw/renesas/lv_gpu_d2_ra6m3.c”.
```c
ra_2d_draw_ctx->blend = lv_draw_ra6m3_2d_blend;
ra_2d_draw_ctx->base_draw.draw_img_decoded = lv_port_gpu_img_decoded;
ra_2d_draw_ctx->base_draw.wait_for_finish = lv_port_gpu_wait;
ra_2d_draw_ctx->base_draw.draw_letter = lv_draw_gpu_letter;
```
### Features supported:
All operations can be used in conjunction with optional transparency.
- RGB565 and ARGB8888 color formats
- Area fill with color
- BLIT (BLock Image Transfer)
- Color conversion
- Rotate and scale
- Alpha blending
- Bilinear filtering
- RTOS integration layer
- Default RT-Thread code provided
- Subpixel exact placement
### Basic configuration:
- Select Renesas dave-2d engine in lv_conf.h: Set `LV_USE_GPU_RA6M3_G2D` to 1
- Set referenced header file in lv_conf.h: `#define LV_GPU_RA6M3_G2D_INCLUDE "hal_data.h"`
### RT-Thread Example:
```c
#define COLOR_BUFFER (LV_HOR_RES_MAX * LV_VER_RES_MAX)
static lv_disp_drv_t disp_drv;
/*A static or global variable to store the buffers*/
static lv_color_t buf_1[COLOR_BUFFER];
```
- After initializing your peripherals (such as SPI, GPIOs, and LCD) in the `lv_port_disp_init()` function, you can initialize LVGL using [`lv_init()`.](https://docs.lvgl.io/master/API/core/lv_obj.html#_CPPv47lv_initv) Next, register the frame buffers using `lv_disp_draw_buf_init()` and create a new display driver using `lv_disp_drv_init()`.
```c
/*Initialize `disp_buf` with the buffer(s). With only one buffer use NULL instead buf_2 */
lv_disp_draw_buf_init(&disp_buf, buf_1, RT_NULL, COLOR_BUFFER);
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
/*Set the resolution of the display*/
disp_drv.hor_res = LV_HOR_RES_MAX;
disp_drv.ver_res = LV_VER_RES_MAX;
/*Set a display buffer*/
disp_drv.draw_buf = &disp_buf;
/*Used to copy the buffer's content to the display*/
disp_drv.flush_cb = disp_flush;
/* Initialize GPU module */
lv_port_gpu_hw_init();
/*Finally register the driver*/
lv_disp_drv_register(&disp_drv);
```
* To run LVGL, youll need to create a thread. You can find examples of how to do this using RT-Thread in the `env_support/rt-thread/lv_rt_thread_port.c` file.
```c
static void lvgl_thread_entry(void *parameter)
{
#if LV_USE_LOG
lv_log_register_print_cb(lv_rt_log);
#endif /* LV_USE_LOG */
lv_init();
lv_port_disp_init();
lv_port_indev_init();
lv_user_gui_init();
/* handle the tasks of LVGL */
while(1)
{
lv_task_handler();
rt_thread_mdelay(LV_DISP_DEF_REFR_PERIOD);
}
}
static int lvgl_thread_init(void)
{
rt_err_t err;
/* create lvgl thread */
err = rt_thread_init(&lvgl_thread, "LVGL", lvgl_thread_entry, RT_NULL,
&lvgl_thread_stack[0], sizeof(lvgl_thread_stack), PKG_LVGL_THREAD_PRIO, 10);
if(err != RT_EOK)
{
LOG_E("Failed to create LVGL thread");
return -1;
}
rt_thread_startup(&lvgl_thread);
return 0;
}
INIT_ENV_EXPORT(lvgl_thread_init);
```
- The last step is to create a function to output the frame buffer to your LCD. The specifics of this function will depend on the features of your MCU. Heres an example for a typical MCU interface: `my_flush_cb`.
```c
static void my_flush_cb(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
{
#ifdef PKG_USING_ILI9341
lcd_fill_array_spi(area->x1, area->y1, area->x2, area->y2, color_p);
#elif LV_USE_GPU_RA6M3_G2D
lv_port_gpu_blit(area->x1, area->y1, color_p, area);
#else
......
#endif
lv_disp_flush_ready(disp_drv);
}
```

@ -132,7 +132,7 @@ LVGL needs just one simple driver function to copy an array of pixels into a giv
If you can do this with your display then you can use it with LVGL. If you can do this with your display then you can use it with LVGL.
Some examples of the supported display types: Some examples of the supported display types:
- TFTs with 16 or 24 bit color depth - TFTs with 16 or 32 bit color depth
- Monitors with an HDMI port - Monitors with an HDMI port
- Small monochrome displays - Small monochrome displays
- Gray-scale displays - Gray-scale displays

@ -2,14 +2,38 @@
# File System Interfaces # File System Interfaces
LVGL has a [File system](https://docs.lvgl.io/master/overview/file-system.html) module to provide an abstraction layer for various file system drivers. LVGL has a [File system](https://docs.lvgl.io/master/overview/file-system.html) module to provide an abstraction layer for various file system drivers.
You still need to provide the drivers and libraries, this extension provides only the bridge between FATFS, LittleFS, STDIO, POSIX, WIN32 and LVGL.
LVG has built in support for: ## Built in wrappers
- [FATFS](http://elm-chan.org/fsw/ff/00index_e.html)
- STDIO (Linux and Windows using C standard function .e.g fopen, fread)
- POSIX (Linux and Windows using POSIX function .e.g open, read)
- WIN32 (Windows using Win32 API function .e.g CreateFileA, ReadFile)
You still need to provide the drivers and libraries, this extension provides only the bridge between FATFS, STDIO, POSIX, WIN32 and LVGL. ### FATFS
Bridge for [FatFS](http://elm-chan.org/fsw/ff/00index_e.html). FatFS itself is not part of LVGL, but can be added and initialized externally.
### LittleFS
Though `lv_fs_littlefs` uses [LittleFS]((https://github.com/littlefs-project/littlefs)) API, the LittleFS library needs other external libraries that handle the mounting of partitions and low-level accesses, according to the given architecture. The functions for the latter are given to the lfs_t structure as pointers by an external low-level library.
There's a convenience function called `lv_fs_littlefs_set_driver(LV_FS_LITTLEFS_LETTER, my_lfs)`, specific to `lv_fs_littlefs`, to attach a `lfs_t` object's pointer to a registered driver-letter. See its comments for more info.
[esp_littlefs](https://components.espressif.com/components/joltwallet/littlefs) is a wrapper for LittleFS to be used in Espressif ESP-devices. It handles the mounting and has the low-level `littlefs_api` functions to read/write/erase blocks that LittleFS library needs. On mounting by `esp_littlefs` the `lfs_t` structures are created. You need to get a handle to these to use ESP with `lv_fs_littlefs`, as all functions use that `lfs_t` in LittleFS to identify the mounted partition.
In case you don't find a special function in the `lv_fs_littlefs` wrapper, you can look for it in the `esp_littlefs` API and use it directly, as `lv_fs_littlefs` and the `esp_littlefs` APIs can be used side-by-side.
### STDIO
Bride to C standard functions on Linux and Windows. For example `fopen`, `fread`, etc.
### POSIX
Bride to POSIX functions on Linux and Windows. For example `open`, `read`, etc.
### WIN32
Bride to Win32 API function. For example `CreateFileA`, `ReadFile`, etc.
## Usage ## Usage

@ -12,6 +12,7 @@
png png
gif gif
freetype freetype
tiny_ttf
qrcode qrcode
rlottie rlottie
ffmpeg ffmpeg

@ -0,0 +1,35 @@
# Tiny TTF font engine
## Usage
Use https://github.com/nothings/stb to render TrueType fonts in LVGL.
When enabled in `lv_conf.h` with `LV_USE_TINY_TTF`
`lv_tiny_ttf_create_data(data, data_size, font_size)` can be used to
create a TTF font instance at the specified font size. You can then
use that font anywhere `lv_font_t` is accepted.
By default, the TTF or OTF file must be embedded as an array, either in
a header, or loaded into RAM in order to function.
However, if `LV_TINY_TTF_FILE_SUPPORT` is enabled,
`lv_tiny_ttf_create_file(path, font_size)` will also be available,
allowing tiny_ttf to stream from a file. The file must remain open the
entire time the font is being used, and streaming on demand may be
considerably slower.
After a font is created, you can change the font size in pixels by using
`lv_tiny_ttf_set_size(font, font_size)`.
By default, a font will use up to 4KB of cache to speed up rendering
glyphs. This maximum can be changed by using
`lv_tiny_ttf_create_data_ex(data, data_size, font_size, cache_size)`
or `lv_tiny_ttf_create_file_ex(path, font_size, cache_size)` (when
available). The cache size is indicated in bytes.
## API
```eval_rst
.. doxygenfile:: lv_tiny_ttf.h
:project: lvgl
```

@ -63,12 +63,11 @@ See the [Display background](#display-background) section for more details. If t
This configuration (transparent screen and display) could be used to create for example OSD menus where a video is played on a lower layer, and a menu is overlayed on an upper layer. This configuration (transparent screen and display) could be used to create for example OSD menus where a video is played on a lower layer, and a menu is overlayed on an upper layer.
To handle transparent displays, special (slower) color mixing algorithms need to be used by LVGL so this feature needs to enabled with `LV_COLOR_SCREEN_TRANSP` in `lv_conf.h`. To handle transparent displays, special (slower) color mixing algorithms need to be used by LVGL so this feature needs to enabled with `LV_COLOR_SCREEN_TRANSP` in `lv_conf.h`.
As this mode operates on the Alpha channel of the pixels `LV_COLOR_DEPTH = 32` is also required. The Alpha channel of 32-bit colors will be 0 where there are no objects and 255 where there are solid objects. The Alpha channel of 32-bit colors will be 0 where there are no objects and 255 where there are solid objects.
In summary, to enable transparent screens and displays for OSD menu-like UIs: In summary, to enable transparent screens and displays for OSD menu-like UIs:
- Enable `LV_COLOR_SCREEN_TRANSP` in `lv_conf.h` - Enable `LV_COLOR_SCREEN_TRANSP` in `lv_conf.h`
- Be sure to use `LV_COLOR_DEPTH 32` - Set the screen's opacity to `LV_OPA_TRANSP` e.g. with `lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, LV_PART_MAIN)`
- Set the screen's opacity to `LV_OPA_TRANSP` e.g. with `lv_obj_set_style_local_bg_opa(lv_scr_act(), LV_OBJMASK_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP)`
- Set the display opacity to `LV_OPA_TRANSP` with `lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP);` - Set the display opacity to `LV_OPA_TRANSP` with `lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP);`
## Features of displays ## Features of displays

@ -34,11 +34,11 @@ lv_label_set_text(label2, "Button 2"); /*Set the text of the label*/
lv_obj_del(label2); lv_obj_del(label2);
``` ```
## Bring to the foreground ## Change order
There are four explicit ways to bring an object to the foreground: There are four explicit ways to bring an object to the foreground:
- Use `lv_obj_move_foreground(obj)` to bring an object to the foreground. Similarly, use `lv_obj_move_background(obj)` to move it to the background. - Use `lv_obj_move_foreground(obj)` to bring an object to the foreground. Similarly, use `lv_obj_move_background(obj)` to move it to the background.
- Use `lv_obj_move_up(obj)` to move an object one position up in the hierarchy, Similarly, use `lv_obj_move_down(obj)` to move an object one position down in the hierarchy. - Use `lv_obj_move_to_index(obj, idx)` to move an object to a given index in the order of children. (0: backgroud, child_num - 1: foreground, <0: count from the top, to move forward (up): `lv_obj_move_to_index(obj, lv_obj_get_index(obj) - 1)`)
- Use `lv_obj_swap(obj1, obj2)` to swap the relative layer position of two objects. - Use `lv_obj_swap(obj1, obj2)` to swap the relative layer position of two objects.
- When `lv_obj_set_parent(obj, new_parent)` is used, `obj` will be on the foreground of the `new_parent`. - When `lv_obj_set_parent(obj, new_parent)` is used, `obj` will be on the foreground of the `new_parent`.

@ -173,7 +173,7 @@ All inputs are disabled during the screen animation.
Screens are created on the currently selected *default display*. Screens are created on the currently selected *default display*.
The *default display* is the last registered display with `lv_disp_drv_register`. You can also explicitly select a new default display using `lv_disp_set_default(disp)`. The *default display* is the last registered display with `lv_disp_drv_register`. You can also explicitly select a new default display using `lv_disp_set_default(disp)`.
`lv_scr_act()`, `lv_scr_load()` and `lv_scr_load_anim()` operate on the default screen. `lv_scr_act()`, `lv_scr_load()` and `lv_scr_load_anim()` operate on the default display.
Visit [Multi-display support](/overview/display) to learn more. Visit [Multi-display support](/overview/display) to learn more.

@ -1,4 +1,32 @@
# ARM-2D GPU # Arm-2D GPU
TODO Arm-2D is not a GPU but **an abstraction layer for 2D GPUs dedicated to Microcontrollers**. It supports all Cortex-M processors ranging from Cortex-M0 to the latest Cortex-M85.
Arm-2D is an open-source project on Github. For more, please refer to: https://github.com/ARM-software/Arm-2D.
## How to Use
In general, you can set the macro `LV_USE_GPU_ARM2D` to `1`in `lv_conf.h` to enable Arm-2D acceleration for LVGL.
If you are using **[CMSIS-Pack](https://github.com/lvgl/lvgl/tree/master/env_support/cmsis-pack)** to deploy the LVGL. You don't have to define the macro `LV_USE_GPU_ARM2D` manually, instead, please select the component `GPU Arm-2D` in the **RTE** dialog. This step will define the macro for us.
## Design Considerations
As mentioned before, Arm-2D is an abstraction layer for 2D GPU; hence if there is no accelerator or dedicated instruction set (such as Helium or ACI) available for Arm-2D, it provides negligible performance boost for LVGL (sometimes worse) for regular Cortex-M processors.
**We highly recommend you enable Arm-2D acceleration for LVGL** when:
- The target processors are **Cortex-M55** and/or **Cortex-M85**
- The target processors support **[Helium](https://developer.arm.com/documentation/102102/0103/?lang=en)**.
- The device vendor provides an arm-2d compliant driver for their propriotory 2D accelerators and/or customized instruction set.
- The target device contains [DMA-350](https://community.arm.com/arm-community-blogs/b/internet-of-things-blog/posts/arm-corelink-dma-350-next-generation-direct-memory-access-for-endpoint-ai)
## Examples
- [A Cortex-M55 (supports Helium) based MDK Project, PC emulation is available.](https://github.com/lvgl/lv_port_an547_cm55_sim)

@ -355,7 +355,7 @@ Set the opacity of the border. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means full
</ul> </ul>
### border_width ### border_width
Set hte width of the border. Only pixel values can be used. Set the width of the border. Only pixel values can be used.
<ul> <ul>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li> <li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li> <li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
@ -708,6 +708,15 @@ Scale down all opacity values of the object by this factor. Value 0, `LV_OPA_0`
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li> <li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
</ul> </ul>
### opa_layered
First draw the object on the layer, then scale down layer opacity factor. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency.
<ul>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> `LV_OPA_COVER`</li>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> Yes</li>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Layout</strong> No</li>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
</ul>
### color_filter_dsc ### color_filter_dsc
Mix a color to all colors of the object. Mix a color to all colors of the object.
<ul> <ul>
@ -772,7 +781,7 @@ Describes how to blend the colors to the background. The possible values are `LV
</ul> </ul>
### layout ### layout
Set the layout if the object. The children will be repositioned and resized according to the policies set for the layout. For the possible values see the documentation of the layouts. Set the layout of the object. The children will be repositioned and resized according to the policies set for the layout. For the possible values see the documentation of the layouts.
<ul> <ul>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li> <li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
<li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li> <li style='display:inline; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>

@ -204,6 +204,10 @@ The default rotation of your display when it is initialized can be set using the
Display rotation can also be changed at runtime using the `lv_disp_set_rotation(disp, rot)` API. Display rotation can also be changed at runtime using the `lv_disp_set_rotation(disp, rot)` API.
If you enable rotation the coordinates of the pointer input devices (e.g. touchpad) will be rotated too.
Note that when using software rotation, you cannot use neither `direct_mode` nor `full_refresh` in the driver. When using either of these, you will have to rotate the pixels yourself e.g. in the `flush_cb`.
Support for software rotation is a new feature, so there may be some glitches/bugs depending on your configuration. If you encounter a problem please open an issue on [GitHub](https://github.com/lvgl/lvgl/issues). Support for software rotation is a new feature, so there may be some glitches/bugs depending on your configuration. If you encounter a problem please open an issue on [GitHub](https://github.com/lvgl/lvgl/issues).
### Decoupling the display refresh timer ### Decoupling the display refresh timer

@ -114,7 +114,7 @@ You need to have 3 buttons available:
- `LV_KEY_RIGHT` will simulate turning encoder right - `LV_KEY_RIGHT` will simulate turning encoder right
- other keys will be passed to the focused widget - other keys will be passed to the focused widget
If you hold the keys it will simulate an encoder advance with period specified in `indev_drv.long_press_rep_time`. If you hold the keys it will simulate an encoder advance with period specified in `indev_drv.long_press_repeat_time`.
```c ```c
indev_drv.type = LV_INDEV_TYPE_ENCODER; indev_drv.type = LV_INDEV_TYPE_ENCODER;
@ -172,7 +172,7 @@ The default value of the following parameters can be changed in `lv_indev_drv_t`
- `scroll_limit` Number of pixels to slide before actually scrolling the object. - `scroll_limit` Number of pixels to slide before actually scrolling the object.
- `scroll_throw` Scroll throw (momentum) slow-down in [%]. Greater value means faster slow-down. - `scroll_throw` Scroll throw (momentum) slow-down in [%]. Greater value means faster slow-down.
- `long_press_time` Press time to send `LV_EVENT_LONG_PRESSED` (in milliseconds) - `long_press_time` Press time to send `LV_EVENT_LONG_PRESSED` (in milliseconds)
- `long_press_rep_time` Interval of sending `LV_EVENT_LONG_PRESSED_REPEAT` (in milliseconds) - `long_press_repeat_time` Interval of sending `LV_EVENT_LONG_PRESSED_REPEAT` (in milliseconds)
- `read_timer` pointer to the `lv_timer` which reads the input device. Its parameters can be changed by `lv_timer_...()` functions. `LV_INDEV_DEF_READ_PERIOD` in `lv_conf.h` sets the default read period. - `read_timer` pointer to the `lv_timer` which reads the input device. Its parameters can be changed by `lv_timer_...()` functions. `LV_INDEV_DEF_READ_PERIOD` in `lv_conf.h` sets the default read period.
### Feedback ### Feedback

@ -25,7 +25,7 @@ So in the example the first row will have 2 buttons each with 50% width and a se
The buttons' width can be set relative to the other button in the same row with `lv_btnmatrix_set_btn_width(btnm, btn_id, width)` The buttons' width can be set relative to the other button in the same row with `lv_btnmatrix_set_btn_width(btnm, btn_id, width)`
E.g. in a line with two buttons: *btnA, width = 1* and *btnB, width = 2*, *btnA* will have 33 % width and *btnB* will have 66 % width. E.g. in a line with two buttons: *btnA, width = 1* and *btnB, width = 2*, *btnA* will have 33 % width and *btnB* will have 66 % width.
It's similar to how the [`flex-grow`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) property works in CSS. It's similar to how the [`flex-grow`](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) property works in CSS.
The width must be in the \[1..7\] range and the default width is 1. The width must be in the \[1..15\] range and the default width is 1.
In addition to the width, each button can be customized with the following parameters: In addition to the width, each button can be customized with the following parameters:
- `LV_BTNMATRIX_CTRL_HIDDEN` Makes a button hidden (hidden buttons still take up space in the layout, they are just not visible or clickable) - `LV_BTNMATRIX_CTRL_HIDDEN` Makes a button hidden (hidden buttons still take up space in the layout, they are just not visible or clickable)

@ -43,7 +43,7 @@ Options are passed to the drop-down list as a string with `lv_dropdown_set_optio
The `lv_dropdown_add_option(dropdown, "New option", pos)` function inserts a new option to `pos` index. The `lv_dropdown_add_option(dropdown, "New option", pos)` function inserts a new option to `pos` index.
To save memory the options can set from a static(constant) string too with `lv_dropdown_set_static_options(dropdown, options)`. To save memory the options can set from a static(constant) string too with `lv_dropdown_set_options_static(dropdown, options)`.
In this case the options string should be alive while the drop-down list exists and `lv_dropdown_add_option` can't be used In this case the options string should be alive while the drop-down list exists and `lv_dropdown_add_option` can't be used
You can select an option manually with `lv_dropdown_set_selected(dropdown, id)`, where `id` is the index of an option. You can select an option manually with `lv_dropdown_set_selected(dropdown, id)`, where `id` is the index of an option.

@ -44,7 +44,9 @@ This is not the case with `lv_label_set_text_static`. The buffer you pass to `lv
### Text recolor ### Text recolor
In the text, you can use commands to recolor parts of the text. For example: `"Write a #ff0000 red# word"`. In the text, you can use commands to recolor parts of the text. For example: `"Write a #ff0000 red# word"`.
This feature can be enabled individually for each label by `lv_label_set_recolor()` function. This feature can be enabled individually for each label by `lv_label_set_recolor()` function,
recoloring is only supported when the text wrapped with `##ff0000 ... #`sintax is in one line,
it is not supported in wrapped text, see example `Line wrap, recoloring and scrolling`.
### Text selection ### Text selection
If enabled by `LV_LABEL_TEXT_SELECTION` part of the text can be selected. It's similar to when you use your mouse on a PC to select a text. If enabled by `LV_LABEL_TEXT_SELECTION` part of the text can be selected. It's similar to when you use your mouse on a PC to select a text.

@ -1,5 +1,7 @@
# Calendar (lv_calendar) # Calendar (lv_calendar)
**From v8.1 the header is added directly into the Calendar widget and the API of the headers has been changed.**
## Overview ## Overview
The Calendar object is a classic calendar which can: The Calendar object is a classic calendar which can:
@ -13,13 +15,16 @@ The Calendar is added to the default group (if it is set). Calendar is an editab
To make the Calendar flexible, by default it doesn't show the current year or month. Instead, there are optional "headers" that can be attached to the calendar. To make the Calendar flexible, by default it doesn't show the current year or month. Instead, there are optional "headers" that can be attached to the calendar.
## Parts and Styles ## Parts and Styles
The calendar object uses the [Button matrix](/widgets/core/btnmatrix) object under the hood to arrange the days into a matrix. The Calendar is composed of 3 widegets
- Container: A rectangle which is a container for the *Header* and the *Days*. Uses only `LV_PART_MAIN` where all the background related style properties are working.
- Days: It's a [Button matrix](/widgets/core/btnmatrix) object under the hood to arrange the days into a matrix. `lv_calendar_get_btnmatrix(calendar)` can be used to get it.
- `LV_PART_MAIN` The background of the calendar. Uses all the background related style properties. - `LV_PART_MAIN` The background of the calendar. Uses all the background related style properties.
- `LV_PART_ITEMS` Refers to the dates and day names. Button matrix control flags are set to differentiate the buttons and a custom drawer event is added modify the properties of the buttons as follows: - `LV_PART_ITEMS` Refers to the dates and day names. Button matrix control flags are set to differentiate the buttons and a custom drawer event is added modify the properties of the buttons as follows:
- day names have no border, no background and drawn with a gray color - day names have no border, no background and drawn with a gray color
- days of the previous and next month have `LV_BTNMATRIX_CTRL_DISABLED` flag - days of the previous and next month have `LV_BTNMATRIX_CTRL_DISABLED` flag
- today has a thicker border with the theme's primary color - today has a thicker border with the theme's primary color
- highlighted days have some opacity with the theme's primary color. - highlighted days have some opacity with the theme's primary color.
- Header: Not created by default, the details are up to the given header.
## Usage ## Usage
@ -53,8 +58,6 @@ Learn more about [Keys](/overview/indev).
## Headers ## Headers
**From v8.1 the header is added directly into the Calendar widget and the API of the headers has been changed.**
### Arrow buttons ### Arrow buttons
`lv_calendar_header_arrow_create(calendar)` creates a header that contains a left and right arrow on the sides and a text with the current year and month between them. `lv_calendar_header_arrow_create(calendar)` creates a header that contains a left and right arrow on the sides and a text with the current year and month between them.

@ -63,6 +63,12 @@ install(
FILES_MATCHING FILES_MATCHING
PATTERN "*.h") PATTERN "*.h")
install(
FILES "${LV_CONF_PATH}"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${INC_INSTALL_DIR}/../"
RENAME "lv_conf.h"
OPTIONAL)
set_target_properties( set_target_properties(
lvgl lvgl
PROPERTIES OUTPUT_NAME lvgl PROPERTIES OUTPUT_NAME lvgl

@ -12,17 +12,39 @@ if(LV_MICROPYTHON)
${LVGL_ROOT_DIR}/../ ${LVGL_ROOT_DIR}/../
REQUIRES REQUIRES
main) main)
else()
if(CONFIG_LV_BUILD_EXAMPLES)
file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c)
set_source_files_properties(${EXAMPLE_SOURCES} COMPILE_FLAGS "-Wno-unused-variable -Wno-format")
endif()
target_compile_definitions(${COMPONENT_LIB} if(CONFIG_LV_USE_DEMO_WIDGETS)
INTERFACE "-DLV_CONF_INCLUDE_SIMPLE") file(GLOB_RECURSE DEMO_WIDGETS_SOURCES ${LVGL_ROOT_DIR}/demos/widgets/*.c)
list(APPEND DEMO_SOURCES ${DEMO_WIDGETS_SOURCES})
endif()
if(CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER)
file(GLOB_RECURSE DEMO_KEYPAD_AND_ENCODER_SOURCES ${LVGL_ROOT_DIR}/demos/keypad_encoder/*.c)
list(APPEND DEMO_SOURCES ${DEMO_KEYPAD_AND_ENCODER_SOURCES})
endif()
if(CONFIG_LV_USE_DEMO_BENCHMARK)
file(GLOB_RECURSE DEMO_BENCHMARK_SOURCES ${LVGL_ROOT_DIR}/demos/benchmark/*.c)
list(APPEND DEMO_SOURCES ${DEMO_BENCHMARK_SOURCES})
endif()
if(CONFIG_LV_USE_DEMO_STRESS)
file(GLOB_RECURSE DEMO_STRESS_SOURCES ${LVGL_ROOT_DIR}/demos/stress/*.c)
list(APPEND DEMO_SOURCES ${DEMO_STRESS_SOURCES})
endif()
if(CONFIG_LV_USE_DEMO_MUSIC)
file(GLOB_RECURSE DEMO_MUSIC_SOURCES ${LVGL_ROOT_DIR}/demos/music/*.c)
list(APPEND DEMO_SOURCES ${DEMO_MUSIC_SOURCES})
set_source_files_properties(${DEMO_MUSIC_SOURCES} COMPILE_FLAGS "-Wno-format")
endif()
if(CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM) idf_component_register(SRCS ${SOURCES} ${EXAMPLE_SOURCES} ${DEMO_SOURCES}
target_compile_definitions(${COMPONENT_LIB} INCLUDE_DIRS ${LVGL_ROOT_DIR} ${LVGL_ROOT_DIR}/src ${LVGL_ROOT_DIR}/../
INTERFACE "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR") ${LVGL_ROOT_DIR}/examples ${LVGL_ROOT_DIR}/demos
REQUIRES esp_timer)
endif() endif()
else()
idf_component_register(SRCS ${SOURCES} INCLUDE_DIRS ${LVGL_ROOT_DIR}
${LVGL_ROOT_DIR}/src ${LVGL_ROOT_DIR}/../)
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE") target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE")
@ -30,4 +52,3 @@ else()
target_compile_definitions(${COMPONENT_LIB} target_compile_definitions(${COMPONENT_LIB}
PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR") PUBLIC "-DLV_ATTRIBUTE_FAST_MEM=IRAM_ATTR")
endif() endif()
endif()

@ -20,7 +20,7 @@
--> -->
<package schemaVersion="1.4" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd"> <package schemaVersion="1.4" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/v1.7.7/schema/PACK.xsd">
<vendor>LVGL</vendor> <vendor>LVGL</vendor>
<name>lvgl</name> <name>lvgl</name>
<description>LVGL (Light and Versatile Graphics Library) is a free and open-source graphics library providing everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint.</description> <description>LVGL (Light and Versatile Graphics Library) is a free and open-source graphics library providing everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint.</description>
@ -36,12 +36,47 @@
<repository type="git">https://github.com/lvgl/lvgl.git</repository> <repository type="git">https://github.com/lvgl/lvgl.git</repository>
<releases> <releases>
<release date="2022-07-06" version="1.0.6" url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/LVGL.lvgl.1.0.6.pack"> <release date="2023-12-05" version="8.3.11" url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/LVGL.lvgl.8.3.11.pack">
- LVGL 8.3.0 release - LVGL 8.3.11
- Apply patch for memory leaking issue - Add LittleFS Library to LVGL8
- Apply patch to speed up non normal blend mode - Backport Tiny TTF to LVGL8
- Add 9-key input mode to pinyin - Some minor fixes
- Other minor changes </release>
<release date="2023-09-19" version="8.3.10" url="https://github.com/lvgl/lvgl/raw/9e388055ec0bcad5179461e66d6dac6823129eee/env_support/cmsis-pack/LVGL.lvgl.8.3.10.pack">
- LVGL 8.3.10
- Some minor fixes
</release>
<release date="2023-08-04" version="8.3.9" url="https://github.com/lvgl/lvgl/raw/bdf5bfb88ce107f16cf9128cf75e61394b3219d0/env_support/cmsis-pack/LVGL.lvgl.8.3.9.pack">
- LVGL 8.3.10
- Add snapshot, fragment, imgfont, gridnav, msg and monkey
- Other minor fixes
</release>
<release date="2023-07-04" version="8.3.8" url="https://github.com/lvgl/lvgl/raw/15433d69b9d8ae6aa74f49946874af81a0cc5921/env_support/cmsis-pack/LVGL.lvgl.8.3.8.pack">
- LVGL 8.3.8
- Add renesas-ra6m3 gpu adaptation
- Improve performance and add more features for PXP and VGLite
- Minor updates
</release>
<release date="2023-04-28" version="8.3.7" url="https://github.com/lvgl/lvgl/raw/2b56e04205481daa6575bd5f7ab5df59d11676eb/env_support/cmsis-pack/LVGL.lvgl.8.3.7.pack">
- LVGL 8.3.7
- Minor updates
</release>
<release date="2023-04-02" version="8.3.6" url="https://github.com/lvgl/lvgl/raw/6b0092c0d91b2c7bfded48e04cc7b486ed3a72bd/env_support/cmsis-pack/LVGL.lvgl.8.3.6.pack">
- LVGL 8.3.6 release
- Various fixes, See CHANGELOG.md
</release>
<release date="2023-02-06" version="8.3.5" url="https://github.com/lvgl/lvgl/raw/e7e8cf846dce96f7542e27b5c9655bab680c31a1/env_support/cmsis-pack/LVGL.lvgl.8.3.5.pack">
- LVGL 8.3.5 release
- Use LVGL version as the cmsis-pack version
- Fix GPU support for NXP PXP and NXP VGLite
- Rework stm32 DMA2D support
- Various fixes
</release>
<release date="2022-12-31" version="1.0.6-p1" url="https://github.com/lvgl/lvgl/raw/dbb15bb3ea0365373bc1ba8b182556f937e61e7d/env_support/cmsis-pack/LVGL.lvgl.1.0.6-p1.pack">
- LVGL 8.3.4 release
- Update GPU Arm-2D support
- Various fixes
</release> </release>
<release date="2022-06-29" version="1.0.5" url="https://github.com/GorgonMeducer/lvgl/raw/922108dbbe6d1c0be1069c342ca8693afee8c169/env_support/cmsis-pack/LVGL.lvgl.1.0.5.pack"> <release date="2022-06-29" version="1.0.5" url="https://github.com/GorgonMeducer/lvgl/raw/922108dbbe6d1c0be1069c342ca8693afee8c169/env_support/cmsis-pack/LVGL.lvgl.1.0.5.pack">
- LVGL 8.3.0-dev - LVGL 8.3.0-dev
@ -159,6 +194,90 @@
<require Cclass="Acceleration" Cgroup="Arm-2D"/> <require Cclass="Acceleration" Cgroup="Arm-2D"/>
</condition> </condition>
<condition id="LVGL-GPU-Arm-2D">
<description>Enable LVGL Arm-2D GPU Support</description>
<require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/>
<!--<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU Arm-2D"/>-->
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU STM32-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU SWM341-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-PXP"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-VGLite"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU GD32-IPA"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="LVGL-GPU-RA6M3-G2D"/>
</condition>
<condition id="LVGL-GPU-STM32-DMA2D">
<description>Enable LVGL Arm-2D GPU Support</description>
<require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU Arm-2D"/>
<!--<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU STM32-DMA2D"/>-->
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU SWM341-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-PXP"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-VGLite"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU GD32-IPA"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="LVGL-GPU-RA6M3-G2D"/>
</condition>
<condition id="LVGL-GPU-SWM341-DMA2D">
<description>Enable LVGL Arm-2D GPU Support</description>
<require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU Arm-2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU STM32-DMA2D"/>
<!--<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU SWM341-DMA2D"/>-->
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-PXP"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-VGLite"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU GD32-IPA"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="LVGL-GPU-RA6M3-G2D"/>
</condition>
<condition id="LVGL-GPU-NXP-PXP">
<description>Enable LVGL Arm-2D GPU Support</description>
<require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU Arm-2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU STM32-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU SWM341-DMA2D"/>
<!--<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-PXP"/>-->
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-VGLite"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU GD32-IPA"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="LVGL-GPU-RA6M3-G2D"/>
</condition>
<condition id="LVGL-GPU-NXP-VGLite">
<description>Enable LVGL Arm-2D GPU Support</description>
<require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU Arm-2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU STM32-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU SWM341-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-PXP"/>
<!--<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-VGLite"/>-->
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU GD32-IPA"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="LVGL-GPU-RA6M3-G2D"/>
</condition>
<condition id="LVGL-GPU-GD32-IPA">
<description>Enable LVGL Arm-2D GPU Support</description>
<require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU Arm-2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU STM32-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU SWM341-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-PXP"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-VGLite"/>
<!--<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU GD32-IPA"/>-->
<deny Cclass="LVGL" Cgroup="lvgl" Csub="LVGL-GPU-RA6M3-G2D"/>
</condition>
<condition id="LVGL-GPU-RA6M3-G2D">
<description>Enable LVGL Arm-2D GPU Support</description>
<require Cclass="LVGL" Cgroup="lvgl" Csub="Essential"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU Arm-2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU STM32-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU SWM341-DMA2D"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-PXP"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU NXP-VGLite"/>
<deny Cclass="LVGL" Cgroup="lvgl" Csub="GPU GD32-IPA"/>
<!--<deny Cclass="LVGL" Cgroup="lvgl" Csub="LVGL-GPU-RA6M3-G2D"/>-->
</condition>
</conditions> </conditions>
<!-- apis section (optional - for Application Programming Interface descriptions) --> <!-- apis section (optional - for Application Programming Interface descriptions) -->
<!-- <!--
@ -191,7 +310,7 @@
--> -->
<components> <components>
<bundle Cbundle="LVGL" Cclass="LVGL" Cversion="8.3.0"> <bundle Cbundle="LVGL" Cclass="LVGL" Cversion="8.3.11">
<description>LVGL (Light and Versatile Graphics Library) is a free and open-source graphics library providing everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint.</description> <description>LVGL (Light and Versatile Graphics Library) is a free and open-source graphics library providing everything you need to create an embedded GUI with easy-to-use graphical elements, beautiful visual effects and a low memory footprint.</description>
<doc></doc> <doc></doc>
<component Cgroup="lvgl" Csub="Essential" > <component Cgroup="lvgl" Csub="Essential" >
@ -324,11 +443,19 @@
<file category="sourceC" name="src/widgets/lv_textarea.c" /> <file category="sourceC" name="src/widgets/lv_textarea.c" />
<!-- general --> <!-- general -->
<file category="preIncludeGlobal" name="lv_conf_cmsis.h" attr="config" version="1.0.2" /> <file category="preIncludeGlobal" name="lv_conf_cmsis.h" attr="config" version="1.0.4" />
<file category="sourceC" name="lv_cmsis_pack.c" attr="config" version="1.0.0" /> <file category="sourceC" name="lv_cmsis_pack.c" attr="config" version="1.0.0" />
<file category="header" name="lvgl.h" /> <file category="header" name="lvgl.h" />
<file category="doc" name="README.md"/> <file category="doc" name="README.md"/>
<!-- code template -->
<file category="header" name="examples/porting/lv_port_disp_template.h" attr="template" select="Display port template" version="2.0.0"/>
<file category="sourceC" name="examples/porting/lv_port_disp_template.c" attr="template" select="Display port template" version="2.0.0"/>
<file category="header" name="examples/porting/lv_port_indev_template.h" attr="template" select="Input devices port template" version="2.0.0"/>
<file category="sourceC" name="examples/porting/lv_port_indev_template.c" attr="template" select="Input devices port template" version="2.0.0"/>
<file category="header" name="examples/porting/lv_port_fs_template.h" attr="template" select="File system port template" version="2.0.0"/>
<file category="sourceC" name="examples/porting/lv_port_fs_template.c" attr="template" select="File system port template" version="2.0.0"/>
</files> </files>
<Pre_Include_Global_h> <Pre_Include_Global_h>
@ -360,7 +487,7 @@
</files> </files>
</component> </component>
<component Cgroup="lvgl" Csub="GPU Arm-2D" condition="LVGL-Essential" Cversion="1.0.3"> <component Cgroup="lvgl" Csub="GPU Arm-2D" condition="LVGL-GPU-Arm-2D" Cversion="1.2.2">
<description>A 2D image processing library from Arm (i.e. Arm-2D) for All Cortex-M processors including Cortex-M0</description> <description>A 2D image processing library from Arm (i.e. Arm-2D) for All Cortex-M processors including Cortex-M0</description>
<files> <files>
<file category="sourceC" name="src/draw/arm2d/lv_gpu_arm2d.c" condition="Arm-2D"/> <file category="sourceC" name="src/draw/arm2d/lv_gpu_arm2d.c" condition="Arm-2D"/>
@ -375,7 +502,7 @@
</component> </component>
<component Cgroup="lvgl" Csub="GPU STM32-DMA2D" condition="LVGL-Essential"> <component Cgroup="lvgl" Csub="GPU STM32-DMA2D" condition="LVGL-GPU-STM32-DMA2D">
<description>An hardware acceleration from STM32-DMA2D</description> <description>An hardware acceleration from STM32-DMA2D</description>
<files> <files>
<file category="sourceC" name="src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c" /> <file category="sourceC" name="src/draw/stm32_dma2d/lv_gpu_stm32_dma2d.c" />
@ -389,7 +516,7 @@
</component> </component>
<component Cgroup="lvgl" Csub="GPU SWM341-DMA2D" condition="LVGL-Essential"> <component Cgroup="lvgl" Csub="GPU SWM341-DMA2D" condition="LVGL-GPU-SWM341-DMA2D">
<description>An hardware acceleration from SWM341-DMA2D</description> <description>An hardware acceleration from SWM341-DMA2D</description>
<files> <files>
<file category="sourceC" name="src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.c" /> <file category="sourceC" name="src/draw/swm341_dma2d/lv_gpu_swm341_dma2d.c" />
@ -403,10 +530,10 @@
</component> </component>
<component Cgroup="lvgl" Csub="GPU NXP-PXP" condition="LVGL-Essential"> <component Cgroup="lvgl" Csub="GPU NXP-PXP" condition="LVGL-GPU-NXP-PXP">
<description>An hardware acceleration from NXP-PXP</description> <description>An hardware acceleration from NXP-PXP</description>
<files> <files>
<file category="sourceC" name="src/draw/nxp/lv_gpu_nxp.c" /> <file category="sourceC" name="src/draw/nxp/pxp/lv_draw_pxp.c" />
<file category="sourceC" name="src/draw/nxp/pxp/lv_draw_pxp_blend.c" /> <file category="sourceC" name="src/draw/nxp/pxp/lv_draw_pxp_blend.c" />
<file category="sourceC" name="src/draw/nxp/pxp/lv_gpu_nxp_pxp.c" /> <file category="sourceC" name="src/draw/nxp/pxp/lv_gpu_nxp_pxp.c" />
<file category="sourceC" name="src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c" /> <file category="sourceC" name="src/draw/nxp/pxp/lv_gpu_nxp_pxp_osa.c" />
@ -420,14 +547,16 @@
</component> </component>
<component Cgroup="lvgl" Csub="GPU NXP-VGLite" condition="LVGL-Essential"> <component Cgroup="lvgl" Csub="GPU NXP-VGLite" condition="LVGL-GPU-NXP-VGLite">
<description>An hardware acceleration from NXP-VGLite</description> <description>An hardware acceleration from NXP-VGLite</description>
<files> <files>
<file category="sourceC" name="src/draw/nxp/lv_gpu_nxp.c" /> <file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite.c" />
<file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_arc.c" /> <file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_arc.c" />
<file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_blend.c" /> <file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_blend.c" />
<file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_line.c" />
<file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_rect.c" /> <file category="sourceC" name="src/draw/nxp/vglite/lv_draw_vglite_rect.c" />
<file category="sourceC" name="src/draw/nxp/vglite/lv_gpu_nxp_vglite.c" /> <file category="sourceC" name="src/draw/nxp/vglite/lv_vglite_buf.c" />
<file category="sourceC" name="src/draw/nxp/vglite/lv_vglite_utils.c" />
</files> </files>
<RTE_Components_h> <RTE_Components_h>
@ -438,6 +567,22 @@
</component> </component>
<component Cgroup="lvgl" Csub="GPU RA6M3-G2D" condition="LVGL-GPU-RA6M3-G2D">
<description>An hardware acceleration from Renesas RA6M3-G2D</description>
<files>
<file category="sourceC" name="src/draw/renesas/lv_gpu_d2_draw_label.c" />
<file category="sourceC" name="src/draw/renesas/lv_gpu_d2_ra6m3.c" />
</files>
<RTE_Components_h>
/*! \brief enable RA6M3-G2D */
#define LV_USE_GPU_RA6M3_G2D 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Extra Themes" condition="LVGL-Essential"> <component Cgroup="lvgl" Csub="Extra Themes" condition="LVGL-Essential">
<description>Extra Themes, Widgets and Layouts</description> <description>Extra Themes, Widgets and Layouts</description>
<files> <files>
@ -583,10 +728,27 @@
<file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_fatfs.c" /> <file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_fatfs.c" />
<file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_posix.c" /> <file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_posix.c" />
<file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_stdio.c" /> <file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_stdio.c" />
<file category="sourceC" name="src/extra/libs/fsdrv/lv_fs_littlefs.c" />
</files> </files>
</component> </component>
<component Cgroup="lvgl" Csub="Libs Tiny TTF" condition="LVGL-Essential">
<description>Add Tiny TTF Library</description>
<files>
<!-- src/extra/libs/tiny_ttf -->
<file category="sourceC" name="src/extra/libs/tiny_ttf/lv_tiny_ttf.c" />
</files>
<RTE_Components_h>
/*! \brief enable Tiny TTF Library */
#define LV_USE_TINY_TTF 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Libs RLOTTIE" condition="LVGL-Essential"> <component Cgroup="lvgl" Csub="Libs RLOTTIE" condition="LVGL-Essential">
<description>Add RLOTTIE support, an extra librbary is required.</description> <description>Add RLOTTIE support, an extra librbary is required.</description>
<files> <files>
@ -632,6 +794,97 @@
</component> </component>
<component Cgroup="lvgl" Csub="Snapshot" condition="LVGL-Essential">
<description>Add the Snapshot service</description>
<files>
<!-- src/extra/others/snapshot -->
<file category="sourceC" name="src/extra/others/snapshot/lv_snapshot.c" />
</files>
<RTE_Components_h>
/*! \brief enable snapshot support */
#define LV_USE_SNAPSHOT 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Fragment" condition="LVGL-Essential">
<description>Add the Fragment service</description>
<files>
<!-- src/extra/others/fragment -->
<file category="sourceC" name="src/extra/others/fragment/lv_fragment.c" />
<file category="sourceC" name="src/extra/others/fragment/lv_fragment_manager.c" />
</files>
<RTE_Components_h>
/*! \brief enable fragment support */
#define LV_USE_FRAGMENT 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Grid Navigation" condition="LVGL-Essential">
<description>Add the Grid Navigation service</description>
<files>
<!-- src/extra/others/gridnav -->
<file category="sourceC" name="src/extra/others/gridnav/lv_gridnav.c" />
</files>
<RTE_Components_h>
/*! \brief enable the Grid Navigation support*/
#define LV_USE_GRIDNAV 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Image Font" condition="LVGL-Essential">
<description>Add the Image Font service</description>
<files>
<!-- src/extra/others/imgfont -->
<file category="sourceC" name="src/extra/others/imgfont/lv_imgfont.c" />
</files>
<RTE_Components_h>
/*! \brief enable the image font support*/
#define LV_USE_IMGFONT 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Monkey" condition="LVGL-Essential">
<description>Add the Monkey service</description>
<files>
<!-- src/extra/others/monkey -->
<file category="sourceC" name="src/extra/others/monkey/lv_monkey.c" />
</files>
<RTE_Components_h>
/*! \brief enable the monkey service support*/
#define LV_USE_MONKEY 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Message" condition="LVGL-Essential">
<description>Add the Message service</description>
<files>
<!-- src/extra/others/msg -->
<file category="sourceC" name="src/extra/others/msg/lv_msg.c" />
</files>
<RTE_Components_h>
/*! \brief enable the message service support*/
#define LV_USE_MSG 1
</RTE_Components_h>
</component>
<component Cgroup="lvgl" Csub="Benchmark" condition="LVGL-Essential"> <component Cgroup="lvgl" Csub="Benchmark" condition="LVGL-Essential">
<description>Add the official benchmark.</description> <description>Add the official benchmark.</description>
<files> <files>

@ -2,8 +2,8 @@
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"> <index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<vendor>LVGL</vendor> <vendor>LVGL</vendor>
<url>https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/</url> <url>https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/</url>
<timestamp>2022-07-06T00:09:27</timestamp> <timestamp>2023-12-09</timestamp>
<pindex> <pindex>
<pdsc url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/" vendor="LVGL" name="lvgl" version="1.0.6"/> <pdsc url="https://raw.githubusercontent.com/lvgl/lvgl/release/v8.3/env_support/cmsis-pack/" vendor="LVGL" name="lvgl" version="8.3.11"/>
</pindex> </pindex>
</index> </index>

@ -46,12 +46,33 @@ remove the misleading guide above this code segment.
- LV_USE_GPU_SWM341_DMA2D - LV_USE_GPU_SWM341_DMA2D
- LV_USE_GPU_ARM2D - LV_USE_GPU_ARM2D
- LV_USE_IME_PINYIN - LV_USE_IME_PINYIN
- LV_USE_PNG
- LV_USE_BMP
- LV_USE_SJPG
- LV_USE_GIF
- LV_USE_QRCODE
- LV_USE_FREETYPE
- LV_USE_TINY_TTF
- LV_USE_RLOTTIE
- LV_USE_FFMPEG
- LV_USE_SNAPSHOT
- LV_USE_MONKEY
- LV_USE_GRIDNAV
- LV_USE_FRAGMENT
- LV_USE_IMGFONT
- LV_USE_MSG
- LV_USE_IME_PINYIN
5. Update macro `LV_ATTRIBUTE_MEM_ALIGN` and `LV_ATTRIBUTE_MEM_ALIGN_SIZE` to force a WORD alignment. 5. Update macro `LV_ATTRIBUTE_MEM_ALIGN` and `LV_ATTRIBUTE_MEM_ALIGN_SIZE` to force a WORD alignment.
```c ```c
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4 #define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4
#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4))) #define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4)))
``` ```
Update macro `LV_MEM_SIZE` to `(64*1024U)`. Update macro `LV_MEM_SIZE` to `(64*1024U)`.
Update macro `LV_FONT_MONTSERRAT_12` to `1`.
Update macro `LV_FONT_MONTSERRAT_12` to `1`.
6. Update Theme related macros: 6. Update Theme related macros:
```c ```c
@ -90,24 +111,40 @@ Update macro `LV_MEM_SIZE` to `(64*1024U)`.
#if LV_TICK_CUSTOM #if LV_TICK_CUSTOM
extern uint32_t SystemCoreClock; extern uint32_t SystemCoreClock;
#define LV_TICK_CUSTOM_INCLUDE "perf_counter.h" #define LV_TICK_CUSTOM_INCLUDE "perf_counter.h"
#if __PER_COUNTER_VER__ < 10902ul
#define LV_TICK_CUSTOM_SYS_TIME_EXPR ((uint32_t)get_system_ticks() / (SystemCoreClock / 1000ul))
#else
#define LV_TICK_CUSTOM_SYS_TIME_EXPR get_system_ms() #define LV_TICK_CUSTOM_SYS_TIME_EXPR get_system_ms()
#endif
#endif /*LV_TICK_CUSTOM*/ #endif /*LV_TICK_CUSTOM*/
#else #else
#define LV_TICK_CUSTOM 0 #define LV_TICK_CUSTOM 0
#if LV_TICK_CUSTOM #if LV_TICK_CUSTOM
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
/*If using lvgl as ESP32 component*/
// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"
// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
#endif /*LV_TICK_CUSTOM*/ #endif /*LV_TICK_CUSTOM*/
#endif /*__PERF_COUNTER__*/ #endif /*__PERF_COUNTER__*/
``` ```
9. Thoroughly remove the `DEMO USAGE` section.
10. Thoroughly remove the '3rd party libraries' section.
10. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'. 9. Remove all content in `DEMO USAGE` section but keep the following:
```c
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif
/*Benchmark your system*/
#if LV_USE_DEMO_BENCHMARK
/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/
#define LV_DEMO_BENCHMARK_RGB565A8 1
#endif
```
10. Thoroughly remove the `3rd party libraries` section.
11. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'.

@ -21,8 +21,8 @@ if [ `uname -s` = "Linux" ]
CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/" CMSIS_PACK_PATH="/home/$USER/.arm/Packs/ARM/CMSIS/5.7.0/"
PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/" PATH_TO_ADD="$CMSIS_PACK_PATH/CMSIS/Utilities/Linux64/"
else else
CMSIS_PACK_PATH="/C/Users/gabriel/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0" CMSIS_PACK_PATH="/C/Users/$USER/AppData/Local/Arm/Packs/ARM/CMSIS/5.7.0"
PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/" PATH_TO_ADD="/C/Program Files (x86)/7-Zip/:/C/Program Files/7-Zip/:$CMSIS_PACK_PATH/CMSIS/Utilities/Win32/:/C/xmllint/"
fi fi
[[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}" [[ ":$PATH:" != *":$PATH_TO_ADD}:"* ]] && PATH="${PATH}:${PATH_TO_ADD}"
echo $PATH_TO_ADD appended to PATH echo $PATH_TO_ADD appended to PATH

@ -1,6 +1,6 @@
/** /**
* @file lv_conf.h * @file lv_conf.h
* Configuration file for v8.3.0 * Configuration file for v8.3.11
*/ */
/* clang-format off */ /* clang-format off */
@ -76,6 +76,7 @@
/*Input device read period in milliseconds*/ /*Input device read period in milliseconds*/
#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ #define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/
/*Use a custom tick source that tells the elapsed time in milliseconds. /*Use a custom tick source that tells the elapsed time in milliseconds.
*It removes the need to manually update the tick with `lv_tick_inc()`)*/ *It removes the need to manually update the tick with `lv_tick_inc()`)*/
#ifdef __PERF_COUNTER__ #ifdef __PERF_COUNTER__
@ -83,21 +84,20 @@
#if LV_TICK_CUSTOM #if LV_TICK_CUSTOM
extern uint32_t SystemCoreClock; extern uint32_t SystemCoreClock;
#define LV_TICK_CUSTOM_INCLUDE "perf_counter.h" #define LV_TICK_CUSTOM_INCLUDE "perf_counter.h"
#if __PER_COUNTER_VER__ < 10902ul
#define LV_TICK_CUSTOM_SYS_TIME_EXPR ((uint32_t)get_system_ticks() / (SystemCoreClock / 1000ul))
#else
#define LV_TICK_CUSTOM_SYS_TIME_EXPR get_system_ms() #define LV_TICK_CUSTOM_SYS_TIME_EXPR get_system_ms()
#endif
#endif /*LV_TICK_CUSTOM*/ #endif /*LV_TICK_CUSTOM*/
#else #else
#define LV_TICK_CUSTOM 0 #define LV_TICK_CUSTOM 0
#if LV_TICK_CUSTOM #if LV_TICK_CUSTOM
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
/*If using lvgl as ESP32 component*/
// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"
// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
#endif /*LV_TICK_CUSTOM*/ #endif /*LV_TICK_CUSTOM*/
#endif /*__PERF_COUNTER__*/ #endif /*__PERF_COUNTER__*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/ *(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/ #define LV_DPI_DEF 130 /*[px/inch]*/
@ -180,13 +180,21 @@
* GPU * GPU
*-----------*/ *-----------*/
/*Use STM32's DMA2D (aka Chrom Art) GPU*/ /*Use STM32's DMA2D (aka Chrom Art) GPU*/
#if LV_USE_GPU_STM32_DMA2D #if LV_USE_GPU_STM32_DMA2D
/*Must be defined to include path of CMSIS header of target processor /*Must be defined to include path of CMSIS header of target processor
e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ e.g. "stm32f7xx.h" or "stm32f4xx.h"*/
#define LV_GPU_DMA2D_CMSIS_INCLUDE #define LV_GPU_DMA2D_CMSIS_INCLUDE
#endif #endif
/*Enable RA6M3 G2D GPU*/
#if LV_USE_GPU_RA6M3_G2D
/*include path of target processor
e.g. "hal_data.h"*/
#define LV_GPU_RA6M3_G2D_INCLUDE "hal_data.h"
#endif
/*Use SWM341's DMA2D GPU*/ /*Use SWM341's DMA2D GPU*/
#if LV_USE_GPU_SWM341_DMA2D #if LV_USE_GPU_SWM341_DMA2D
#define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h" #define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h"
@ -202,16 +210,6 @@
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
#endif #endif
/*Use SDL renderer API*/
#define LV_USE_GPU_SDL 0
#if LV_USE_GPU_SDL
#define LV_GPU_SDL_INCLUDE_PATH <SDL2/SDL.h>
/*Texture cache size, 8MB by default*/
#define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8)
/*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/
#define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6))
#endif
/*------------- /*-------------
* Logging * Logging
*-----------*/ *-----------*/
@ -350,9 +348,9 @@
*https://fonts.google.com/specimen/Montserrat*/ *https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0 #define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0 #define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0 #define LV_FONT_MONTSERRAT_12 1
#define LV_FONT_MONTSERRAT_14 1 #define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 0 #define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_18 0 #define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0 #define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0 #define LV_FONT_MONTSERRAT_22 0
@ -584,7 +582,6 @@
#define LV_USE_THEME_BASIC 0 #define LV_USE_THEME_BASIC 0
#define LV_USE_THEME_MONO 0 #define LV_USE_THEME_MONO 0
#endif #endif
/*----------- /*-----------
* Layouts * Layouts
*----------*/ *----------*/
@ -595,27 +592,85 @@
/*A layout similar to Grid in CSS.*/ /*A layout similar to Grid in CSS.*/
#define LV_USE_GRID 1 #define LV_USE_GRID 1
/*----------- /*---------------------
* Others * 3rd party libraries
*----------*/ *--------------------*/
/*1: Enable API to take snapshot for object*/ /*File system interfaces for common APIs */
#define LV_USE_SNAPSHOT 0
/*1: Enable Monkey test*/ /*API for fopen, fread, etc*/
#define LV_USE_MONKEY 0 #define LV_USE_FS_STDIO 0
#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()*/
#endif
/*1: Enable grid navigation*/ /*API for open, read, etc*/
#define LV_USE_GRIDNAV 0 #define LV_USE_FS_POSIX 0
#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()*/
#endif
/*1: Enable lv_obj fragment*/ /*API for CreateFile, ReadFile, etc*/
#define LV_USE_FRAGMENT 0 #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_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
/*1: Support using images as font in label or span widgets */ /*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#define LV_USE_IMGFONT 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()*/
#endif
/*1: Enable a published subscriber based messaging system */ /*API for LittleFS (library needs to be added separately). Uses lfs_file_open, lfs_file_read, etc*/
#define LV_USE_MSG 0 #define LV_USE_FS_LITTLEFS 0
#if LV_USE_FS_LITTLEFS
#define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_LITTLEFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*FreeType library*/
#if LV_USE_FREETYPE
/*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/
#define LV_FREETYPE_CACHE_SIZE (16 * 1024)
#if LV_FREETYPE_CACHE_SIZE >= 0
/* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */
/* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */
/* if font size >= 256, must be configured as image cache */
#define LV_FREETYPE_SBIT_CACHE 0
/* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */
/* (0:use system defaults) */
#define LV_FREETYPE_CACHE_FT_FACES 0
#define LV_FREETYPE_CACHE_FT_SIZES 0
#endif
#endif
/*Tiny TTF library*/
#if LV_USE_TINY_TTF
/*Load TTF data from files*/
#define LV_TINY_TTF_FILE_SUPPORT 0
#endif
/*FFmpeg library for image decoding and playing videos
*Supports all major image formats so do not enable other image decoder with it*/
#if LV_USE_FFMPEG
/*Dump input information to stderr*/
#define LV_FFMPEG_DUMP_FORMAT 0
#endif
/*-----------
* Others
*----------*/
/*1: Enable Pinyin input method*/ /*1: Enable Pinyin input method*/
/*Requires: lv_keyboard*/ /*Requires: lv_keyboard*/
@ -641,6 +696,20 @@
/*Enable the examples to be built with the library*/ /*Enable the examples to be built with the library*/
#define LV_BUILD_EXAMPLES 1 #define LV_BUILD_EXAMPLES 1
/*===================
* DEMO USAGE
====================*/
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif
/*Benchmark your system*/
#if LV_USE_DEMO_BENCHMARK
/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/
#define LV_DEMO_BENCHMARK_RGB565A8 1
#endif
/*--END OF LV_CONF_H--*/ /*--END OF LV_CONF_H--*/

@ -71,7 +71,11 @@
# define LV_BIG_ENDIAN_SYSTEM 0 # define LV_BIG_ENDIAN_SYSTEM 0
#endif #endif
#define LV_ATTRIBUTE_MEM_ALIGN ALIGN(4) #ifdef rt_align /* >= RT-Thread v5.0.0 */
# define LV_ATTRIBUTE_MEM_ALIGN rt_align(RT_ALIGN_SIZE)
#else
# define LV_ATTRIBUTE_MEM_ALIGN ALIGN(RT_ALIGN_SIZE)
#endif
/*================== /*==================
* EXAMPLES * EXAMPLES

@ -31,6 +31,12 @@ extern void lv_port_indev_init(void);
extern void lv_user_gui_init(void); extern void lv_user_gui_init(void);
static struct rt_thread lvgl_thread; static struct rt_thread lvgl_thread;
#ifdef rt_align
rt_align(RT_ALIGN_SIZE)
#else
ALIGN(RT_ALIGN_SIZE)
#endif
static rt_uint8_t lvgl_thread_stack[PKG_LVGL_THREAD_STACK_SIZE]; static rt_uint8_t lvgl_thread_stack[PKG_LVGL_THREAD_STACK_SIZE];
#if LV_USE_LOG #if LV_USE_LOG
@ -63,7 +69,7 @@ static int lvgl_thread_init(void)
rt_err_t err; rt_err_t err;
err = rt_thread_init(&lvgl_thread, "LVGL", lvgl_thread_entry, RT_NULL, err = rt_thread_init(&lvgl_thread, "LVGL", lvgl_thread_entry, RT_NULL,
&lvgl_thread_stack[0], sizeof(lvgl_thread_stack), PKG_LVGL_THREAD_PRIO, 0); &lvgl_thread_stack[0], sizeof(lvgl_thread_stack), PKG_LVGL_THREAD_PRIO, 10);
if(err != RT_EOK) if(err != RT_EOK)
{ {
LOG_E("Failed to create LVGL thread"); LOG_E("Failed to create LVGL thread");

@ -0,0 +1,4 @@
This folder is for LVGL SquareLine Studio
SquareLine Studio can automatically put the generated C files into `ui` folder, so that rt-thread will automatically detect them; or, as a user, you can move the generated C files into `ui` folder manually.

@ -0,0 +1,25 @@
from building import *
cwd = GetCurrentDir()
src = Glob('*.c')
inc = [cwd]
# check if .h or .hpp files exsit
def check_h_hpp_exsit(path):
file_dirs = os.listdir(path)
for file_dir in file_dirs:
if os.path.splitext(file_dir)[1] in ['.h', '.hpp']:
return True
return False
sls_src_cwd = cwd
for root, dirs, files in os.walk(sls_src_cwd):
for dir in dirs:
current_path = os.path.join(root, dir)
src = src + Glob(os.path.join(current_path,'*.c')) # add all .c files
if check_h_hpp_exsit(current_path): # add .h and .hpp path
inc = inc + [current_path]
group = DefineGroup('LVGL-SquareLine', src, depend = ['PKG_USING_LVGL_SQUARELINE'], CPPPATH = inc)
Return('group')

@ -0,0 +1,19 @@
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: MIT
*
* Change Logs:
* Date Author Notes
* 2022-05-13 Meco Man First version
*/
#ifdef __RTTHREAD__
void lv_user_gui_init(void)
{
extern void ui_init(void);
ui_init();
}
#endif /* __RTTHREAD__ */

@ -0,0 +1,15 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: MIT
*
* Change Logs:
* Date Author Notes
* 2022-11-20 Meco Man The first version
*/
#ifdef __RTTHREAD__
#include "../../../../../lvgl.h" /* back to the root folder's lvgl.h */
#endif /* __RTTHREAD__ */

@ -1,5 +1,5 @@
#include "../lv_examples.h" #include "../lv_examples.h"
#if LV_BUILD_EXAMPLES && LV_USE_SLIDER && LV_USE_CHART && LV_USE_BTN #if LV_BUILD_EXAMPLES && LV_USE_SLIDER && LV_USE_CHART && LV_USE_BTN && LV_USE_GRID
/** /**
* the example show the use of cubic-bezier3 in animation. * the example show the use of cubic-bezier3 in animation.

@ -1,19 +1,20 @@
/*Using LVGL with Arduino requires some extra steps:
*Be sure to read the docs here: https://docs.lvgl.io/master/get-started/platforms/arduino.html */
#include <lvgl.h> #include <lvgl.h>
#include <TFT_eSPI.h> #include <TFT_eSPI.h>
/*If you want to use the LVGL examples,
make sure to install the lv_examples Arduino library
and uncomment the following line.
#include <lv_examples.h>
*/
#include <lv_demo.h> /*To use the built-in examples and demos of LVGL uncomment the includes below respectively.
*You also need to copy `lvgl/examples` to `lvgl/src/examples`. Similarly for the demos `lvgl/demos` to `lvgl/src/demos`.
Note that the `lv_examples` library is for LVGL v7 and you shouldn't install it for this version (since LVGL v8)
as the examples and demos are now part of the main LVGL library. */
/*Change to your screen resolution*/ /*Change to your screen resolution*/
static const uint16_t screenWidth = 480; static const uint16_t screenWidth = 480;
static const uint16_t screenHeight = 320; static const uint16_t screenHeight = 320;
static lv_disp_draw_buf_t draw_buf; static lv_disp_draw_buf_t draw_buf;
static lv_color_t buf[ screenWidth * 10 ]; static lv_color_t buf[ screenWidth * screenHeight / 10 ];
TFT_eSPI tft = TFT_eSPI(screenWidth, screenHeight); /* TFT instance */ TFT_eSPI tft = TFT_eSPI(screenWidth, screenHeight); /* TFT instance */
@ -27,7 +28,7 @@ void my_print(const char * buf)
#endif #endif
/* Display flushing */ /* Display flushing */
void my_disp_flush( lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p ) void my_disp_flush( lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p )
{ {
uint32_t w = ( area->x2 - area->x1 + 1 ); uint32_t w = ( area->x2 - area->x1 + 1 );
uint32_t h = ( area->y2 - area->y1 + 1 ); uint32_t h = ( area->y2 - area->y1 + 1 );
@ -37,11 +38,11 @@ void my_disp_flush( lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *colo
tft.pushColors( ( uint16_t * )&color_p->full, w * h, true ); tft.pushColors( ( uint16_t * )&color_p->full, w * h, true );
tft.endWrite(); tft.endWrite();
lv_disp_flush_ready( disp ); lv_disp_flush_ready( disp_drv );
} }
/*Read the touchpad*/ /*Read the touchpad*/
void my_touchpad_read( lv_indev_drv_t * indev_driver, lv_indev_data_t * data ) void my_touchpad_read( lv_indev_drv_t * indev_drv, lv_indev_data_t * data )
{ {
uint16_t touchX, touchY; uint16_t touchX, touchY;
@ -92,7 +93,7 @@ void setup()
uint16_t calData[5] = { 275, 3620, 264, 3532, 1 }; uint16_t calData[5] = { 275, 3620, 264, 3532, 1 };
tft.setTouch( calData ); tft.setTouch( calData );
lv_disp_draw_buf_init( &draw_buf, buf, NULL, screenWidth * 10 ); lv_disp_draw_buf_init( &draw_buf, buf, NULL, screenWidth * screenHeight / 10 );
/*Initialize the display*/ /*Initialize the display*/
static lv_disp_drv_t disp_drv; static lv_disp_drv_t disp_drv;
@ -111,25 +112,24 @@ void setup()
indev_drv.read_cb = my_touchpad_read; indev_drv.read_cb = my_touchpad_read;
lv_indev_drv_register( &indev_drv ); lv_indev_drv_register( &indev_drv );
#if 0
/* Create simple label */ /* Create simple label */
lv_obj_t *label = lv_label_create( lv_scr_act() ); lv_obj_t *label = lv_label_create( lv_scr_act() );
lv_label_set_text( label, LVGL_Arduino.c_str() ); lv_label_set_text( label, "Hello Ardino and LVGL!");
lv_obj_align( label, LV_ALIGN_CENTER, 0, 0 ); lv_obj_align( label, LV_ALIGN_CENTER, 0, 0 );
#else
/* Try an example from the lv_examples Arduino library /* Try an example. See all the examples
make sure to include it as written above. * online: https://docs.lvgl.io/master/examples.html
lv_example_btn_1(); * source codes: https://github.com/lvgl/lvgl/tree/e7f88efa5853128bf871dde335c0ca8da9eb7731/examples */
*/ //lv_example_btn_1();
// uncomment one of these demos /*Or try out a demo. Don't forget to enable the demos in lv_conf.h. E.g. LV_USE_DEMOS_WIDGETS*/
lv_demo_widgets(); // OK //lv_demo_widgets();
// lv_demo_benchmark(); // OK // lv_demo_benchmark();
// lv_demo_keypad_encoder(); // works, but I haven't an encoder // lv_demo_keypad_encoder();
// lv_demo_music(); // NOK // lv_demo_music();
// lv_demo_printer(); // lv_demo_printer();
// lv_demo_stress(); // seems to be OK // lv_demo_stress();
#endif
Serial.println( "Setup done" ); Serial.println( "Setup done" );
} }

@ -28,7 +28,7 @@ void lv_example_flex_1(void)
lv_obj_set_size(obj, 100, LV_PCT(100)); lv_obj_set_size(obj, 100, LV_PCT(100));
label = lv_label_create(obj); label = lv_label_create(obj);
lv_label_set_text_fmt(label, "Item: %u", i); lv_label_set_text_fmt(label, "Item: %"LV_PRIu32, i);
lv_obj_center(label); lv_obj_center(label);
/*Add items to the column*/ /*Add items to the column*/

@ -1 +1 @@
CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples -name \*.c) CSRCS += $(shell find -L $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples -name "*.c")

@ -14,7 +14,7 @@ void lv_example_animimg_1(void)
{ {
lv_obj_t * animimg0 = lv_animimg_create(lv_scr_act()); lv_obj_t * animimg0 = lv_animimg_create(lv_scr_act());
lv_obj_center(animimg0); lv_obj_center(animimg0);
lv_animimg_set_src(animimg0, (lv_img_dsc_t **) anim_imgs, 3); lv_animimg_set_src(animimg0, (const void **) anim_imgs, 3);
lv_animimg_set_duration(animimg0, 1000); lv_animimg_set_duration(animimg0, 1000);
lv_animimg_set_repeat_count(animimg0, LV_ANIM_REPEAT_INFINITE); lv_animimg_set_repeat_count(animimg0, LV_ANIM_REPEAT_INFINITE);
lv_animimg_start(animimg0); lv_animimg_start(animimg0);

@ -18,11 +18,11 @@ static void float_btn_event_cb(lv_event_t * e)
cont = lv_menu_cont_create(sub_page); cont = lv_menu_cont_create(sub_page);
label = lv_label_create(cont); label = lv_label_create(cont);
lv_label_set_text_fmt(label, "Hello, I am hiding inside %i", btn_cnt); lv_label_set_text_fmt(label, "Hello, I am hiding inside %"LV_PRIu32, btn_cnt);
cont = lv_menu_cont_create(main_page); cont = lv_menu_cont_create(main_page);
label = lv_label_create(cont); label = lv_label_create(cont);
lv_label_set_text_fmt(label, "Item %i", btn_cnt); lv_label_set_text_fmt(label, "Item %"LV_PRIu32, btn_cnt);
lv_menu_set_load_page_event(menu, cont, sub_page); lv_menu_set_load_page_event(menu, cont, sub_page);
lv_obj_scroll_to_view_recursive(cont, LV_ANIM_ON); lv_obj_scroll_to_view_recursive(cont, LV_ANIM_ON);

@ -1,21 +1,11 @@
#include "../../lv_examples.h" #include "../../lv_examples.h"
#if LV_USE_TABVIEW && LV_BUILD_EXAMPLES #if LV_USE_TABVIEW && LV_BUILD_EXAMPLES
static void scroll_begin_event(lv_event_t * e)
{
/*Disable the scroll animations. Triggered when a tab button is clicked */
if(lv_event_get_code(e) == LV_EVENT_SCROLL_BEGIN) {
lv_anim_t * a = lv_event_get_param(e);
if(a) a->time = 0;
}
}
void lv_example_tabview_2(void) void lv_example_tabview_2(void)
{ {
/*Create a Tab view object*/ /*Create a Tab view object*/
lv_obj_t * tabview; lv_obj_t * tabview;
tabview = lv_tabview_create(lv_scr_act(), LV_DIR_LEFT, 80); tabview = lv_tabview_create(lv_scr_act(), LV_DIR_LEFT, 80);
lv_obj_add_event_cb(lv_tabview_get_content(tabview), scroll_begin_event, LV_EVENT_SCROLL_BEGIN, NULL);
lv_obj_set_style_bg_color(tabview, lv_palette_lighten(LV_PALETTE_RED, 2), 0); lv_obj_set_style_bg_color(tabview, lv_palette_lighten(LV_PALETTE_RED, 2), 0);

@ -1,15 +1,6 @@
def scroll_begin_event(e):
#Disable the scroll animations. Triggered when a tab button is clicked */
if e.get_code() == lv.EVENT.SCROLL_BEGIN:
a = lv.anim_t.__cast__(e.get_param())
if a:
a.time = 0
# Create a Tab view object # Create a Tab view object
tabview = lv.tabview(lv.scr_act(), lv.DIR.LEFT, 80) tabview = lv.tabview(lv.scr_act(), lv.DIR.LEFT, 80)
tabview.get_content().add_event_cb(scroll_begin_event, lv.EVENT.SCROLL_BEGIN, None)
tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0) tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0)
tab_btns = tabview.get_tab_btns() tab_btns = tabview.get_tab_btns()

@ -1,2 +1,5 @@
description: LVGL - Light and Versatile Graphics Library description: LVGL - Light and Versatile Graphics Library
url: https://github.com/lvgl/lvgl url: https://lvgl.io/
repository: https://github.com/lvgl/lvgl.git
documentation: https://docs.lvgl.io/
issues: https://github.com/lvgl/lvgl/issues

@ -1,6 +1,6 @@
{ {
"name": "lvgl", "name": "lvgl",
"version": "8.3.1", "version": "8.3.11",
"keywords": "graphics, gui, embedded, tft, lvgl", "keywords": "graphics, gui, embedded, tft, lvgl",
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
"repository": { "repository": {

@ -1,5 +1,5 @@
name=lvgl name=lvgl
version=8.3.1 version=8.3.11
author=kisvegabor author=kisvegabor
maintainer=kisvegabor,embeddedt,pete-pjb maintainer=kisvegabor,embeddedt,pete-pjb
sentence=Full-featured Graphics Library for Embedded Systems sentence=Full-featured Graphics Library for Embedded Systems

@ -1,6 +1,6 @@
/** /**
* @file lv_conf.h * @file lv_conf.h
* Configuration file for v8.3.1 * Configuration file for v8.3.11
*/ */
/* /*
@ -89,6 +89,9 @@
#if LV_TICK_CUSTOM #if LV_TICK_CUSTOM
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
/*If using lvgl as ESP32 component*/
// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"
// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
#endif /*LV_TICK_CUSTOM*/ #endif /*LV_TICK_CUSTOM*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
@ -180,10 +183,18 @@
#define LV_USE_GPU_STM32_DMA2D 0 #define LV_USE_GPU_STM32_DMA2D 0
#if LV_USE_GPU_STM32_DMA2D #if LV_USE_GPU_STM32_DMA2D
/*Must be defined to include path of CMSIS header of target processor /*Must be defined to include path of CMSIS header of target processor
e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ e.g. "stm32f7xx.h" or "stm32f4xx.h"*/
#define LV_GPU_DMA2D_CMSIS_INCLUDE #define LV_GPU_DMA2D_CMSIS_INCLUDE
#endif #endif
/*Enable RA6M3 G2D GPU*/
#define LV_USE_GPU_RA6M3_G2D 0
#if LV_USE_GPU_RA6M3_G2D
/*include path of target processor
e.g. "hal_data.h"*/
#define LV_GPU_RA6M3_G2D_INCLUDE "hal_data.h"
#endif
/*Use SWM341's DMA2D GPU*/ /*Use SWM341's DMA2D GPU*/
#define LV_USE_GPU_SWM341_DMA2D 0 #define LV_USE_GPU_SWM341_DMA2D 0
#if LV_USE_GPU_SWM341_DMA2D #if LV_USE_GPU_SWM341_DMA2D
@ -628,6 +639,13 @@
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif #endif
/*API for LittleFS (library needs to be added separately). Uses lfs_file_open, lfs_file_read, etc*/
#define LV_USE_FS_LITTLEFS 0
#if LV_USE_FS_LITTLEFS
#define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_LITTLEFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*PNG decoder library*/ /*PNG decoder library*/
#define LV_USE_PNG 0 #define LV_USE_PNG 0
@ -661,6 +679,13 @@
#endif #endif
#endif #endif
/*Tiny TTF library*/
#define LV_USE_TINY_TTF 0
#if LV_USE_TINY_TTF
/*Load TTF data from files*/
#define LV_TINY_TTF_FILE_SUPPORT 0
#endif
/*Rlottie library*/ /*Rlottie library*/
#define LV_USE_RLOTTIE 0 #define LV_USE_RLOTTIE 0

@ -15,7 +15,7 @@ extern "C" {
***************************/ ***************************/
#define LVGL_VERSION_MAJOR 8 #define LVGL_VERSION_MAJOR 8
#define LVGL_VERSION_MINOR 3 #define LVGL_VERSION_MINOR 3
#define LVGL_VERSION_PATCH 1 #define LVGL_VERSION_PATCH 11
#define LVGL_VERSION_INFO "" #define LVGL_VERSION_INFO ""
/********************* /*********************

@ -6,6 +6,7 @@ rm -rf emscripten_builder
git clone https://github.com/lvgl/lv_sim_emscripten.git emscripten_builder git clone https://github.com/lvgl/lv_sim_emscripten.git emscripten_builder
scripts/genexamplelist.sh > emscripten_builder/examplelist.c scripts/genexamplelist.sh > emscripten_builder/examplelist.c
cd emscripten_builder cd emscripten_builder
git checkout 45e0bc5c8d3e55cfbcaf8214361d2335b8b9a7b4
git submodule update --init -- lvgl git submodule update --init -- lvgl
cd lvgl cd lvgl
git checkout $CURRENT_REF git checkout $CURRENT_REF

@ -163,7 +163,7 @@ props = [
{'name': 'BORDER_WIDTH', {'name': 'BORDER_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0, 'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set hte width of the border. Only pixel values can be used."}, 'dsc': "Set the width of the border. Only pixel values can be used."},
{'name': 'BORDER_SIDE', {'name': 'BORDER_SIDE',
'style_type': 'num', 'var_type': 'lv_border_side_t', 'default':'`LV_BORDER_SIDE_NONE`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'style_type': 'num', 'var_type': 'lv_border_side_t', 'default':'`LV_BORDER_SIDE_NONE`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
@ -316,6 +316,10 @@ props = [
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 1, 'layout': 0, 'ext_draw': 0, 'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 1, 'layout': 0, 'ext_draw': 0,
'dsc': "Scale down all opacity values of the object by this factor. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency." }, 'dsc': "Scale down all opacity values of the object by this factor. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency." },
{'name': 'OPA_LAYERED',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 1, 'layout': 0, 'ext_draw': 0,
'dsc': "First draw the object on the layer, then scale down layer opacity factor. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency." },
{'name': 'COLOR_FILTER_DSC', {'name': 'COLOR_FILTER_DSC',
'style_type': 'ptr', 'var_type': 'const lv_color_filter_dsc_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'style_type': 'ptr', 'var_type': 'const lv_color_filter_dsc_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Mix a color to all colors of the object." }, 'dsc': "Mix a color to all colors of the object." },
@ -346,7 +350,7 @@ props = [
{'name': 'LAYOUT', {'name': 'LAYOUT',
'style_type': 'num', 'var_type': 'uint16_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0, 'style_type': 'num', 'var_type': 'uint16_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the layout if the object. The children will be repositioned and resized according to the policies set for the layout. For the possible values see the documentation of the layouts."}, 'dsc': "Set the layout of the object. The children will be repositioned and resized according to the policies set for the layout. For the possible values see the documentation of the layouts."},
{'name': 'BASE_DIR', {'name': 'BASE_DIR',
'style_type': 'num', 'var_type': 'lv_base_dir_t', 'default':'`LV_BASE_DIR_AUTO`', 'inherited': 1, 'layout': 1, 'ext_draw': 0, 'style_type': 'num', 'var_type': 'lv_base_dir_t', 'default':'`LV_BASE_DIR_AUTO`', 'inherited': 1, 'layout': 1, 'ext_draw': 0,

@ -224,9 +224,13 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
lv_disp_t * d = lv_obj_get_disp(new_scr); lv_disp_t * d = lv_obj_get_disp(new_scr);
lv_obj_t * act_scr = lv_scr_act(); lv_obj_t * act_scr = lv_scr_act();
if(act_scr == new_scr || d->scr_to_load == new_scr) {
return;
}
/*If an other screen load animation is in progress /*If an other screen load animation is in progress
*make target screen loaded immediately. */ *make target screen loaded immediately. */
if(d->scr_to_load && act_scr != d->scr_to_load) { if(d->scr_to_load) {
scr_load_internal(d->scr_to_load); scr_load_internal(d->scr_to_load);
lv_anim_del(d->scr_to_load, NULL); lv_anim_del(d->scr_to_load, NULL);
lv_obj_set_pos(d->scr_to_load, 0, 0); lv_obj_set_pos(d->scr_to_load, 0, 0);
@ -258,10 +262,10 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0); lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0);
lv_obj_remove_local_style_prop(lv_scr_act(), LV_STYLE_OPA, 0); lv_obj_remove_local_style_prop(lv_scr_act(), LV_STYLE_OPA, 0);
/*Shortcut for immediate load*/ /*Shortcut for immediate load*/
if(time == 0 && delay == 0) { if(time == 0 && delay == 0) {
scr_load_internal(new_scr); scr_load_internal(new_scr);
if(auto_del) lv_obj_del(act_scr);
return; return;
} }
@ -477,6 +481,7 @@ static void scr_load_internal(lv_obj_t * scr)
if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOAD_START, NULL); if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOAD_START, NULL);
d->act_scr = scr; d->act_scr = scr;
d->scr_to_load = NULL;
if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOADED, NULL); if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOADED, NULL);
if(d->act_scr) lv_event_send(old_scr, LV_EVENT_SCREEN_UNLOADED, NULL); if(d->act_scr) lv_event_send(old_scr, LV_EVENT_SCREEN_UNLOADED, NULL);

@ -92,6 +92,7 @@ void lv_group_del(lv_group_t * group)
indev = lv_indev_get_next(indev); indev = lv_indev_get_next(indev);
} }
if(default_group == group) default_group = NULL;
_lv_ll_clear(&(group->obj_ll)); _lv_ll_clear(&(group->obj_ll));
_lv_ll_remove(&LV_GC_ROOT(_lv_group_ll), group); _lv_ll_remove(&LV_GC_ROOT(_lv_group_ll), group);
lv_mem_free(group); lv_mem_free(group);
@ -113,6 +114,9 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
LV_LOG_TRACE("begin"); LV_LOG_TRACE("begin");
/*Be sure the object is removed from its current group*/
lv_group_remove_obj(obj);
/*Do not add the object twice*/ /*Do not add the object twice*/
lv_obj_t ** obj_i; lv_obj_t ** obj_i;
_LV_LL_READ(&group->obj_ll, obj_i) { _LV_LL_READ(&group->obj_ll, obj_i) {

@ -356,16 +356,16 @@ static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data)
/*Simple sanity check*/ /*Simple sanity check*/
if(data->point.x < 0) { if(data->point.x < 0) {
LV_LOG_WARN("X is %d which is smaller than zero", data->point.x); LV_LOG_WARN("X is %d which is smaller than zero", (int)data->point.x);
} }
if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) { if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) {
LV_LOG_WARN("X is %d which is greater than hor. res", data->point.x); LV_LOG_WARN("X is %d which is greater than hor. res", (int)data->point.x);
} }
if(data->point.y < 0) { if(data->point.y < 0) {
LV_LOG_WARN("Y is %d which is smaller than zero", data->point.y); LV_LOG_WARN("Y is %d which is smaller than zero", (int)data->point.y);
} }
if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) { if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) {
LV_LOG_WARN("Y is %d which is greater than ver. res", data->point.y); LV_LOG_WARN("Y is %d which is greater than ver. res", (int)data->point.y);
} }
/*Move the cursor if set and moved*/ /*Move the cursor if set and moved*/
@ -852,8 +852,6 @@ static void indev_proc_press(_lv_indev_proc_t * proc)
if(indev_reset_check(proc)) return; if(indev_reset_check(proc)) return;
} }
lv_obj_transform_point(indev_obj_act, &proc->types.pointer.act_point, true, true);
/*If a new object was found reset some variables and send a pressed event handler*/ /*If a new object was found reset some variables and send a pressed event handler*/
if(indev_obj_act != proc->types.pointer.act_obj) { if(indev_obj_act != proc->types.pointer.act_obj) {
proc->types.pointer.last_point.x = proc->types.pointer.act_point.x; proc->types.pointer.last_point.x = proc->types.pointer.act_point.x;
@ -987,6 +985,27 @@ static void indev_proc_release(_lv_indev_proc_t * proc)
proc->pr_timestamp = 0; proc->pr_timestamp = 0;
proc->longpr_rep_timestamp = 0; proc->longpr_rep_timestamp = 0;
/*Get the transformed vector with this object*/
if(scroll_obj) {
int16_t angle = 0;
int16_t zoom = 256;
lv_point_t pivot = { 0, 0 };
lv_obj_t * parent = scroll_obj;
while(parent) {
angle += lv_obj_get_style_transform_angle(parent, 0);
zoom *= (lv_obj_get_style_transform_zoom(parent, 0) / 256);
parent = lv_obj_get_parent(parent);
}
if(angle != 0 || zoom != LV_IMG_ZOOM_NONE) {
angle = -angle;
zoom = (256 * 256) / zoom;
lv_point_transform(&proc->types.pointer.scroll_throw_vect, angle, zoom, &pivot);
lv_point_transform(&proc->types.pointer.scroll_throw_vect_ori, angle, zoom, &pivot);
}
}
} }
/*The reset can be set in the Call the ancestor's event handler function. /*The reset can be set in the Call the ancestor's event handler function.

@ -45,12 +45,13 @@ static lv_coord_t elastic_diff(lv_obj_t * scroll_obj, lv_coord_t diff, lv_coord_
void _lv_indev_scroll_handler(_lv_indev_proc_t * proc) void _lv_indev_scroll_handler(_lv_indev_proc_t * proc)
{ {
if(proc->types.pointer.vect.x == 0 && proc->types.pointer.vect.y == 0) {
return;
}
lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj; lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj;
/*If there is no scroll object yet try to find one*/ /*If there is no scroll object yet try to find one*/
if(scroll_obj == NULL) { if(scroll_obj == NULL) {
proc->types.pointer.scroll_sum.x += proc->types.pointer.vect.x;
proc->types.pointer.scroll_sum.y += proc->types.pointer.vect.y;
scroll_obj = find_scroll_obj(proc); scroll_obj = find_scroll_obj(proc);
if(scroll_obj == NULL) return; if(scroll_obj == NULL) return;
@ -61,10 +62,26 @@ void _lv_indev_scroll_handler(_lv_indev_proc_t * proc)
} }
/*Set new position or scroll if the vector is not zero*/ /*Set new position or scroll if the vector is not zero*/
if(proc->types.pointer.vect.x != 0 || proc->types.pointer.vect.y != 0) { int16_t angle = 0;
int16_t zoom = 256;
lv_obj_t * parent = scroll_obj;
while(parent) {
angle += lv_obj_get_style_transform_angle(parent, 0);
zoom *= (lv_obj_get_style_transform_zoom(parent, 0) / 256);
parent = lv_obj_get_parent(parent);
}
if(angle != 0 || zoom != LV_IMG_ZOOM_NONE) {
angle = -angle;
zoom = (256 * 256) / zoom;
lv_point_t pivot = { 0, 0 };
lv_point_transform(&proc->types.pointer.vect, angle, zoom, &pivot);
}
lv_coord_t diff_x = 0; lv_coord_t diff_x = 0;
lv_coord_t diff_y = 0; lv_coord_t diff_y = 0;
if(proc->types.pointer.scroll_dir == LV_DIR_HOR) { if(proc->types.pointer.scroll_dir == LV_DIR_HOR) {
lv_coord_t sr = lv_obj_get_scroll_right(scroll_obj); lv_coord_t sr = lv_obj_get_scroll_right(scroll_obj);
lv_coord_t sl = lv_obj_get_scroll_left(scroll_obj); lv_coord_t sl = lv_obj_get_scroll_left(scroll_obj);
@ -90,7 +107,6 @@ void _lv_indev_scroll_handler(_lv_indev_proc_t * proc)
proc->types.pointer.scroll_sum.x += diff_x; proc->types.pointer.scroll_sum.x += diff_x;
proc->types.pointer.scroll_sum.y += diff_y; proc->types.pointer.scroll_sum.y += diff_y;
} }
}
void _lv_indev_scroll_throw_handler(_lv_indev_proc_t * proc) void _lv_indev_scroll_throw_handler(_lv_indev_proc_t * proc)
@ -99,7 +115,6 @@ void _lv_indev_scroll_throw_handler(_lv_indev_proc_t * proc)
if(scroll_obj == NULL) return; if(scroll_obj == NULL) return;
if(proc->types.pointer.scroll_dir == LV_DIR_NONE) return; if(proc->types.pointer.scroll_dir == LV_DIR_NONE) return;
lv_indev_t * indev_act = lv_indev_get_act(); lv_indev_t * indev_act = lv_indev_get_act();
lv_coord_t scroll_throw = indev_act->driver->scroll_throw; lv_coord_t scroll_throw = indev_act->driver->scroll_throw;
@ -259,14 +274,37 @@ static lv_obj_t * find_scroll_obj(_lv_indev_proc_t * proc)
/*Decide if it's a horizontal or vertical scroll*/ /*Decide if it's a horizontal or vertical scroll*/
bool hor_en = false; bool hor_en = false;
bool ver_en = false; bool ver_en = false;
if(LV_ABS(proc->types.pointer.scroll_sum.x) > LV_ABS(proc->types.pointer.scroll_sum.y)) {
proc->types.pointer.scroll_sum.x += proc->types.pointer.vect.x;
proc->types.pointer.scroll_sum.y += proc->types.pointer.vect.y;
while(obj_act) {
/*Get the transformed scroll_sum with this object*/
int16_t angle = 0;
int32_t zoom = 256;
lv_point_t pivot = { 0, 0 };
lv_obj_t * parent = obj_act;
while(parent) {
angle += lv_obj_get_style_transform_angle(parent, 0);
int32_t zoom_act = lv_obj_get_style_transform_zoom(parent, 0);
zoom = (zoom * zoom_act) >> 8;
parent = lv_obj_get_parent(parent);
}
lv_point_t obj_scroll_sum = proc->types.pointer.scroll_sum;
if(angle != 0 || zoom != LV_IMG_ZOOM_NONE) {
angle = -angle;
zoom = (256 * 256) / zoom;
lv_point_transform(&obj_scroll_sum, angle, zoom, &pivot);
}
if(LV_ABS(obj_scroll_sum.x) > LV_ABS(obj_scroll_sum.y)) {
hor_en = true; hor_en = true;
} }
else { else {
ver_en = true; ver_en = true;
} }
while(obj_act) {
if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLLABLE) == false) { if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLLABLE) == false) {
/*If this object don't want to chain the scroll to the parent stop searching*/ /*If this object don't want to chain the scroll to the parent stop searching*/
if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break; if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break;
@ -300,15 +338,15 @@ static lv_obj_t * find_scroll_obj(_lv_indev_proc_t * proc)
*is propagated to this object it can show at least elastic scroll effect. *is propagated to this object it can show at least elastic scroll effect.
*But if not hor/ver scrollable do not scroll it at all (so it's not a good candidate)*/ *But if not hor/ver scrollable do not scroll it at all (so it's not a good candidate)*/
if((st > 0 || sb > 0) && if((st > 0 || sb > 0) &&
((up_en && proc->types.pointer.scroll_sum.y >= scroll_limit) || ((up_en && obj_scroll_sum.y >= scroll_limit) ||
(down_en && proc->types.pointer.scroll_sum.y <= - scroll_limit))) { (down_en && obj_scroll_sum.y <= - scroll_limit))) {
obj_candidate = obj_act; obj_candidate = obj_act;
dir_candidate = LV_DIR_VER; dir_candidate = LV_DIR_VER;
} }
if((sl > 0 || sr > 0) && if((sl > 0 || sr > 0) &&
((left_en && proc->types.pointer.scroll_sum.x >= scroll_limit) || ((left_en && obj_scroll_sum.x >= scroll_limit) ||
(right_en && proc->types.pointer.scroll_sum.x <= - scroll_limit))) { (right_en && obj_scroll_sum.x <= - scroll_limit))) {
obj_candidate = obj_act; obj_candidate = obj_act;
dir_candidate = LV_DIR_HOR; dir_candidate = LV_DIR_HOR;
} }
@ -318,11 +356,11 @@ static lv_obj_t * find_scroll_obj(_lv_indev_proc_t * proc)
if(sl <= 0) left_en = false; if(sl <= 0) left_en = false;
if(sr <= 0) right_en = false; if(sr <= 0) right_en = false;
/*If the object really can be scrolled into the current direction the use it.*/ /*If the object really can be scrolled into the current direction then use it.*/
if((left_en && proc->types.pointer.scroll_sum.x >= scroll_limit) || if((left_en && obj_scroll_sum.x >= scroll_limit) ||
(right_en && proc->types.pointer.scroll_sum.x <= - scroll_limit) || (right_en && obj_scroll_sum.x <= - scroll_limit) ||
(up_en && proc->types.pointer.scroll_sum.y >= scroll_limit) || (up_en && obj_scroll_sum.y >= scroll_limit) ||
(down_en && proc->types.pointer.scroll_sum.y <= - scroll_limit)) { (down_en && obj_scroll_sum.y <= - scroll_limit)) {
proc->types.pointer.scroll_dir = hor_en ? LV_DIR_HOR : LV_DIR_VER; proc->types.pointer.scroll_dir = hor_en ? LV_DIR_HOR : LV_DIR_VER;
break; break;
} }

@ -30,6 +30,10 @@
#include "../draw/stm32_dma2d/lv_gpu_stm32_dma2d.h" #include "../draw/stm32_dma2d/lv_gpu_stm32_dma2d.h"
#endif #endif
#if LV_USE_GPU_RA6M3_G2D
#include "../draw/renesas/lv_gpu_d2_ra6m3.h"
#endif
#if LV_USE_GPU_SWM341_DMA2D #if LV_USE_GPU_SWM341_DMA2D
#include "../draw/swm341_dma2d/lv_gpu_swm341_dma2d.h" #include "../draw/swm341_dma2d/lv_gpu_swm341_dma2d.h"
#endif #endif
@ -119,6 +123,11 @@ void lv_init(void)
lv_draw_stm32_dma2d_init(); lv_draw_stm32_dma2d_init();
#endif #endif
#if LV_USE_GPU_RA6M3_G2D
/*Initialize G2D GPU*/
lv_draw_ra6m3_g2d_init();
#endif
#if LV_USE_GPU_SWM341_DMA2D #if LV_USE_GPU_SWM341_DMA2D
/*Initialize DMA2D GPU*/ /*Initialize DMA2D GPU*/
lv_draw_swm341_dma2d_init(); lv_draw_swm341_dma2d_init();
@ -140,9 +149,9 @@ void lv_init(void)
lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE); lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE);
#endif #endif
/*Test if the IDE has UTF-8 encoding*/ /*Test if the IDE has UTF-8 encoding*/
char * txt = "Á"; const char * txt = "Á";
uint8_t * txt_u8 = (uint8_t *)txt; const uint8_t * txt_u8 = (uint8_t *)txt;
if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) { if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) {
LV_LOG_WARN("The strings have no UTF-8 encoding. Non-ASCII characters won't be displayed."); LV_LOG_WARN("The strings have no UTF-8 encoding. Non-ASCII characters won't be displayed.");
} }
@ -223,12 +232,22 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
bool was_on_layout = lv_obj_is_layout_positioned(obj); bool was_on_layout = lv_obj_is_layout_positioned(obj);
/* We must invalidate the area occupied by the object before we hide it as calls to invalidate hidden objects are ignored */
if(f & LV_OBJ_FLAG_HIDDEN) lv_obj_invalidate(obj); if(f & LV_OBJ_FLAG_HIDDEN) lv_obj_invalidate(obj);
obj->flags |= f; obj->flags |= f;
if(f & LV_OBJ_FLAG_HIDDEN) { if(f & LV_OBJ_FLAG_HIDDEN) {
lv_obj_invalidate(obj); if(lv_obj_has_state(obj, LV_STATE_FOCUSED)) {
lv_group_t * group = lv_obj_get_group(obj);
if(group != NULL) {
lv_group_focus_next(group);
lv_obj_t * next_obj = lv_group_get_focused(group);
if(next_obj != NULL) {
lv_obj_invalidate(next_obj);
}
}
}
} }
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) { if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
@ -494,6 +513,11 @@ static void lv_obj_draw(lv_event_t * e)
return; return;
} }
if(lv_obj_get_style_opa(obj, LV_PART_MAIN) < LV_OPA_MAX) {
info->res = LV_COVER_RES_NOT_COVER;
return;
}
info->res = LV_COVER_RES_COVER; info->res = LV_COVER_RES_COVER;
} }
@ -678,7 +702,7 @@ static lv_res_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc
} }
} }
lv_opa_t opa = lv_obj_get_style_opa(obj, LV_PART_SCROLLBAR); lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, LV_PART_SCROLLBAR);
if(opa < LV_OPA_MAX) { if(opa < LV_OPA_MAX) {
dsc->bg_opa = (dsc->bg_opa * opa) >> 8; dsc->bg_opa = (dsc->bg_opa * opa) >> 8;
dsc->border_opa = (dsc->bg_opa * opa) >> 8; dsc->border_opa = (dsc->bg_opa * opa) >> 8;
@ -709,9 +733,9 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
} }
else if(code == LV_EVENT_RELEASED) { else if(code == LV_EVENT_RELEASED) {
lv_obj_clear_state(obj, LV_STATE_PRESSED); lv_obj_clear_state(obj, LV_STATE_PRESSED);
void * param = lv_event_get_param(e); lv_indev_t * indev = lv_event_get_indev(e);
/*Go the checked state if enabled*/ /*Go the checked state if enabled*/
if(lv_indev_get_scroll_obj(param) == NULL && lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) { if(lv_indev_get_scroll_obj(indev) == NULL && lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) {
if(!(lv_obj_get_state(obj) & LV_STATE_CHECKED)) lv_obj_add_state(obj, LV_STATE_CHECKED); if(!(lv_obj_get_state(obj) & LV_STATE_CHECKED)) lv_obj_add_state(obj, LV_STATE_CHECKED);
else lv_obj_clear_state(obj, LV_STATE_CHECKED); else lv_obj_clear_state(obj, LV_STATE_CHECKED);
@ -838,6 +862,10 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_obj_mark_layout_as_dirty(obj); lv_obj_mark_layout_as_dirty(obj);
} }
} }
else if(code == LV_EVENT_CHILD_DELETED) {
obj->readjust_scroll_after_layout = 1;
lv_obj_mark_layout_as_dirty(obj);
}
else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) {
lv_coord_t d = lv_obj_calculate_ext_draw_size(obj, LV_PART_MAIN); lv_coord_t d = lv_obj_calculate_ext_draw_size(obj, LV_PART_MAIN);
lv_event_set_ext_draw_size(e, d); lv_event_set_ext_draw_size(e, d);

@ -183,11 +183,13 @@ typedef struct _lv_obj_t {
lv_obj_flag_t flags; lv_obj_flag_t flags;
lv_state_t state; lv_state_t state;
uint16_t layout_inv : 1; uint16_t layout_inv : 1;
uint16_t readjust_scroll_after_layout : 1;
uint16_t scr_layout_inv : 1; uint16_t scr_layout_inv : 1;
uint16_t skip_trans : 1; uint16_t skip_trans : 1;
uint16_t style_cnt : 6; uint16_t style_cnt : 6;
uint16_t h_layout : 1; uint16_t h_layout : 1;
uint16_t w_layout : 1; uint16_t w_layout : 1;
uint16_t being_deleted : 1;
} lv_obj_t; } lv_obj_t;

@ -38,9 +38,8 @@
void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc) void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t * draw_dsc)
{ {
lv_opa_t opa = LV_OPA_COVER; lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
if(part != LV_PART_MAIN) { if(part != LV_PART_MAIN) {
opa = lv_obj_get_style_opa(obj, part);
if(opa <= LV_OPA_MIN) { if(opa <= LV_OPA_MIN) {
draw_dsc->bg_opa = LV_OPA_TRANSP; draw_dsc->bg_opa = LV_OPA_TRANSP;
draw_dsc->bg_img_opa = LV_OPA_TRANSP; draw_dsc->bg_img_opa = LV_OPA_TRANSP;
@ -180,25 +179,21 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t
} }
} }
#endif #endif
if(part != LV_PART_MAIN) {
if(opa < LV_OPA_MAX) { if(opa < LV_OPA_MAX) {
draw_dsc->bg_opa = (opa * draw_dsc->shadow_opa) >> 8; draw_dsc->bg_opa = (opa * draw_dsc->bg_opa) >> 8;
draw_dsc->bg_img_opa = (opa * draw_dsc->shadow_opa) >> 8; draw_dsc->bg_img_opa = (opa * draw_dsc->bg_img_opa) >> 8;
draw_dsc->border_opa = (opa * draw_dsc->shadow_opa) >> 8; draw_dsc->border_opa = (opa * draw_dsc->border_opa) >> 8;
draw_dsc->outline_opa = (opa * draw_dsc->shadow_opa) >> 8; draw_dsc->outline_opa = (opa * draw_dsc->outline_opa) >> 8;
draw_dsc->shadow_opa = (opa * draw_dsc->shadow_opa) >> 8; draw_dsc->shadow_opa = (opa * draw_dsc->shadow_opa) >> 8;
} }
} }
}
void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc) void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc_t * draw_dsc)
{ {
draw_dsc->opa = lv_obj_get_style_text_opa(obj, part); draw_dsc->opa = lv_obj_get_style_text_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return; if(draw_dsc->opa <= LV_OPA_MIN) return;
if(part != LV_PART_MAIN) { lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = lv_obj_get_style_opa(obj, part);
if(opa <= LV_OPA_MIN) { if(opa <= LV_OPA_MIN) {
draw_dsc->opa = LV_OPA_TRANSP; draw_dsc->opa = LV_OPA_TRANSP;
return; return;
@ -206,7 +201,7 @@ void lv_obj_init_draw_label_dsc(lv_obj_t * obj, uint32_t part, lv_draw_label_dsc
if(opa < LV_OPA_MAX) { if(opa < LV_OPA_MAX) {
draw_dsc->opa = (opa * draw_dsc->opa) >> 8; draw_dsc->opa = (opa * draw_dsc->opa) >> 8;
} }
} if(draw_dsc->opa <= LV_OPA_MIN) return;
draw_dsc->color = lv_obj_get_style_text_color_filtered(obj, part); draw_dsc->color = lv_obj_get_style_text_color_filtered(obj, part);
draw_dsc->letter_space = lv_obj_get_style_text_letter_space(obj, part); draw_dsc->letter_space = lv_obj_get_style_text_letter_space(obj, part);
@ -230,8 +225,7 @@ void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t *
draw_dsc->opa = lv_obj_get_style_img_opa(obj, part); draw_dsc->opa = lv_obj_get_style_img_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return; if(draw_dsc->opa <= LV_OPA_MIN) return;
if(part != LV_PART_MAIN) { lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = lv_obj_get_style_opa(obj, part);
if(opa <= LV_OPA_MIN) { if(opa <= LV_OPA_MIN) {
draw_dsc->opa = LV_OPA_TRANSP; draw_dsc->opa = LV_OPA_TRANSP;
return; return;
@ -239,7 +233,7 @@ void lv_obj_init_draw_img_dsc(lv_obj_t * obj, uint32_t part, lv_draw_img_dsc_t *
if(opa < LV_OPA_MAX) { if(opa < LV_OPA_MAX) {
draw_dsc->opa = (opa * draw_dsc->opa) >> 8; draw_dsc->opa = (opa * draw_dsc->opa) >> 8;
} }
} if(draw_dsc->opa <= LV_OPA_MIN) return;
draw_dsc->angle = 0; draw_dsc->angle = 0;
draw_dsc->zoom = LV_IMG_ZOOM_NONE; draw_dsc->zoom = LV_IMG_ZOOM_NONE;
@ -260,8 +254,7 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t
draw_dsc->opa = lv_obj_get_style_line_opa(obj, part); draw_dsc->opa = lv_obj_get_style_line_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return; if(draw_dsc->opa <= LV_OPA_MIN) return;
if(part != LV_PART_MAIN) { lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = lv_obj_get_style_opa(obj, part);
if(opa <= LV_OPA_MIN) { if(opa <= LV_OPA_MIN) {
draw_dsc->opa = LV_OPA_TRANSP; draw_dsc->opa = LV_OPA_TRANSP;
return; return;
@ -269,7 +262,7 @@ void lv_obj_init_draw_line_dsc(lv_obj_t * obj, uint32_t part, lv_draw_line_dsc_t
if(opa < LV_OPA_MAX) { if(opa < LV_OPA_MAX) {
draw_dsc->opa = (opa * draw_dsc->opa) >> 8; draw_dsc->opa = (opa * draw_dsc->opa) >> 8;
} }
} if(draw_dsc->opa <= LV_OPA_MIN) return;
draw_dsc->width = lv_obj_get_style_line_width(obj, part); draw_dsc->width = lv_obj_get_style_line_width(obj, part);
if(draw_dsc->width == 0) return; if(draw_dsc->width == 0) return;
@ -297,8 +290,7 @@ void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t *
draw_dsc->opa = lv_obj_get_style_arc_opa(obj, part); draw_dsc->opa = lv_obj_get_style_arc_opa(obj, part);
if(draw_dsc->opa <= LV_OPA_MIN) return; if(draw_dsc->opa <= LV_OPA_MIN) return;
if(part != LV_PART_MAIN) { lv_opa_t opa = lv_obj_get_style_opa_recursive(obj, part);
lv_opa_t opa = lv_obj_get_style_opa(obj, part);
if(opa <= LV_OPA_MIN) { if(opa <= LV_OPA_MIN) {
draw_dsc->opa = LV_OPA_TRANSP; draw_dsc->opa = LV_OPA_TRANSP;
return; return;
@ -306,7 +298,7 @@ void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t *
if(opa < LV_OPA_MAX) { if(opa < LV_OPA_MAX) {
draw_dsc->opa = (opa * draw_dsc->opa) >> 8; draw_dsc->opa = (opa * draw_dsc->opa) >> 8;
} }
} if(draw_dsc->opa <= LV_OPA_MIN) return;
draw_dsc->color = lv_obj_get_style_arc_color_filtered(obj, part); draw_dsc->color = lv_obj_get_style_arc_color_filtered(obj, part);
draw_dsc->img_src = lv_obj_get_style_arc_img_src(obj, part); draw_dsc->img_src = lv_obj_get_style_arc_img_src(obj, part);

@ -200,7 +200,7 @@ bool lv_obj_refr_size(lv_obj_t * obj)
/*Invalidate the new area*/ /*Invalidate the new area*/
lv_obj_invalidate(obj); lv_obj_invalidate(obj);
lv_obj_readjust_scroll(obj, LV_ANIM_OFF); obj->readjust_scroll_after_layout = 1;
/*If the object was out of the parent invalidate the new scrollbar area too. /*If the object was out of the parent invalidate the new scrollbar area too.
*If it wasn't out of the parent but out now, also invalidate the scrollbars*/ *If it wasn't out of the parent but out now, also invalidate the scrollbars*/
@ -1137,10 +1137,8 @@ static void layout_update_core(lv_obj_t * obj)
layout_update_core(child); layout_update_core(child);
} }
if(obj->layout_inv == 0) return; if(obj->layout_inv) {
obj->layout_inv = 0; obj->layout_inv = 0;
lv_obj_refr_size(obj); lv_obj_refr_size(obj);
lv_obj_refr_pos(obj); lv_obj_refr_pos(obj);
@ -1153,6 +1151,12 @@ static void layout_update_core(lv_obj_t * obj)
} }
} }
if(obj->readjust_scroll_after_layout) {
obj->readjust_scroll_after_layout = 0;
lv_obj_readjust_scroll(obj, LV_ANIM_OFF);
}
}
static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv) static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv)
{ {
int16_t angle = lv_obj_get_style_transform_angle(obj, 0); int16_t angle = lv_obj_get_style_transform_angle(obj, 0);
@ -1160,9 +1164,21 @@ static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv)
if(angle == 0 && zoom == LV_IMG_ZOOM_NONE) return; if(angle == 0 && zoom == LV_IMG_ZOOM_NONE) return;
lv_point_t pivot; lv_point_t pivot = {
pivot.x = obj->coords.x1 + lv_obj_get_style_transform_pivot_x(obj, 0); .x = lv_obj_get_style_transform_pivot_x(obj, 0),
pivot.y = obj->coords.y1 + lv_obj_get_style_transform_pivot_y(obj, 0); .y = lv_obj_get_style_transform_pivot_y(obj, 0)
};
if(LV_COORD_IS_PCT(pivot.x)) {
pivot.x = (LV_COORD_GET_PCT(pivot.x) * lv_area_get_width(&obj->coords)) / 100;
}
if(LV_COORD_IS_PCT(pivot.y)) {
pivot.y = (LV_COORD_GET_PCT(pivot.y) * lv_area_get_height(&obj->coords)) / 100;
}
pivot.x = obj->coords.x1 + pivot.x;
pivot.y = obj->coords.y1 + pivot.y;
if(inv) { if(inv) {
angle = -angle; angle = -angle;
zoom = (256 * 256) / zoom; zoom = (256 * 256) / zoom;

@ -290,7 +290,7 @@ void lv_obj_get_scrollbar_area(struct _lv_obj_t * obj, lv_area_t * hor, lv_area_
void lv_obj_scrollbar_invalidate(struct _lv_obj_t * obj); void lv_obj_scrollbar_invalidate(struct _lv_obj_t * obj);
/** /**
* Checked if the content is scrolled "in" and adjusts it to a normal position. * Checks if the content is scrolled "in" and adjusts it to a normal position.
* @param obj pointer to an object * @param obj pointer to an object
* @param anim_en LV_ANIM_ON/OFF * @param anim_en LV_ANIM_ON/OFF
*/ */

@ -314,7 +314,12 @@ bool lv_obj_remove_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_sty
/*The style is not found*/ /*The style is not found*/
if(i == obj->style_cnt) return false; if(i == obj->style_cnt) return false;
return lv_style_remove_prop(obj->styles[i].style, prop); lv_res_t res = lv_style_remove_prop(obj->styles[i].style, prop);
if(res == LV_RES_OK) {
lv_obj_refresh_style(obj, selector, prop);
}
return res;
} }
void _lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, lv_state_t new_state, void _lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t prev_state, lv_state_t new_state,
@ -491,6 +496,40 @@ lv_text_align_t lv_obj_calculate_style_text_align(const struct _lv_obj_t * obj,
return align; return align;
} }
lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part)
{
lv_opa_t opa_obj = lv_obj_get_style_opa(obj, part);
if(opa_obj <= LV_OPA_MIN) return LV_OPA_TRANSP;
lv_opa_t opa_final = LV_OPA_COVER;
if(opa_obj < LV_OPA_MAX) {
opa_final = ((uint32_t)opa_final * opa_obj) >> 8;
}
if(part != LV_PART_MAIN) {
part = LV_PART_MAIN;
}
else {
obj = lv_obj_get_parent(obj);
}
while(obj) {
opa_obj = lv_obj_get_style_opa(obj, part);
if(opa_obj <= LV_OPA_MIN) return LV_OPA_TRANSP;
if(opa_obj < LV_OPA_MAX) {
opa_final = ((uint32_t)opa_final * opa_obj) >> 8;
}
obj = lv_obj_get_parent(obj);
}
if(opa_final <= LV_OPA_MIN) return LV_OPA_TRANSP;
if(opa_final >= LV_OPA_MAX) return LV_OPA_COVER;
return opa_final;
}
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
@ -744,6 +783,7 @@ static void trans_anim_cb(void * _tr, int32_t v)
else value_final.ptr = tr->end_value.ptr; else value_final.ptr = tr->end_value.ptr;
break; break;
case LV_STYLE_BG_COLOR: case LV_STYLE_BG_COLOR:
case LV_STYLE_BG_GRAD_COLOR:
case LV_STYLE_BORDER_COLOR: case LV_STYLE_BORDER_COLOR:
case LV_STYLE_TEXT_COLOR: case LV_STYLE_TEXT_COLOR:
case LV_STYLE_SHADOW_COLOR: case LV_STYLE_SHADOW_COLOR:
@ -840,8 +880,7 @@ 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_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_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_obj_get_style_opa_layered(obj, 0) != LV_OPA_COVER) return LV_LAYER_TYPE_SIMPLE;
#if LV_DRAW_COMPLEX #if LV_DRAW_COMPLEX
if(lv_obj_get_style_blend_mode(obj, 0) != LV_BLEND_MODE_NORMAL) return LV_LAYER_TYPE_SIMPLE; if(lv_obj_get_style_blend_mode(obj, 0) != LV_BLEND_MODE_NORMAL) return LV_LAYER_TYPE_SIMPLE;
#endif #endif

@ -236,6 +236,21 @@ static inline void lv_obj_set_style_size(struct _lv_obj_t * obj, lv_coord_t valu
lv_text_align_t lv_obj_calculate_style_text_align(const struct _lv_obj_t * obj, lv_part_t part, const char * txt); lv_text_align_t lv_obj_calculate_style_text_align(const struct _lv_obj_t * obj, lv_part_t part, const char * txt);
static inline lv_coord_t lv_obj_get_style_transform_zoom_safe(const struct _lv_obj_t * obj, uint32_t part)
{
int16_t zoom = lv_obj_get_style_transform_zoom(obj, part);
return zoom != 0 ? zoom : 1;
}
/**
* Get the `opa` style property from all parents and multiply and `>> 8` them.
* @param obj the object whose opacity should be get
* @param part the part whose opacity should be get. Non-MAIN parts will consider the `opa` of teh MAIN part too
* @return the final opacity considering the parents' opacity too
*/
lv_opa_t lv_obj_get_style_opa_recursive(const struct _lv_obj_t * obj, lv_part_t part);
/********************** /**********************
* MACROS * MACROS

@ -600,6 +600,14 @@ void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selec
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA, v, selector); lv_obj_set_local_style_prop(obj, LV_STYLE_OPA, v, selector);
} }
void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA_LAYERED, v, selector);
}
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector) void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
{ {
lv_style_value_t v = { lv_style_value_t v = {

@ -508,6 +508,12 @@ static inline lv_opa_t lv_obj_get_style_opa(const struct _lv_obj_t * obj, uint32
return (lv_opa_t)v.num; return (lv_opa_t)v.num;
} }
static inline lv_opa_t lv_obj_get_style_opa_layered(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OPA_LAYERED);
return (lv_opa_t)v.num;
}
static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj, uint32_t part) static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj, uint32_t part)
{ {
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_DSC); lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_DSC);
@ -637,6 +643,7 @@ void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value,
void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector); void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector); void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector); void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector); void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector); void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);

@ -49,9 +49,6 @@ void lv_obj_del(lv_obj_t * obj)
lv_obj_invalidate(obj); lv_obj_invalidate(obj);
lv_obj_t * par = lv_obj_get_parent(obj); lv_obj_t * par = lv_obj_get_parent(obj);
if(par) {
lv_obj_scrollbar_invalidate(par);
}
lv_disp_t * disp = NULL; lv_disp_t * disp = NULL;
bool act_scr_del = false; bool act_scr_del = false;
@ -65,8 +62,6 @@ void lv_obj_del(lv_obj_t * obj)
/*Call the ancestor's event handler to the parent to notify it about the child delete*/ /*Call the ancestor's event handler to the parent to notify it about the child delete*/
if(par) { if(par) {
lv_obj_update_layout(par);
lv_obj_readjust_scroll(par, LV_ANIM_OFF);
lv_obj_scrollbar_invalidate(par); lv_obj_scrollbar_invalidate(par);
lv_event_send(par, LV_EVENT_CHILD_CHANGED, NULL); lv_event_send(par, LV_EVENT_CHILD_CHANGED, NULL);
lv_event_send(par, LV_EVENT_CHILD_DELETED, NULL); lv_event_send(par, LV_EVENT_CHILD_DELETED, NULL);
@ -173,7 +168,6 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent)
obj->parent = parent; obj->parent = parent;
/*Notify the original parent because one of its children is lost*/ /*Notify the original parent because one of its children is lost*/
lv_obj_readjust_scroll(old_parent, LV_ANIM_OFF);
lv_obj_scrollbar_invalidate(old_parent); lv_obj_scrollbar_invalidate(old_parent);
lv_event_send(old_parent, LV_EVENT_CHILD_CHANGED, obj); lv_event_send(old_parent, LV_EVENT_CHILD_CHANGED, obj);
lv_event_send(old_parent, LV_EVENT_CHILD_DELETED, NULL); lv_event_send(old_parent, LV_EVENT_CHILD_DELETED, NULL);
@ -360,6 +354,8 @@ static void obj_del_core(lv_obj_t * obj)
lv_res_t res = lv_event_send(obj, LV_EVENT_DELETE, NULL); lv_res_t res = lv_event_send(obj, LV_EVENT_DELETE, NULL);
if(res == LV_RES_INV) return; if(res == LV_RES_INV) return;
obj->being_deleted = 1;
/*Recursively delete the children*/ /*Recursively delete the children*/
lv_obj_t * child = lv_obj_get_child(obj, 0); lv_obj_t * child = lv_obj_get_child(obj, 0);
while(child) { while(child) {

@ -53,6 +53,7 @@ typedef struct {
**********************/ **********************/
static void lv_refr_join_area(void); static void lv_refr_join_area(void);
static void refr_invalid_areas(void); static void refr_invalid_areas(void);
static void refr_sync_areas(void);
static void refr_area(const lv_area_t * area_p); static void refr_area(const lv_area_t * area_p);
static void refr_area_part(lv_draw_ctx_t * draw_ctx); static void refr_area_part(lv_draw_ctx_t * draw_ctx);
static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj); static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj);
@ -320,17 +321,23 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
} }
lv_refr_join_area(); lv_refr_join_area();
refr_sync_areas();
refr_invalid_areas(); refr_invalid_areas();
/*If refresh happened ...*/ /*If refresh happened ...*/
if(disp_refr->inv_p != 0) { if(disp_refr->inv_p != 0) {
if(disp_refr->driver->full_refresh) {
lv_area_t disp_area; /*Copy invalid areas for sync next refresh in double buffered direct mode*/
lv_area_set(&disp_area, 0, 0, lv_disp_get_hor_res(disp_refr) - 1, lv_disp_get_ver_res(disp_refr) - 1); if(disp_refr->driver->direct_mode && disp_refr->driver->draw_buf->buf2) {
disp_refr->driver->draw_ctx->buf_area = &disp_area;
draw_buf_flush(disp_refr); uint16_t i;
for(i = 0; i < disp_refr->inv_p; i++) {
if(disp_refr->inv_area_joined[i])
continue;
lv_area_t * sync_area = _lv_ll_ins_tail(&disp_refr->sync_areas);
*sync_area = disp_refr->inv_areas[i];
}
} }
/*Clean up*/ /*Clean up*/
@ -502,6 +509,78 @@ static void lv_refr_join_area(void)
} }
} }
/**
* Refresh the sync areas
*/
static void refr_sync_areas(void)
{
/*Do not sync if not direct mode*/
if(!disp_refr->driver->direct_mode) return;
/*Do not sync if not double buffered*/
if(disp_refr->driver->draw_buf->buf2 == NULL) return;
/*Do not sync if no sync areas*/
if(_lv_ll_is_empty(&disp_refr->sync_areas)) return;
/*The buffers are already swapped.
*So the active buffer is the off screen buffer where LVGL will render*/
void * buf_off_screen = disp_refr->driver->draw_buf->buf_act;
void * buf_on_screen = disp_refr->driver->draw_buf->buf_act == disp_refr->driver->draw_buf->buf1
? disp_refr->driver->draw_buf->buf2
: disp_refr->driver->draw_buf->buf1;
/*Get stride for buffer copy*/
lv_coord_t stride = lv_disp_get_hor_res(disp_refr);
/*Iterate through invalidated areas to see if sync area should be copied*/
lv_area_t res[4] = {0};
int8_t res_c, j;
uint32_t i;
lv_area_t * sync_area, *new_area, *next_area;
for(i = 0; i < disp_refr->inv_p; i++) {
/*Skip joined areas*/
if(disp_refr->inv_area_joined[i]) continue;
/*Iterate over sync areas*/
sync_area = _lv_ll_get_head(&disp_refr->sync_areas);
while(sync_area != NULL) {
/*Get next sync area*/
next_area = _lv_ll_get_next(&disp_refr->sync_areas, sync_area);
/*Remove intersect of redraw area from sync area and get remaining areas*/
res_c = _lv_area_diff(res, sync_area, &disp_refr->inv_areas[i]);
/*New sub areas created after removing intersect*/
if(res_c != -1) {
/*Replace old sync area with new areas*/
for(j = 0; j < res_c; j++) {
new_area = _lv_ll_ins_prev(&disp_refr->sync_areas, sync_area);
*new_area = res[j];
}
_lv_ll_remove(&disp_refr->sync_areas, sync_area);
lv_mem_free(sync_area);
}
/*Move on to next sync area*/
sync_area = next_area;
}
}
/*Copy sync areas (if any remaining)*/
for(sync_area = _lv_ll_get_head(&disp_refr->sync_areas); sync_area != NULL;
sync_area = _lv_ll_get_next(&disp_refr->sync_areas, sync_area)) {
disp_refr->driver->draw_ctx->buffer_copy(
disp_refr->driver->draw_ctx,
buf_off_screen, stride, sync_area,
buf_on_screen, stride, sync_area
);
}
/*Clear sync areas*/
_lv_ll_clear(&disp_refr->sync_areas);
}
/** /**
* Refresh the joined areas * Refresh the joined areas
*/ */
@ -620,9 +699,15 @@ static void refr_area_part(lv_draw_ctx_t * draw_ctx)
{ {
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr); lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp_refr);
if(draw_ctx->init_buf)
draw_ctx->init_buf(draw_ctx);
/* Below the `area_p` area will be redrawn into the draw buffer. /* Below the `area_p` area will be redrawn into the draw buffer.
* In single buffered mode wait here until the buffer is freed.*/ * In single buffered mode wait here until the buffer is freed.
if(draw_buf->buf1 && !draw_buf->buf2) { * In full double buffered mode wait here while the buffers are swapped and a buffer becomes available*/
bool full_sized = draw_buf->size == (uint32_t)disp_refr->driver->hor_res * disp_refr->driver->ver_res;
if((draw_buf->buf1 && !draw_buf->buf2) ||
(draw_buf->buf1 && draw_buf->buf2 && full_sized)) {
while(draw_buf->flushing) { while(draw_buf->flushing) {
if(disp_refr->driver->wait_cb) disp_refr->driver->wait_cb(disp_refr->driver); if(disp_refr->driver->wait_cb) disp_refr->driver->wait_cb(disp_refr->driver);
} }
@ -710,12 +795,8 @@ static void refr_area_part(lv_draw_ctx_t * draw_ctx)
refr_obj_and_children(draw_ctx, lv_disp_get_layer_top(disp_refr)); refr_obj_and_children(draw_ctx, lv_disp_get_layer_top(disp_refr));
refr_obj_and_children(draw_ctx, lv_disp_get_layer_sys(disp_refr)); refr_obj_and_children(draw_ctx, lv_disp_get_layer_sys(disp_refr));
/*In true double buffered mode flush only once when all areas were rendered.
*In normal mode flush after every area*/
if(disp_refr->driver->full_refresh == false) {
draw_buf_flush(disp_refr); draw_buf_flush(disp_refr);
} }
}
/** /**
* Search the most top object which fully covers an area * Search the most top object which fully covers an area
@ -893,7 +974,7 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
lv_obj_redraw(draw_ctx, obj); lv_obj_redraw(draw_ctx, obj);
} }
else { else {
lv_opa_t opa = lv_obj_get_style_opa(obj, 0); lv_opa_t opa = lv_obj_get_style_opa_layered(obj, 0);
if(opa < LV_OPA_MIN) return; if(opa < LV_OPA_MIN) return;
lv_area_t layer_area_full; lv_area_t layer_area_full;
@ -922,6 +1003,13 @@ void refr_obj(lv_draw_ctx_t * draw_ctx, lv_obj_t * obj)
.y = lv_obj_get_style_transform_pivot_y(obj, 0) .y = lv_obj_get_style_transform_pivot_y(obj, 0)
}; };
if(LV_COORD_IS_PCT(pivot.x)) {
pivot.x = (LV_COORD_GET_PCT(pivot.x) * lv_area_get_width(&obj->coords)) / 100;
}
if(LV_COORD_IS_PCT(pivot.y)) {
pivot.y = (LV_COORD_GET_PCT(pivot.y) * lv_area_get_height(&obj->coords)) / 100;
}
lv_draw_img_dsc_t draw_dsc; lv_draw_img_dsc_t draw_dsc;
lv_draw_img_dsc_init(&draw_dsc); lv_draw_img_dsc_init(&draw_dsc);
draw_dsc.opa = opa; draw_dsc.opa = opa;
@ -1025,7 +1113,7 @@ static void draw_buf_rotate_180(lv_disp_drv_t * drv, lv_area_t * area, lv_color_
area->x1 = drv->hor_res - tmp_coord - 1; area->x1 = drv->hor_res - tmp_coord - 1;
} }
static LV_ATTRIBUTE_FAST_MEM void draw_buf_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h, static void LV_ATTRIBUTE_FAST_MEM draw_buf_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h,
lv_color_t * orig_color_p, lv_color_t * rot_buf) lv_color_t * orig_color_p, lv_color_t * rot_buf)
{ {
@ -1189,24 +1277,13 @@ static void draw_buf_flush(lv_disp_t * disp)
lv_draw_ctx_t * draw_ctx = disp->driver->draw_ctx; lv_draw_ctx_t * draw_ctx = disp->driver->draw_ctx;
if(draw_ctx->wait_for_finish) draw_ctx->wait_for_finish(draw_ctx); if(draw_ctx->wait_for_finish) draw_ctx->wait_for_finish(draw_ctx);
/* In double buffered mode wait until the other buffer is freed /* In partial double buffered mode wait until the other buffer is freed
* and driver is ready to receive the new buffer */ * and driver is ready to receive the new buffer */
if(draw_buf->buf1 && draw_buf->buf2) { bool full_sized = draw_buf->size == (uint32_t)disp_refr->driver->hor_res * disp_refr->driver->ver_res;
if(draw_buf->buf1 && draw_buf->buf2 && !full_sized) {
while(draw_buf->flushing) { while(draw_buf->flushing) {
if(disp_refr->driver->wait_cb) disp_refr->driver->wait_cb(disp_refr->driver); if(disp_refr->driver->wait_cb) disp_refr->driver->wait_cb(disp_refr->driver);
} }
/*If the screen is transparent initialize it when the flushing is ready*/
#if LV_COLOR_SCREEN_TRANSP
if(disp_refr->driver->screen_transp) {
if(disp_refr->driver->clear_cb) {
disp_refr->driver->clear_cb(disp_refr->driver, disp_refr->driver->draw_buf->buf_act, disp_refr->driver->draw_buf->size);
}
else {
lv_memset_00(disp_refr->driver->draw_buf->buf_act, disp_refr->driver->draw_buf->size * LV_IMG_PX_SIZE_ALPHA_BYTE);
}
}
#endif
} }
draw_buf->flushing = 1; draw_buf->flushing = 1;
@ -1225,6 +1302,7 @@ static void draw_buf_flush(lv_disp_t * disp)
call_flush_cb(disp->driver, draw_ctx->buf_area, draw_ctx->buf); call_flush_cb(disp->driver, draw_ctx->buf_area, draw_ctx->buf);
} }
} }
/*If there are 2 buffers swap them. With direct mode swap only on the last area*/ /*If there are 2 buffers swap them. With direct mode swap only on the last area*/
if(draw_buf->buf1 && draw_buf->buf2 && (!disp->driver->direct_mode || flushing_last)) { if(draw_buf->buf1 && draw_buf->buf2 && (!disp->driver->direct_mode || flushing_last)) {
if(draw_buf->buf_act == draw_buf->buf1) if(draw_buf->buf_act == draw_buf->buf1)

@ -3,6 +3,24 @@
* *
*/ */
/*
* Copyright (C) 2010-2023 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/********************* /*********************
* INCLUDES * INCLUDES
*********************/ *********************/
@ -39,6 +57,7 @@
#include "../../core/lv_refr.h" #include "../../core/lv_refr.h"
#if LV_USE_GPU_ARM2D #if LV_USE_GPU_ARM2D
#define __ARM_2D_IMPL__
#include "arm_2d.h" #include "arm_2d.h"
#include "__arm_2d_impl.h" #include "__arm_2d_impl.h"
@ -89,10 +108,14 @@
#define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb16_cl_key_copy #define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb16_cl_key_copy
#define __arm_2d_impl_alpha_blending_colour_keying \ #define __arm_2d_impl_alpha_blending_colour_keying \
__arm_2d_impl_rgb565_alpha_blending_colour_keying __arm_2d_impl_rgb565_alpha_blending_colour_keying
#define arm_2d_tile_transform_with_src_mask_and_opacity \ #define arm_2d_tile_transform_with_src_mask_and_opacity_prepare \
arm_2d_rgb565_tile_transform_with_src_mask_and_opacity arm_2dp_rgb565_tile_transform_with_src_mask_and_opacity_prepare
#define arm_2d_tile_transform_with_opacity \ #define arm_2d_tile_transform_with_opacity_prepare \
arm_2d_rgb565_tile_transform_with_opacity arm_2dp_rgb565_tile_transform_with_opacity_prepare
#define arm_2d_tile_transform_only_with_opacity_prepare \
arm_2dp_rgb565_tile_transform_only_with_opacity_prepare
#define arm_2d_tile_transform_prepare \
arm_2dp_rgb565_tile_transform_prepare
#define __ARM_2D_PIXEL_BLENDING_OPA __ARM_2D_PIXEL_BLENDING_OPA_RGB565 #define __ARM_2D_PIXEL_BLENDING_OPA __ARM_2D_PIXEL_BLENDING_OPA_RGB565
@ -124,10 +147,14 @@
#define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb32_cl_key_copy #define __arm_2d_impl_cl_key_copy __arm_2d_impl_rgb32_cl_key_copy
#define __arm_2d_impl_alpha_blending_colour_keying \ #define __arm_2d_impl_alpha_blending_colour_keying \
__arm_2d_impl_cccn888_alpha_blending_colour_keying __arm_2d_impl_cccn888_alpha_blending_colour_keying
#define arm_2d_tile_transform_with_src_mask_and_opacity \ #define arm_2d_tile_transform_with_src_mask_and_opacity_prepare \
arm_2d_cccn888_tile_transform_with_src_mask_and_opacity arm_2dp_cccn888_tile_transform_with_src_mask_and_opacity_prepare
#define arm_2d_tile_transform_with_opacity \ #define arm_2d_tile_transform_with_opacity_prepare \
arm_2d_cccn888_tile_transform_with_opacity arm_2dp_cccn888_tile_transform_with_opacity_prepare
#define arm_2d_tile_transform_only_with_opacity_prepare \
arm_2dp_cccn888_tile_transform_only_with_opacity_prepare
#define arm_2d_tile_transform_prepare \
arm_2dp_cccn888_tile_transform_prepare
#define __ARM_2D_PIXEL_BLENDING_OPA __ARM_2D_PIXEL_BLENDING_OPA_CCCN888 #define __ARM_2D_PIXEL_BLENDING_OPA __ARM_2D_PIXEL_BLENDING_OPA_CCCN888
@ -298,11 +325,88 @@
/* replace src_buf for the following operation */ \ /* replace src_buf for the following operation */ \
src_buf = (const uint8_t *)rgb_tmp_buf; \ src_buf = (const uint8_t *)rgb_tmp_buf; \
} \ } \
do { \
__VA_ARGS__ \ __VA_ARGS__ \
} while(0); \
if (NULL != rgb_tmp_buf) { \ if (NULL != rgb_tmp_buf) { \
lv_mem_buf_release(rgb_tmp_buf); \ lv_mem_buf_release(rgb_tmp_buf); \
} \ } \
} while(0); } while(0); \
src_buf = src_buf_org;
#define __RECOLOUR_BEGIN() \
do { \
lv_color_t *rgb_tmp_buf = NULL; \
if(draw_dsc->recolor_opa > LV_OPA_MIN) { \
rgb_tmp_buf \
= lv_mem_buf_get(src_w * src_h * sizeof(lv_color_t)); \
if (NULL == rgb_tmp_buf) { \
LV_LOG_WARN( \
"Failed to allocate memory for accelerating recolour, " \
"use normal route instead."); \
break; \
} \
lv_memcpy(rgb_tmp_buf, src_buf, src_w * src_h * sizeof(lv_color_t));\
arm_2d_size_t copy_size = { \
.iWidth = src_w, \
.iHeight = src_h, \
}; \
/* apply re-colour */ \
__arm_2d_impl_colour_filling_with_opacity( \
(color_int *)rgb_tmp_buf, \
src_w, \
&copy_size, \
(color_int)draw_dsc->recolor.full, \
draw_dsc->recolor_opa); \
\
/* replace src_buf for the following operation */ \
src_buf = (const uint8_t *)rgb_tmp_buf; \
} \
do {
#define __RECOLOUR_END() \
} while(0); \
if (NULL != rgb_tmp_buf) { \
lv_mem_buf_release(rgb_tmp_buf); \
} \
} while(0); \
src_buf = src_buf_org;
#define __ARM_2D_PREPARE_TRANS_AND_TARGET_REGION(__TRANS_PREPARE, ...) \
do { \
__TRANS_PREPARE( \
NULL, \
__VA_ARGS__); \
\
target_region = (arm_2d_region_t) { \
.tLocation = { \
.iX = coords->x1 - draw_ctx->clip_area->x1, \
.iY = coords->y1 - draw_ctx->clip_area->y1, \
}, \
.tSize = { \
.iWidth = lv_area_get_width(coords), \
.iHeight = lv_area_get_height(coords), \
}, \
}; \
\
arm_2d_size_t tTransSize \
= ARM_2D_CTRL.DefaultOP \
.tTransform.Source.ptTile->tRegion.tSize; \
\
if (target_region.tSize.iWidth < tTransSize.iWidth) { \
int16_t iDelta = tTransSize.iWidth - target_region.tSize.iWidth;\
target_region.tLocation.iX -= iDelta / 2; \
target_region.tSize.iWidth = tTransSize.iWidth; \
} \
\
if (target_region.tSize.iHeight < tTransSize.iHeight) { \
int16_t iDelta \
= tTransSize.iHeight - target_region.tSize.iHeight; \
target_region.tLocation.iY -= iDelta / 2; \
target_region.tSize.iHeight = tTransSize.iHeight; \
} \
} while(0)
/* *INDENT-ON* */ /* *INDENT-ON* */
/********************** /**********************
@ -314,15 +418,13 @@
**********************/ **********************/
#if __ARM_2D_HAS_HW_ACC__ #if __ARM_2D_HAS_HW_ACC__
LV_ATTRIBUTE_FAST_MEM static bool /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
static bool lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
const arm_2d_region_t * region, const arm_2d_region_t * region,
lv_color_t color, lv_color_t color,
lv_opa_t opa, lv_opa_t opa,
const arm_2d_tile_t * mask_tile); const arm_2d_tile_t * mask_tile);
LV_ATTRIBUTE_FAST_MEM static bool /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
static bool lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
const arm_2d_region_t * region, const arm_2d_region_t * region,
arm_2d_tile_t * source_tile, arm_2d_tile_t * source_tile,
lv_opa_t opa, lv_opa_t opa,
@ -339,8 +441,7 @@ static void convert_cb(const lv_area_t * dest_area,
lv_color_t * cbuf, lv_color_t * cbuf,
lv_opa_t * abuf); lv_opa_t * abuf);
LV_ATTRIBUTE_FAST_MEM static bool /* LV_ATTRIBUTE_FAST_MEM */ arm_2d_fill_normal(lv_color_t * dest_buf,
static bool arm_2d_fill_normal(lv_color_t * dest_buf,
const lv_area_t * dest_area, const lv_area_t * dest_area,
lv_coord_t dest_stride, lv_coord_t dest_stride,
lv_color_t color, lv_color_t color,
@ -348,8 +449,7 @@ static bool arm_2d_fill_normal(lv_color_t * dest_buf,
const lv_opa_t * mask, const lv_opa_t * mask,
lv_coord_t mask_stride); lv_coord_t mask_stride);
LV_ATTRIBUTE_FAST_MEM static bool /* LV_ATTRIBUTE_FAST_MEM */ arm_2d_copy_normal(lv_color_t * dest_buf,
static bool arm_2d_copy_normal(lv_color_t * dest_buf,
const lv_area_t * dest_area, const lv_area_t * dest_area,
lv_coord_t dest_stride, lv_coord_t dest_stride,
const lv_color_t * src_buf, const lv_color_t * src_buf,
@ -359,12 +459,10 @@ static bool arm_2d_copy_normal(lv_color_t * dest_buf,
lv_coord_t mask_stride); lv_coord_t mask_stride);
#endif #endif
LV_ATTRIBUTE_FAST_MEM static void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx,
static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc); const lv_draw_sw_blend_dsc_t * dsc);
LV_ATTRIBUTE_FAST_MEM static void /* LV_ATTRIBUTE_FAST_MEM */ lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx);
static void lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx); static void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
LV_ATTRIBUTE_FAST_MEM
static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
const lv_draw_img_dsc_t * draw_dsc, const lv_draw_img_dsc_t * draw_dsc,
const lv_area_t * coords, const lv_area_t * coords,
const uint8_t * src_buf, const uint8_t * src_buf,
@ -408,8 +506,8 @@ void lv_draw_arm2d_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx)
extern void test_flush(lv_color_t * color_p); extern void test_flush(lv_color_t * color_p);
#if __ARM_2D_HAS_HW_ACC__ #if __ARM_2D_HAS_HW_ACC__
LV_ATTRIBUTE_FAST_MEM static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx,
static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) const lv_draw_sw_blend_dsc_t * dsc)
{ {
const lv_opa_t * mask; const lv_opa_t * mask;
if(dsc->mask_buf == NULL) mask = NULL; if(dsc->mask_buf == NULL) mask = NULL;
@ -456,8 +554,7 @@ static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend
} }
LV_ATTRIBUTE_FAST_MEM static bool LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
static bool lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
const arm_2d_region_t * region, const arm_2d_region_t * region,
lv_color_t color, lv_color_t color,
lv_opa_t opa, lv_opa_t opa,
@ -519,8 +616,7 @@ static bool lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
} }
LV_ATTRIBUTE_FAST_MEM static bool LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
static bool lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
const arm_2d_region_t * region, const arm_2d_region_t * region,
arm_2d_tile_t * source_tile, arm_2d_tile_t * source_tile,
lv_opa_t opa, lv_opa_t opa,
@ -587,8 +683,8 @@ static void lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx)
#else #else
LV_ATTRIBUTE_FAST_MEM static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx,
static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc) const lv_draw_sw_blend_dsc_t * dsc)
{ {
const lv_opa_t * mask; const lv_opa_t * mask;
if(dsc->mask_buf == NULL) mask = NULL; if(dsc->mask_buf == NULL) mask = NULL;
@ -601,18 +697,26 @@ static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend
lv_area_t blend_area; lv_area_t blend_area;
if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) return; if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) return;
lv_disp_t * disp = _lv_refr_get_disp_refreshing(); //lv_disp_t * disp = _lv_refr_get_disp_refreshing();
bool is_accelerated = false; bool is_accelerated = false;
do { do {
if(NULL != disp->driver->set_px_cb) {
break;
}
/* target buffer */
lv_color_t * dest_buf = draw_ctx->buf; lv_color_t * dest_buf = draw_ctx->buf;
dest_buf += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) lv_disp_t * disp = _lv_refr_get_disp_refreshing();
+ (blend_area.x1 - draw_ctx->buf_area->x1); if(disp->driver->screen_transp == 0) {
dest_buf += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) + (blend_area.x1 - draw_ctx->buf_area->x1);
}
else {
/*With LV_COLOR_DEPTH 16 it means ARGB8565 (3 bytes format)*/
uint8_t * dest_buf8 = (uint8_t *) dest_buf;
dest_buf8 += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) * LV_IMG_PX_SIZE_ALPHA_BYTE;
dest_buf8 += (blend_area.x1 - draw_ctx->buf_area->x1) * LV_IMG_PX_SIZE_ALPHA_BYTE;
dest_buf = (lv_color_t *)dest_buf8;
}
/* source buffer */
const lv_color_t * src_buf = dsc->src_buf; const lv_color_t * src_buf = dsc->src_buf;
lv_coord_t src_stride; lv_coord_t src_stride;
if(src_buf) { if(src_buf) {
@ -634,7 +738,9 @@ static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend
lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1); lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1);
if(disp->driver->screen_transp) {
break;
}
if(dsc->src_buf == NULL) { if(dsc->src_buf == NULL) {
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
is_accelerated = arm_2d_fill_normal(dest_buf, is_accelerated = arm_2d_fill_normal(dest_buf,
@ -645,14 +751,8 @@ static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend
mask, mask,
mask_stride); mask_stride);
} }
#if LV_DRAW_COMPLEX
else {
break;
}
#endif
} }
else { else {
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) { if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
is_accelerated = arm_2d_copy_normal(dest_buf, is_accelerated = arm_2d_copy_normal(dest_buf,
&blend_area, &blend_area,
@ -663,19 +763,13 @@ static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend
mask, mask,
mask_stride); mask_stride);
} }
#if LV_DRAW_COMPLEX
else {
break;
}
#endif
} }
} while(0); } while(0);
if(!is_accelerated) lv_draw_sw_blend_basic(draw_ctx, dsc); if(!is_accelerated) lv_draw_sw_blend_basic(draw_ctx, dsc);
} }
LV_ATTRIBUTE_FAST_MEM static bool LV_ATTRIBUTE_FAST_MEM arm_2d_fill_normal(lv_color_t * dest_buf,
static bool arm_2d_fill_normal(lv_color_t * dest_buf,
const lv_area_t * dest_area, const lv_area_t * dest_area,
lv_coord_t dest_stride, lv_coord_t dest_stride,
lv_color_t color, lv_color_t color,
@ -698,15 +792,11 @@ static bool arm_2d_fill_normal(lv_color_t * dest_buf,
} }
/*Has opacity*/ /*Has opacity*/
else { else {
#if LV_COLOR_SCREEN_TRANSP
return false;
#else
__arm_2d_impl_colour_filling_with_opacity((color_int *)dest_buf, __arm_2d_impl_colour_filling_with_opacity((color_int *)dest_buf,
dest_stride, dest_stride,
&target_size, &target_size,
color.full, color.full,
opa); opa);
#endif
} }
} }
/*Masked*/ /*Masked*/
@ -722,9 +812,6 @@ static bool arm_2d_fill_normal(lv_color_t * dest_buf,
} }
/*With opacity*/ /*With opacity*/
else { else {
#if LV_COLOR_SCREEN_TRANSP
return false;
#else
__arm_2d_impl_colour_filling_mask_opacity((color_int *)dest_buf, __arm_2d_impl_colour_filling_mask_opacity((color_int *)dest_buf,
dest_stride, dest_stride,
(uint8_t *)mask, (uint8_t *)mask,
@ -732,7 +819,6 @@ static bool arm_2d_fill_normal(lv_color_t * dest_buf,
&target_size, &target_size,
color.full, color.full,
opa); opa);
#endif
} }
} }
@ -740,8 +826,7 @@ static bool arm_2d_fill_normal(lv_color_t * dest_buf,
} }
LV_ATTRIBUTE_FAST_MEM static bool LV_ATTRIBUTE_FAST_MEM arm_2d_copy_normal(lv_color_t * dest_buf,
static bool arm_2d_copy_normal(lv_color_t * dest_buf,
const lv_area_t * dest_area, const lv_area_t * dest_area,
lv_coord_t dest_stride, lv_coord_t dest_stride,
const lv_color_t * src_buf, const lv_color_t * src_buf,
@ -759,10 +844,6 @@ static bool arm_2d_copy_normal(lv_color_t * dest_buf,
.iHeight = lv_area_get_height(dest_area), .iHeight = lv_area_get_height(dest_area),
}; };
#if LV_COLOR_SCREEN_TRANSP
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
#endif
/*Simple fill (maybe with opacity), no masking*/ /*Simple fill (maybe with opacity), no masking*/
if(mask == NULL) { if(mask == NULL) {
if(opa >= LV_OPA_MAX) { if(opa >= LV_OPA_MAX) {
@ -773,25 +854,18 @@ static bool arm_2d_copy_normal(lv_color_t * dest_buf,
&copy_size); &copy_size);
} }
else { else {
#if LV_COLOR_SCREEN_TRANSP
return false;
#else
__arm_2d_impl_alpha_blending((color_int *)src_buf, __arm_2d_impl_alpha_blending((color_int *)src_buf,
src_stride, src_stride,
(color_int *)dest_buf, (color_int *)dest_buf,
dest_stride, dest_stride,
&copy_size, &copy_size,
opa); opa);
#endif
} }
} }
/*Masked*/ /*Masked*/
else { else {
/*Only the mask matters*/ /*Only the mask matters*/
if(opa > LV_OPA_MAX) { if(opa > LV_OPA_MAX) {
#if LV_COLOR_SCREEN_TRANSP
return false;
#else
__arm_2d_impl_src_msk_copy((color_int *)src_buf, __arm_2d_impl_src_msk_copy((color_int *)src_buf,
src_stride, src_stride,
(uint8_t *)mask, (uint8_t *)mask,
@ -800,13 +874,9 @@ static bool arm_2d_copy_normal(lv_color_t * dest_buf,
(color_int *)dest_buf, (color_int *)dest_buf,
dest_stride, dest_stride,
&copy_size); &copy_size);
#endif
} }
/*Handle opa and mask values too*/ /*Handle opa and mask values too*/
else { else {
#if LV_COLOR_SCREEN_TRANSP
return false;
#else
__arm_2d_impl_gray8_alpha_blending((uint8_t *)mask, __arm_2d_impl_gray8_alpha_blending((uint8_t *)mask,
mask_stride, mask_stride,
(uint8_t *)mask, (uint8_t *)mask,
@ -822,15 +892,13 @@ static bool arm_2d_copy_normal(lv_color_t * dest_buf,
(color_int *)dest_buf, (color_int *)dest_buf,
dest_stride, dest_stride,
&copy_size); &copy_size);
#endif
} }
} }
return true; return true;
} }
LV_ATTRIBUTE_FAST_MEM static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
const lv_draw_img_dsc_t * draw_dsc, const lv_draw_img_dsc_t * draw_dsc,
const lv_area_t * coords, const lv_area_t * coords,
const uint8_t * src_buf, const uint8_t * src_buf,
@ -839,6 +907,7 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
/*Use the clip area as draw area*/ /*Use the clip area as draw area*/
lv_area_t draw_area; lv_area_t draw_area;
lv_area_copy(&draw_area, draw_ctx->clip_area); lv_area_copy(&draw_area, draw_ctx->clip_area);
const uint8_t * src_buf_org = src_buf;
bool mask_any = lv_draw_mask_is_any(&draw_area); bool mask_any = lv_draw_mask_is_any(&draw_area);
bool transform = draw_dsc->angle != 0 || draw_dsc->zoom != LV_IMG_ZOOM_NONE ? true : false; bool transform = draw_dsc->angle != 0 || draw_dsc->zoom != LV_IMG_ZOOM_NONE ? true : false;
@ -851,6 +920,13 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
blend_dsc.blend_mode = draw_dsc->blend_mode; blend_dsc.blend_mode = draw_dsc->blend_mode;
blend_dsc.blend_area = &blend_area; blend_dsc.blend_area = &blend_area;
if(lv_img_cf_is_chroma_keyed(cf)) cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED;
else if(cf == LV_IMG_CF_ALPHA_8BIT) {}
else if(cf == LV_IMG_CF_RGB565A8) {}
else if(lv_img_cf_has_alpha(cf)) cf = LV_IMG_CF_TRUE_COLOR_ALPHA;
else cf = LV_IMG_CF_TRUE_COLOR;
/*The simplest case just copy the pixels into the draw_buf*/ /*The simplest case just copy the pixels into the draw_buf*/
if(!mask_any && !transform && cf == LV_IMG_CF_TRUE_COLOR && draw_dsc->recolor_opa == LV_OPA_TRANSP) { if(!mask_any && !transform && cf == LV_IMG_CF_TRUE_COLOR && draw_dsc->recolor_opa == LV_OPA_TRANSP) {
blend_dsc.src_buf = (const lv_color_t *)src_buf; blend_dsc.src_buf = (const lv_color_t *)src_buf;
@ -859,6 +935,9 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
lv_draw_sw_blend(draw_ctx, &blend_dsc); lv_draw_sw_blend(draw_ctx, &blend_dsc);
} }
else if(!mask_any && !transform && cf == LV_IMG_CF_ALPHA_8BIT) { else if(!mask_any && !transform && cf == LV_IMG_CF_ALPHA_8BIT) {
lv_area_t clipped_coords;
if(!_lv_area_intersect(&clipped_coords, coords, draw_ctx->clip_area)) return;
blend_dsc.mask_buf = (lv_opa_t *)src_buf; blend_dsc.mask_buf = (lv_opa_t *)src_buf;
blend_dsc.mask_area = coords; blend_dsc.mask_area = coords;
blend_dsc.src_buf = NULL; blend_dsc.src_buf = NULL;
@ -869,7 +948,8 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
lv_draw_sw_blend(draw_ctx, &blend_dsc); lv_draw_sw_blend(draw_ctx, &blend_dsc);
} }
#if LV_COLOR_DEPTH == 16 #if LV_COLOR_DEPTH == 16
else if(!mask_any && !transform && cf == LV_IMG_CF_RGB565A8 && draw_dsc->recolor_opa == LV_OPA_TRANSP) { else if(!mask_any && !transform && cf == LV_IMG_CF_RGB565A8 && draw_dsc->recolor_opa == LV_OPA_TRANSP &&
blend_dsc.opa >= LV_OPA_MAX) {
lv_coord_t src_w = lv_area_get_width(coords); lv_coord_t src_w = lv_area_get_width(coords);
lv_coord_t src_h = lv_area_get_height(coords); lv_coord_t src_h = lv_area_get_height(coords);
blend_dsc.src_buf = (const lv_color_t *)src_buf; blend_dsc.src_buf = (const lv_color_t *)src_buf;
@ -922,6 +1002,23 @@ 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; LV_DRAW_MASK_RES_CHANGED : LV_DRAW_MASK_RES_FULL_COVER;
blend_dsc.mask_res = mask_res_def; blend_dsc.mask_res = mask_res_def;
if(cf == LV_IMG_CF_ALPHA_8BIT) {
/* original code:
lv_color_fill(rgb_buf, draw_dsc->recolor, buf_size);
*/
arm_2d_size_t copy_size = {
.iWidth = buf_w,
.iHeight = buf_h,
};
/* apply re-colour */
__arm_2d_impl_colour_filling(
(color_int *)rgb_buf,
buf_w,
&copy_size,
(color_int)draw_dsc->recolor.full);
}
bool is_accelerated = false; bool is_accelerated = false;
if(!transform) { if(!transform) {
@ -968,7 +1065,7 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
} }
else if((LV_COLOR_DEPTH == 32) else if((LV_COLOR_DEPTH == 32)
&& !mask_any && !mask_any
&& (cf == LV_IMG_CF_TRUE_COLOR_ALPHA)) { && (LV_IMG_CF_TRUE_COLOR_ALPHA == cf)) {
/* accelerate copy-with-source-masks-and-opacity */ /* accelerate copy-with-source-masks-and-opacity */
/* *INDENT-OFF* */ /* *INDENT-OFF* */
@ -1025,6 +1122,63 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
) )
/* *INDENT-ON* */ /* *INDENT-ON* */
} }
else if(!mask_any
&& (LV_IMG_CF_RGB565A8 == cf)) {
/* accelerate copy-with-source-masks-and-opacity */
uint8_t * mask_after_rgb = src_buf + sizeof(lv_color_t) * src_w * src_h;
/* *INDENT-OFF* */
__RECOLOUR_WRAPPER(
__PREPARE_LL_ACCELERATION__();
uint8_t * mask_temp_buf = NULL;
if(blend_dsc.opa < LV_OPA_MAX) {
mask_temp_buf = lv_mem_buf_get(copy_size.iHeight * copy_size.iWidth);
if(NULL == mask_temp_buf) {
LV_LOG_WARN(
"Failed to allocate memory for alpha mask,"
" use normal route instead.");
break;
}
lv_memset_00(mask_temp_buf, copy_size.iHeight * copy_size.iWidth);
__arm_2d_impl_gray8_colour_filling_mask_opacity(
mask_temp_buf,
src_stride,
mask_after_rgb,
src_stride,
&copy_size,
0xFF,
blend_dsc.opa);
__arm_2d_impl_src_msk_copy(
(color_int *)src_buf_tmp,
src_stride,
mask_temp_buf,
src_stride,
&copy_size,
(color_int *)dest_buf,
dest_stride,
&copy_size);
lv_mem_buf_release(mask_temp_buf);
}
else {
__arm_2d_impl_src_msk_copy(
(color_int *)src_buf_tmp,
src_stride,
mask_after_rgb,
src_stride,
&copy_size,
(color_int *)dest_buf,
dest_stride,
&copy_size);
}
is_accelerated = true;
)
/* *INDENT-ON* */
}
else if(!mask_any && (cf == LV_IMG_CF_TRUE_COLOR)) { else if(!mask_any && (cf == LV_IMG_CF_TRUE_COLOR)) {
/* accelerate copy-with-source-masks-and-opacity */ /* accelerate copy-with-source-masks-and-opacity */
@ -1063,6 +1217,7 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
&& (draw_dsc->recolor_opa == LV_OPA_TRANSP) && (draw_dsc->recolor_opa == LV_OPA_TRANSP)
&& (((LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf) && (((LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf)
|| (LV_IMG_CF_TRUE_COLOR == cf)) || (LV_IMG_CF_TRUE_COLOR == cf))
|| (LV_IMG_CF_RGB565A8 == cf)
#if defined(__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) && __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ #if defined(__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) && __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__
|| ((LV_IMG_CF_TRUE_COLOR_ALPHA == cf) || ((LV_IMG_CF_TRUE_COLOR_ALPHA == cf)
&& (LV_COLOR_DEPTH == 32)) && (LV_COLOR_DEPTH == 32))
@ -1070,6 +1225,7 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
) )
) { ) {
uint8_t * mask_after_rgb = src_buf + sizeof(lv_color_t) * src_w * src_h;
/* *INDENT-OFF* */ /* *INDENT-OFF* */
__RECOLOUR_WRAPPER( __RECOLOUR_WRAPPER(
/* accelerate transform without re-color */ /* accelerate transform without re-color */
@ -1108,17 +1264,6 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
&target_tile, &target_tile,
false); false);
target_region = (arm_2d_region_t) {
.tLocation = {
.iX = coords->x1 - draw_ctx->clip_area->x1,
.iY = coords->y1 - draw_ctx->clip_area->y1,
},
.tSize = {
.iWidth = lv_area_get_width(coords),
.iHeight = lv_area_get_height(coords),
},
};
static arm_2d_tile_t source_tile; static arm_2d_tile_t source_tile;
source_tile = (arm_2d_tile_t) { source_tile = (arm_2d_tile_t) {
@ -1132,45 +1277,98 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
.pchBuffer = (uint8_t *)src_buf, .pchBuffer = (uint8_t *)src_buf,
}; };
static arm_2d_tile_t mask_tile;
mask_tile = source_tile;
mask_tile.tInfo.bHasEnforcedColour = true;
mask_tile.tInfo.tColourInfo.chScheme = ARM_2D_CHANNEL_8in32;
mask_tile.pchBuffer += 3;
static arm_2d_location_t source_center, target_center; static arm_2d_location_t source_center, target_center;
source_center.iX = draw_dsc->pivot.x; source_center.iX = draw_dsc->pivot.x;
source_center.iY = draw_dsc->pivot.y; source_center.iY = draw_dsc->pivot.y;
if(LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf) {
if((LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED == cf) || __ARM_2D_PREPARE_TRANS_AND_TARGET_REGION(
(LV_IMG_CF_TRUE_COLOR == cf)) { arm_2d_tile_transform_with_opacity_prepare,
arm_2d_tile_transform_with_opacity(
&source_tile, &source_tile,
source_center,
ARM_2D_ANGLE((draw_dsc->angle / 10.0f)),
draw_dsc->zoom / 256.0f,
(color_int)LV_COLOR_CHROMA_KEY.full,
blend_dsc.opa);
arm_2d_tile_transform(
&target_tile, &target_tile,
&target_region, &target_region,
NULL
);
is_accelerated = true;
}
#if ARM_2D_VERISON >= 10103
else if (LV_IMG_CF_TRUE_COLOR == cf) {
__ARM_2D_PREPARE_TRANS_AND_TARGET_REGION(
arm_2d_tile_transform_only_with_opacity_prepare,
&source_tile,
source_center, source_center,
ARM_2D_ANGLE((draw_dsc->angle / 10.0f)), ARM_2D_ANGLE((draw_dsc->angle / 10.0f)),
draw_dsc->zoom / 256.0f, draw_dsc->zoom / 256.0f,
(color_int)LV_COLOR_CHROMA_KEY.full,
blend_dsc.opa); blend_dsc.opa);
arm_2d_tile_transform(
&target_tile,
&target_region,
NULL
);
is_accelerated = true;
}
#endif
else if (LV_IMG_CF_RGB565A8 == cf) {
static arm_2d_tile_t mask_tile;
mask_tile = source_tile;
mask_tile.tInfo.bHasEnforcedColour = true;
mask_tile.tInfo.tColourInfo.chScheme = ARM_2D_COLOUR_GRAY8;
mask_tile.pchBuffer = mask_after_rgb;
__ARM_2D_PREPARE_TRANS_AND_TARGET_REGION(
arm_2d_tile_transform_with_src_mask_and_opacity_prepare,
&source_tile,
&mask_tile,
source_center,
ARM_2D_ANGLE((draw_dsc->angle / 10.0f)),
draw_dsc->zoom / 256.0f,
blend_dsc.opa
);
arm_2d_tile_transform(
&target_tile,
&target_region,
NULL
);
is_accelerated = true; is_accelerated = true;
} }
#if defined(__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) \ #if defined(__ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__) \
&& __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__ && __ARM_2D_CFG_SUPPORT_COLOUR_CHANNEL_ACCESS__
else if((LV_IMG_CF_TRUE_COLOR_ALPHA == cf) && else if((LV_IMG_CF_TRUE_COLOR_ALPHA == cf) &&
(LV_COLOR_DEPTH == 32)) { (LV_COLOR_DEPTH == 32)) {
arm_2d_tile_transform_with_src_mask_and_opacity( static arm_2d_tile_t mask_tile;
mask_tile = source_tile;
mask_tile.tInfo.bHasEnforcedColour = true;
mask_tile.tInfo.tColourInfo.chScheme = ARM_2D_CHANNEL_8in32;
mask_tile.pchBuffer += 3;
__ARM_2D_PREPARE_TRANS_AND_TARGET_REGION(
arm_2d_tile_transform_with_src_mask_and_opacity_prepare,
&source_tile, &source_tile,
&mask_tile, &mask_tile,
&target_tile,
&target_region,
source_center, source_center,
ARM_2D_ANGLE((draw_dsc->angle / 10.0f)), ARM_2D_ANGLE((draw_dsc->angle / 10.0f)),
draw_dsc->zoom / 256.0f, draw_dsc->zoom / 256.0f,
blend_dsc.opa); blend_dsc.opa
);
arm_2d_tile_transform(
&target_tile,
&target_region,
NULL
);
is_accelerated = true; is_accelerated = true;
} }
@ -1208,7 +1406,7 @@ static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
(color_int)draw_dsc->recolor.full, (color_int)draw_dsc->recolor.full,
draw_dsc->recolor_opa); draw_dsc->recolor_opa);
} }
#if LV_DRAW_COMPLEX #if LV_USE_DRAW_MASKS
/*Apply the masks if any*/ /*Apply the masks if any*/
if(mask_any) { if(mask_any) {
lv_coord_t y; lv_coord_t y;
@ -1275,7 +1473,7 @@ static void convert_cb(const lv_area_t * dest_area, const void * src_buf, lv_coo
if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) { if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) {
uint32_t px_cnt = lv_area_get_size(dest_area); uint32_t px_cnt = lv_area_get_size(dest_area);
lv_memset_ff(abuf, px_cnt); lv_memset(abuf, 0xff, px_cnt);
src_tmp8 += (src_stride * dest_area->y1 * sizeof(lv_color_t)) + dest_area->x1 * sizeof(lv_color_t); src_tmp8 += (src_stride * dest_area->y1 * sizeof(lv_color_t)) + dest_area->x1 * sizeof(lv_color_t);
uint32_t dest_w = lv_area_get_width(dest_area); uint32_t dest_w = lv_area_get_width(dest_area);

@ -72,6 +72,7 @@ typedef struct _lv_draw_ctx_t {
*/ */
const lv_area_t * clip_area; const lv_area_t * clip_area;
void (*init_buf)(struct _lv_draw_ctx_t * draw_ctx);
void (*draw_rect)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords); void (*draw_rect)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords);

@ -25,7 +25,8 @@
/********************** /**********************
* STATIC PROTOTYPES * STATIC PROTOTYPES
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM static lv_res_t decode_and_draw(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc, static lv_res_t /* LV_ATTRIBUTE_FAST_MEM */ decode_and_draw(lv_draw_ctx_t * draw_ctx,
const lv_draw_img_dsc_t * draw_dsc,
const lv_area_t * coords, const void * src); const lv_area_t * coords, const void * src);
static void show_error(lv_draw_ctx_t * draw_ctx, const lv_area_t * coords, const char * msg); static void show_error(lv_draw_ctx_t * draw_ctx, const lv_area_t * coords, const char * msg);
@ -69,18 +70,19 @@ void lv_draw_img(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc, const
if(dsc->opa <= LV_OPA_MIN) return; if(dsc->opa <= LV_OPA_MIN) return;
lv_res_t res; lv_res_t res = LV_RES_INV;
if(draw_ctx->draw_img) { if(draw_ctx->draw_img) {
res = draw_ctx->draw_img(draw_ctx, dsc, coords, src); res = draw_ctx->draw_img(draw_ctx, dsc, coords, src);
} }
else {
if(res != LV_RES_OK) {
res = decode_and_draw(draw_ctx, dsc, coords, src); res = decode_and_draw(draw_ctx, dsc, coords, src);
} }
if(res == LV_RES_INV) { if(res != LV_RES_OK) {
LV_LOG_WARN("Image draw error"); LV_LOG_WARN("Image draw error");
show_error(draw_ctx, coords, "No\ndata"); show_error(draw_ctx, coords, "No\ndata");
return;
} }
} }
@ -197,11 +199,19 @@ lv_img_src_t lv_img_src_get_type(const void * src)
if(src == NULL) return img_src_type; if(src == NULL) return img_src_type;
const uint8_t * u8_p = src; const uint8_t * u8_p = src;
/*The first byte shows the type of the image source*/ /*The first or fourth byte depending on platform endianess shows the type of the image source*/
#if LV_BIG_ENDIAN_SYSTEM
if(u8_p[3] >= 0x20 && u8_p[3] <= 0x7F) {
#else
if(u8_p[0] >= 0x20 && u8_p[0] <= 0x7F) { if(u8_p[0] >= 0x20 && u8_p[0] <= 0x7F) {
#endif
img_src_type = LV_IMG_SRC_FILE; /*If it's an ASCII character then it's file name*/ img_src_type = LV_IMG_SRC_FILE; /*If it's an ASCII character then it's file name*/
} }
#if LV_BIG_ENDIAN_SYSTEM
else if(u8_p[3] >= 0x80) {
#else
else if(u8_p[0] >= 0x80) { else if(u8_p[0] >= 0x80) {
#endif
img_src_type = LV_IMG_SRC_SYMBOL; /*Symbols begins after 0x7F*/ img_src_type = LV_IMG_SRC_SYMBOL; /*Symbols begins after 0x7F*/
} }
else { else {
@ -227,7 +237,8 @@ void lv_draw_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM static lv_res_t decode_and_draw(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc, static lv_res_t LV_ATTRIBUTE_FAST_MEM decode_and_draw(lv_draw_ctx_t * draw_ctx,
const lv_draw_img_dsc_t * draw_dsc,
const lv_area_t * coords, const void * src) const lv_area_t * coords, const void * src)
{ {
if(draw_dsc->opa <= LV_OPA_MIN) return LV_RES_OK; if(draw_dsc->opa <= LV_OPA_MIN) return LV_RES_OK;

@ -52,7 +52,7 @@ static uint8_t hex_char_to_num(char hex);
* GLOBAL FUNCTIONS * GLOBAL FUNCTIONS
**********************/ **********************/
void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc) void LV_ATTRIBUTE_FAST_MEM lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
{ {
lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t)); lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t));
dsc->opa = LV_OPA_COVER; dsc->opa = LV_OPA_COVER;
@ -74,7 +74,7 @@ void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
* @param hint pointer to a `lv_draw_label_hint_t` variable. * @param hint pointer to a `lv_draw_label_hint_t` variable.
* It is managed by the draw to speed up the drawing of very long texts (thousands of lines). * It is managed by the draw to speed up the drawing of very long texts (thousands of lines).
*/ */
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, void LV_ATTRIBUTE_FAST_MEM lv_draw_label(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint) const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint)
{ {
if(dsc->opa <= LV_OPA_MIN) return; if(dsc->opa <= LV_OPA_MIN) return;

@ -68,7 +68,7 @@ struct _lv_draw_ctx_t;
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc); void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc);
/** /**
* Write a text * Write a text
@ -79,7 +79,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc);
* @param hint pointer to a `lv_draw_label_hint_t` variable. * @param hint pointer to a `lv_draw_label_hint_t` variable.
* It is managed by the draw to speed up the drawing of very long texts (thousands of lines). * It is managed by the draw to speed up the drawing of very long texts (thousands of lines).
*/ */
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint); const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint);
void lv_draw_letter(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p, void lv_draw_letter(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p,

@ -34,7 +34,7 @@
* GLOBAL FUNCTIONS * GLOBAL FUNCTIONS
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc) void LV_ATTRIBUTE_FAST_MEM lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
{ {
lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t)); lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t));
dsc->width = 1; dsc->width = 1;
@ -42,7 +42,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
dsc->color = lv_color_black(); dsc->color = lv_color_black();
} }
LV_ATTRIBUTE_FAST_MEM void lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, void LV_ATTRIBUTE_FAST_MEM lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
const lv_point_t * point1, const lv_point_t * point2) const lv_point_t * point1, const lv_point_t * point2)
{ {
if(dsc->width == 0) return; if(dsc->width == 0) return;

@ -43,7 +43,7 @@ struct _lv_draw_ctx_t;
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc); void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
/** /**
* Draw a line * Draw a line
@ -52,8 +52,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
* @param clip the line will be drawn only in this area * @param clip the line will be drawn only in this area
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable * @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
*/ */
void lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1, void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
const lv_point_t * point2); const lv_point_t * point1, const lv_point_t * point2);
/********************** /**********************

@ -26,30 +26,30 @@
/********************** /**********************
* STATIC PROTOTYPES * STATIC PROTOTYPES
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_line_param_t * param); lv_draw_mask_line_param_t * param);
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_radius_param_t * param); lv_draw_mask_radius_param_t * param);
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_angle_param_t * param); lv_draw_mask_angle_param_t * param);
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_fade_param_t * param); lv_draw_mask_fade_param_t * param);
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_map_param_t * param); lv_draw_mask_map_param_t * param);
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_polygon_param_t * param); lv_draw_mask_polygon_param_t * param);
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_line_param_t * p); lv_draw_mask_line_param_t * p);
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_line_param_t * p); lv_draw_mask_line_param_t * p);
static void circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius); static void circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius);
@ -58,7 +58,7 @@ static void circ_next(lv_point_t * c, lv_coord_t * tmp);
static void circ_calc_aa4(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t radius); static void circ_calc_aa4(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t radius);
static lv_opa_t * get_next_line(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t y, lv_coord_t * len, static lv_opa_t * get_next_line(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t y, lv_coord_t * len,
lv_coord_t * x_start); lv_coord_t * x_start);
LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new); static inline lv_opa_t /* LV_ATTRIBUTE_FAST_MEM */ mask_mix(lv_opa_t mask_act, lv_opa_t mask_new);
/********************** /**********************
* STATIC VARIABLES * STATIC VARIABLES
@ -108,8 +108,8 @@ int16_t lv_draw_mask_add(void * param, void * custom_id)
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
*/ */
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t len) lv_coord_t abs_y, lv_coord_t len)
{ {
bool changed = false; bool changed = false;
_lv_draw_mask_common_dsc_t * dsc; _lv_draw_mask_common_dsc_t * dsc;
@ -142,8 +142,9 @@ LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf,
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
*/ */
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t len, const int16_t * ids, int16_t ids_count) lv_coord_t abs_y, lv_coord_t len,
const int16_t * ids, int16_t ids_count)
{ {
bool changed = false; bool changed = false;
_lv_draw_mask_common_dsc_t * dsc; _lv_draw_mask_common_dsc_t * dsc;
@ -243,7 +244,7 @@ void _lv_draw_mask_cleanup(void)
* Count the currently added masks * Count the currently added masks
* @return number of active masks * @return number of active masks
*/ */
LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void) uint8_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_get_cnt(void)
{ {
uint8_t cnt = 0; uint8_t cnt = 0;
uint8_t i; uint8_t i;
@ -593,7 +594,7 @@ void lv_draw_mask_polygon_init(lv_draw_mask_polygon_param_t * param, const lv_po
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_line_param_t * p) lv_draw_mask_line_param_t * p)
{ {
@ -653,7 +654,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
return res; return res;
} }
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
lv_coord_t len, lv_coord_t len,
lv_draw_mask_line_param_t * p) lv_draw_mask_line_param_t * p)
{ {
@ -769,7 +770,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
return LV_DRAW_MASK_RES_CHANGED; return LV_DRAW_MASK_RES_CHANGED;
} }
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
lv_coord_t len, lv_coord_t len,
lv_draw_mask_line_param_t * p) lv_draw_mask_line_param_t * p)
{ {
@ -911,7 +912,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_
return LV_DRAW_MASK_RES_CHANGED; return LV_DRAW_MASK_RES_CHANGED;
} }
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_angle_param_t * p) lv_draw_mask_angle_param_t * p)
{ {
@ -1050,7 +1051,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_radius_param_t * p) lv_draw_mask_radius_param_t * p)
{ {
@ -1167,7 +1168,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
return LV_DRAW_MASK_RES_CHANGED; return LV_DRAW_MASK_RES_CHANGED;
} }
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_fade_param_t * p) lv_draw_mask_fade_param_t * p)
{ {
@ -1213,7 +1214,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mas
} }
} }
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_map_param_t * p) lv_draw_mask_map_param_t * p)
{ {
@ -1247,7 +1248,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask
return LV_DRAW_MASK_RES_CHANGED; return LV_DRAW_MASK_RES_CHANGED;
} }
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x, static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t abs_y, lv_coord_t len, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_polygon_param_t * param) lv_draw_mask_polygon_param_t * param)
{ {
@ -1518,7 +1519,7 @@ static lv_opa_t * get_next_line(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_
} }
LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new) static inline lv_opa_t LV_ATTRIBUTE_FAST_MEM mask_mix(lv_opa_t mask_act, lv_opa_t mask_new)
{ {
if(mask_new >= LV_OPA_MAX) return mask_act; if(mask_new >= LV_OPA_MAX) return mask_act;
if(mask_new <= LV_OPA_MIN) return 0; if(mask_new <= LV_OPA_MIN) return 0;

@ -241,8 +241,8 @@ int16_t lv_draw_mask_add(void * param, void * custom_id);
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
*/ */
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t len); lv_coord_t abs_y, lv_coord_t len);
/** /**
* Apply the specified buffers on a line. Used internally by the library's drawing routines. * Apply the specified buffers on a line. Used internally by the library's drawing routines.
@ -257,8 +257,9 @@ LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf,
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged * - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line * - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
*/ */
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x,
lv_coord_t len, const int16_t * ids, int16_t ids_count); lv_coord_t abs_y, lv_coord_t len,
const int16_t * ids, int16_t ids_count);
//! @endcond //! @endcond
@ -299,7 +300,7 @@ void _lv_draw_mask_cleanup(void);
* Count the currently added masks * Count the currently added masks
* @return number of active masks * @return number of active masks
*/ */
LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void); uint8_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_get_cnt(void);
/** /**

@ -34,7 +34,7 @@
* GLOBAL FUNCTIONS * GLOBAL FUNCTIONS
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc) void LV_ATTRIBUTE_FAST_MEM lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
{ {
lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t)); lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t));
dsc->bg_color = lv_color_white(); dsc->bg_color = lv_color_white();

@ -74,7 +74,7 @@ struct _lv_draw_ctx_t;
* GLOBAL PROTOTYPES * GLOBAL PROTOTYPES
**********************/ **********************/
LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc); void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc);
/** /**

@ -38,17 +38,7 @@
* GLOBAL FUNCTIONS * GLOBAL FUNCTIONS
**********************/ **********************/
/** lv_color_t lv_img_buf_get_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color)
* Get the color of an image's pixel
* @param dsc an image descriptor
* @param x x coordinate of the point to get
* @param y x coordinate of the point to get
* @param color the color of the image. In case of `LV_IMG_CF_ALPHA_1/2/4/8` this color is used.
* Not used in other cases.
* @param safe true: check out of bounds
* @return color of the point
*/
lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color)
{ {
lv_color_t p_color = lv_color_black(); lv_color_t p_color = lv_color_black();
uint8_t * buf_u8 = (uint8_t *)dsc->data; uint8_t * buf_u8 = (uint8_t *)dsc->data;
@ -107,15 +97,7 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t
return p_color; return p_color;
} }
/** lv_opa_t lv_img_buf_get_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
* Get the alpha value of an image's pixel
* @param dsc pointer to an image descriptor
* @param x x coordinate of the point to set
* @param y x coordinate of the point to set
* @param safe true: check out of bounds
* @return alpha value of the point
*/
lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
{ {
uint8_t * buf_u8 = (uint8_t *)dsc->data; uint8_t * buf_u8 = (uint8_t *)dsc->data;
@ -170,15 +152,7 @@ lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
return LV_OPA_COVER; return LV_OPA_COVER;
} }
/** void lv_img_buf_set_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa)
* Set the alpha value of a pixel of an image. The color won't be affected
* @param dsc pointer to an image descriptor
* @param x x coordinate of the point to set
* @param y x coordinate of the point to set
* @param opa the desired opacity
* @param safe true: check out of bounds
*/
void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa)
{ {
uint8_t * buf_u8 = (uint8_t *)dsc->data; uint8_t * buf_u8 = (uint8_t *)dsc->data;
@ -229,15 +203,7 @@ void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
} }
} }
/** void lv_img_buf_set_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c)
* Set the color of a pixel of an image. The alpha channel won't be affected.
* @param dsc pointer to an image descriptor
* @param x x coordinate of the point to set
* @param y x coordinate of the point to set
* @param c color of the point
* @param safe true: check out of bounds
*/
void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c)
{ {
uint8_t * buf_u8 = (uint8_t *)dsc->data; uint8_t * buf_u8 = (uint8_t *)dsc->data;
@ -296,17 +262,7 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
} }
} }
/** void lv_img_buf_set_palette(const lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
* Set the palette color of an indexed image. Valid only for `LV_IMG_CF_INDEXED1/2/4/8`
* @param dsc pointer to an image descriptor
* @param id the palette color to set:
* - for `LV_IMG_CF_INDEXED1`: 0..1
* - for `LV_IMG_CF_INDEXED2`: 0..3
* - for `LV_IMG_CF_INDEXED4`: 0..15
* - for `LV_IMG_CF_INDEXED8`: 0..255
* @param c the color to set
*/
void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
{ {
if((dsc->header.cf == LV_IMG_CF_ALPHA_1BIT && id > 1) || (dsc->header.cf == LV_IMG_CF_ALPHA_2BIT && id > 3) || if((dsc->header.cf == LV_IMG_CF_ALPHA_1BIT && id > 1) || (dsc->header.cf == LV_IMG_CF_ALPHA_2BIT && id > 3) ||
(dsc->header.cf == LV_IMG_CF_ALPHA_4BIT && id > 15) || (dsc->header.cf == LV_IMG_CF_ALPHA_8BIT)) { (dsc->header.cf == LV_IMG_CF_ALPHA_4BIT && id > 15) || (dsc->header.cf == LV_IMG_CF_ALPHA_8BIT)) {
@ -320,13 +276,6 @@ void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32)); lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32));
} }
/**
* Allocate an image buffer in RAM
* @param w width of image
* @param h height of image
* @param cf a color format (`LV_IMG_CF_...`)
* @return an allocated image, or NULL on failure
*/
lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
{ {
/*Allocate image descriptor*/ /*Allocate image descriptor*/
@ -359,10 +308,6 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
return dsc; return dsc;
} }
/**
* Free an allocated image buffer
* @param dsc image buffer to free
*/
void lv_img_buf_free(lv_img_dsc_t * dsc) void lv_img_buf_free(lv_img_dsc_t * dsc)
{ {
if(dsc != NULL) { if(dsc != NULL) {
@ -373,13 +318,6 @@ void lv_img_buf_free(lv_img_dsc_t * dsc)
} }
} }
/**
* Get the memory consumption of a raw bitmap, given color format and dimensions.
* @param w width
* @param h height
* @param cf color format
* @return size in bytes
*/
uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
{ {
switch(cf) { switch(cf) {
@ -411,15 +349,6 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
} }
} }
/**
* Get the area of a rectangle if its rotated and scaled
* @param res store the coordinates here
* @param w width of the rectangle to transform
* @param h height of the rectangle to transform
* @param angle angle of rotation
* @param zoom zoom, (256 no zoom)
* @param pivot x,y pivot coordinates of rotation
*/
void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom,
const lv_point_t * pivot) const lv_point_t * pivot)
{ {

@ -167,7 +167,7 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf);
* @param safe true: check out of bounds * @param safe true: check out of bounds
* @return color of the point * @return color of the point
*/ */
lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color); lv_color_t lv_img_buf_get_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color);
/** /**
* Get the alpha value of an image's pixel * Get the alpha value of an image's pixel
@ -177,7 +177,7 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t
* @param safe true: check out of bounds * @param safe true: check out of bounds
* @return alpha value of the point * @return alpha value of the point
*/ */
lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y); lv_opa_t lv_img_buf_get_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y);
/** /**
* Set the color of a pixel of an image. The alpha channel won't be affected. * Set the color of a pixel of an image. The alpha channel won't be affected.
@ -187,7 +187,7 @@ lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
* @param c color of the point * @param c color of the point
* @param safe true: check out of bounds * @param safe true: check out of bounds
*/ */
void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c); void lv_img_buf_set_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c);
/** /**
* Set the alpha value of a pixel of an image. The color won't be affected * Set the alpha value of a pixel of an image. The color won't be affected
@ -197,7 +197,7 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
* @param opa the desired opacity * @param opa the desired opacity
* @param safe true: check out of bounds * @param safe true: check out of bounds
*/ */
void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa); void lv_img_buf_set_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa);
/** /**
* Set the palette color of an indexed image. Valid only for `LV_IMG_CF_INDEXED1/2/4/8` * Set the palette color of an indexed image. Valid only for `LV_IMG_CF_INDEXED1/2/4/8`
@ -209,7 +209,7 @@ void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
* - for `LV_IMG_CF_INDEXED8`: 0..255 * - for `LV_IMG_CF_INDEXED8`: 0..255
* @param c the color to set * @param c the color to set
*/ */
void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c); void lv_img_buf_set_palette(const lv_img_dsc_t * dsc, uint8_t id, lv_color_t c);
/** /**
* Free an allocated image buffer * Free an allocated image buffer

@ -360,10 +360,35 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
} }
lv_img_cf_t cf = dsc->header.cf; lv_img_cf_t cf = dsc->header.cf;
/*Process A8, RGB565A8, need load file to ram after https://github.com/lvgl/lvgl/pull/3337*/
if(cf == LV_IMG_CF_ALPHA_8BIT || cf == LV_IMG_CF_RGB565A8) {
if(dsc->src_type == LV_IMG_SRC_VARIABLE) {
/*In case of uncompressed formats the image stored in the ROM/RAM.
*So simply give its pointer*/
dsc->img_data = ((lv_img_dsc_t *)dsc->src)->data;
return LV_RES_OK;
}
else {
/*If it's a file, read all to memory*/
uint32_t len = dsc->header.w * dsc->header.h;
len *= cf == LV_IMG_CF_RGB565A8 ? 3 : 1;
uint8_t * fs_buf = lv_mem_alloc(len);
if(fs_buf == NULL) return LV_RES_INV;
lv_img_decoder_built_in_data_t * user_data = dsc->user_data;
lv_fs_seek(&user_data->f, 4, LV_FS_SEEK_SET); /*+4 to skip the header*/
lv_fs_res_t res = lv_fs_read(&user_data->f, fs_buf, len, NULL);
if(res != LV_FS_RES_OK) {
lv_mem_free(fs_buf);
return LV_RES_INV;
}
dsc->img_data = fs_buf;
return LV_RES_OK;
}
}
/*Process true color formats*/ /*Process true color formats*/
if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_ALPHA || else if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_ALPHA ||
cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED || cf == LV_IMG_CF_RGB565A8 || cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) {
cf == LV_IMG_CF_ALPHA_8BIT) {
if(dsc->src_type == LV_IMG_SRC_VARIABLE) { if(dsc->src_type == LV_IMG_SRC_VARIABLE) {
/*In case of uncompressed formats the image stored in the ROM/RAM. /*In case of uncompressed formats the image stored in the ROM/RAM.
*So simply give its pointer*/ *So simply give its pointer*/

@ -144,7 +144,7 @@ void _lv_img_decoder_init(void);
* Get information about an image. * Get information about an image.
* Try the created image decoder one by one. Once one is able to get info that info will be used. * Try the created image decoder one by one. Once one is able to get info that info will be used.
* @param src the image source. Can be * @param src the image source. Can be
* 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_add_drv()`) * 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_drv_register()`)
* 2) Variable: Pointer to an `lv_img_dsc_t` variable * 2) Variable: Pointer to an `lv_img_dsc_t` variable
* 3) Symbol: E.g. `LV_SYMBOL_OK` * 3) Symbol: E.g. `LV_SYMBOL_OK`
* @param header the image info will be stored here * @param header the image info will be stored here
@ -157,7 +157,7 @@ lv_res_t lv_img_decoder_get_info(const void * src, lv_img_header_t * header);
* Try the created image decoders one by one. Once one is able to open the image that decoder is saved in `dsc` * Try the created image decoders one by one. Once one is able to open the image that decoder is saved in `dsc`
* @param dsc describes a decoding session. Simply a pointer to an `lv_img_decoder_dsc_t` variable. * @param dsc describes a decoding session. Simply a pointer to an `lv_img_decoder_dsc_t` variable.
* @param src the image source. Can be * @param src the image source. Can be
* 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_add_drv()`) * 1) File name: E.g. "S:folder/img1.png" (The drivers needs to registered via `lv_fs_drv_register())`)
* 2) Variable: Pointer to an `lv_img_dsc_t` variable * 2) Variable: Pointer to an `lv_img_dsc_t` variable
* 3) Symbol: E.g. `LV_SYMBOL_OK` * 3) Symbol: E.g. `LV_SYMBOL_OK`
* @param color The color of the image with `LV_IMG_CF_ALPHA_...` * @param color The color of the image with `LV_IMG_CF_ALPHA_...`

@ -1,5 +1,3 @@
CSRCS += lv_gpu_nxp.c
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/nxp

@ -1,418 +0,0 @@
/**
* @file lv_gpu_nxp.c
*
*/
/**
* MIT License
*
* Copyright 2022 NXP
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next paragraph)
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_gpu_nxp.h"
#if LV_USE_GPU_NXP_PXP || LV_USE_GPU_NXP_VG_LITE
/*
* allow to use both PXP and VGLITE
* both 2D accelerators can be used at the same time:
* thus VGLITE can be used to accelerate widget drawing
* while PXP accelerates Blit & Fill operations.
*/
#if LV_USE_GPU_NXP_PXP
#include "pxp/lv_draw_pxp_blend.h"
#endif
#if LV_USE_GPU_NXP_VG_LITE
#include "vglite/lv_draw_vglite_blend.h"
#include "vglite/lv_draw_vglite_rect.h"
#include "vglite/lv_draw_vglite_arc.h"
#endif
#if LV_COLOR_DEPTH != 32
#include "../../core/lv_refr.h"
#endif
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void lv_draw_nxp_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc,
const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t cf);
static void lv_draw_nxp_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc);
static void lv_draw_nxp_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords);
static lv_res_t draw_nxp_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords);
static void lv_draw_nxp_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center,
uint16_t radius, uint16_t start_angle, uint16_t end_angle);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_draw_nxp_ctx_init(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx)
{
lv_draw_sw_init_ctx(drv, draw_ctx);
lv_draw_nxp_ctx_t * nxp_draw_ctx = (lv_draw_sw_ctx_t *)draw_ctx;
nxp_draw_ctx->base_draw.draw_arc = lv_draw_nxp_arc;
nxp_draw_ctx->base_draw.draw_rect = lv_draw_nxp_rect;
nxp_draw_ctx->base_draw.draw_img_decoded = lv_draw_nxp_img_decoded;
nxp_draw_ctx->blend = lv_draw_nxp_blend;
//nxp_draw_ctx->base_draw.wait_for_finish = lv_draw_nxp_wait_cb;
}
void lv_draw_nxp_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx)
{
lv_draw_sw_deinit_ctx(drv, draw_ctx);
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* During rendering, LVGL might initializes new draw_ctxs and start drawing into
* a separate buffer (called layer). If the content to be rendered has "holes",
* e.g. rounded corner, LVGL temporarily sets the disp_drv.screen_transp flag.
* It means the renderers should draw into an ARGB buffer.
* With 32 bit color depth it's not a big problem but with 16 bit color depth
* the target pixel format is ARGB8565 which is not supported by the GPU.
* In this case, the NXP callbacks should fallback to SW rendering.
*/
static inline bool need_argb8565_support()
{
#if LV_COLOR_DEPTH != 32
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
if(disp->driver->screen_transp == 1)
return true;
#endif
return false;
}
static void lv_draw_nxp_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc)
{
lv_area_t blend_area;
/*Let's get the blend area which is the intersection of the area to fill and the clip area.*/
if(!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area))
return; /*Fully clipped, nothing to do*/
/*Make the blend area relative to the buffer*/
lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1);
bool done = false;
/*Fill/Blend only non masked, normal blended*/
if(dsc->mask_buf == NULL && dsc->blend_mode == LV_BLEND_MODE_NORMAL && !need_argb8565_support()) {
lv_color_t * dest_buf = draw_ctx->buf;
lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area);
#if LV_USE_GPU_NXP_VG_LITE
lv_coord_t dest_width = lv_area_get_width(draw_ctx->buf_area);
lv_coord_t dest_height = lv_area_get_height(draw_ctx->buf_area);
#endif
const lv_color_t * src_buf = dsc->src_buf;
if(src_buf == NULL) {
#if LV_USE_GPU_NXP_PXP
done = (lv_gpu_nxp_pxp_fill(dest_buf, dest_stride, &blend_area,
dsc->color, dsc->opa) == LV_RES_OK);
if(!done)
PXP_LOG_TRACE("PXP fill failed. Fallback.");
#endif
#if LV_USE_GPU_NXP_VG_LITE
if(!done) {
done = (lv_gpu_nxp_vglite_fill(dest_buf, dest_width, dest_height, &blend_area,
dsc->color, dsc->opa) == LV_RES_OK);
if(!done)
VG_LITE_LOG_TRACE("VG-Lite fill failed. Fallback.");
}
#endif
}
else {
#if LV_USE_GPU_NXP_PXP
done = (lv_gpu_nxp_pxp_blit(dest_buf, &blend_area, dest_stride, src_buf, dsc->blend_area,
dsc->opa, LV_DISP_ROT_NONE) == LV_RES_OK);
if(!done)
PXP_LOG_TRACE("PXP blit failed. Fallback.");
#endif
#if LV_USE_GPU_NXP_VG_LITE
if(!done) {
lv_gpu_nxp_vglite_blit_info_t blit;
lv_coord_t src_stride = lv_area_get_width(dsc->blend_area);
blit.src = src_buf;
blit.src_width = lv_area_get_width(dsc->blend_area);
blit.src_height = lv_area_get_height(dsc->blend_area);
blit.src_stride = src_stride * (int32_t)sizeof(lv_color_t);
blit.src_area.x1 = (blend_area.x1 - (dsc->blend_area->x1 - draw_ctx->buf_area->x1));
blit.src_area.y1 = (blend_area.y1 - (dsc->blend_area->y1 - draw_ctx->buf_area->y1));
blit.src_area.x2 = blit.src_area.x1 + blit.src_width - 1;
blit.src_area.y2 = blit.src_area.y1 + blit.src_height - 1;
blit.dst = dest_buf;
blit.dst_width = dest_width;
blit.dst_height = dest_height;
blit.dst_stride = dest_stride * (int32_t)sizeof(lv_color_t);
blit.dst_area.x1 = blend_area.x1;
blit.dst_area.y1 = blend_area.y1;
blit.dst_area.x2 = blend_area.x2;
blit.dst_area.y2 = blend_area.y2;
blit.opa = dsc->opa;
blit.zoom = LV_IMG_ZOOM_NONE;
blit.angle = 0;
done = (lv_gpu_nxp_vglite_blit(&blit) == LV_RES_OK);
if(!done)
VG_LITE_LOG_TRACE("VG-Lite blit failed. Fallback.");
}
#endif
}
}
if(!done)
lv_draw_sw_blend_basic(draw_ctx, dsc);
}
static void lv_draw_nxp_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc,
const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t cf)
{
/*Use the clip area as draw area*/
lv_area_t draw_area;
lv_area_copy(&draw_area, draw_ctx->clip_area);
bool mask_any = lv_draw_mask_is_any(&draw_area);
#if LV_USE_GPU_NXP_VG_LITE
bool recolor = (dsc->recolor_opa != LV_OPA_TRANSP);
#endif
#if LV_USE_GPU_NXP_PXP
bool scale = (dsc->zoom != LV_IMG_ZOOM_NONE);
#endif
bool done = false;
lv_area_t blend_area;
/*Let's get the blend area which is the intersection of the area to fill and the clip area.*/
if(!_lv_area_intersect(&blend_area, coords, draw_ctx->clip_area))
return; /*Fully clipped, nothing to do*/
/*Make the blend area relative to the buffer*/
lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1);
const lv_color_t * src_buf = (const lv_color_t *)map_p;
if(!src_buf) {
lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf);
return;
}
lv_color_t * dest_buf = draw_ctx->buf;
lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area);
#if LV_USE_GPU_NXP_PXP
if(!mask_any && !scale && !need_argb8565_support()
#if LV_COLOR_DEPTH!=32
&& !lv_img_cf_has_alpha(cf)
#endif
) {
done = (lv_gpu_nxp_pxp_blit_transform(dest_buf, &blend_area, dest_stride, src_buf, coords,
dsc, cf) == LV_RES_OK);
if(!done)
PXP_LOG_TRACE("PXP blit transform failed. Fallback.");
}
#endif
#if LV_USE_GPU_NXP_VG_LITE
if(!done && !mask_any && !need_argb8565_support() &&
!lv_img_cf_is_chroma_keyed(cf) && !recolor
#if LV_COLOR_DEPTH!=32
&& !lv_img_cf_has_alpha(cf)
#endif
) {
lv_gpu_nxp_vglite_blit_info_t blit;
lv_coord_t src_stride = lv_area_get_width(coords);
blit.src = src_buf;
blit.src_width = lv_area_get_width(coords);
blit.src_height = lv_area_get_height(coords);
blit.src_stride = src_stride * (int32_t)sizeof(lv_color_t);
blit.src_area.x1 = (blend_area.x1 - (coords->x1 - draw_ctx->buf_area->x1));
blit.src_area.y1 = (blend_area.y1 - (coords->y1 - draw_ctx->buf_area->y1));
blit.src_area.x2 = blit.src_area.x1 + blit.src_width - 1;
blit.src_area.y2 = blit.src_area.y1 + blit.src_height - 1;
blit.dst = dest_buf;
blit.dst_width = lv_area_get_width(draw_ctx->buf_area);
blit.dst_height = lv_area_get_height(draw_ctx->buf_area);
blit.dst_stride = dest_stride * (int32_t)sizeof(lv_color_t);
blit.dst_area.x1 = blend_area.x1;
blit.dst_area.y1 = blend_area.y1;
blit.dst_area.x2 = blend_area.x2;
blit.dst_area.y2 = blend_area.y2;
blit.opa = dsc->opa;
blit.angle = dsc->angle;
blit.pivot = dsc->pivot;
blit.zoom = dsc->zoom;
done = (lv_gpu_nxp_vglite_blit_transform(&blit) == LV_RES_OK);
if(!done)
VG_LITE_LOG_TRACE("VG-Lite blit transform failed. Fallback.");
}
#endif
if(!done)
lv_draw_sw_img_decoded(draw_ctx, dsc, coords, map_p, cf);
}
static void lv_draw_nxp_rect(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
{
bool done = false;
lv_draw_rect_dsc_t nxp_dsc;
lv_memcpy(&nxp_dsc, dsc, sizeof(nxp_dsc));
#if LV_DRAW_COMPLEX
/* Draw only the shadow */
nxp_dsc.bg_opa = 0;
nxp_dsc.bg_img_opa = 0;
nxp_dsc.border_opa = 0;
nxp_dsc.outline_opa = 0;
lv_draw_sw_rect(draw_ctx, &nxp_dsc, coords);
/* Draw the background */
nxp_dsc.shadow_opa = 0;
nxp_dsc.bg_opa = dsc->bg_opa;
done = (draw_nxp_bg(draw_ctx, &nxp_dsc, coords) == LV_RES_OK);
#endif /*LV_DRAW_COMPLEX*/
/* Draw the remaining parts */
nxp_dsc.shadow_opa = 0;
if(done)
nxp_dsc.bg_opa = 0;
nxp_dsc.bg_img_opa = dsc->bg_img_opa;
nxp_dsc.border_opa = dsc->border_opa;
nxp_dsc.outline_opa = dsc->outline_opa;
lv_draw_sw_rect(draw_ctx, &nxp_dsc, coords);
}
static lv_res_t draw_nxp_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
{
if(dsc->bg_opa <= LV_OPA_MIN)
return LV_RES_INV;
lv_area_t bg_coords;
lv_area_copy(&bg_coords, coords);
/*If the border fully covers make the bg area 1px smaller to avoid artifacts on the corners*/
if(dsc->border_width > 1 && dsc->border_opa >= (lv_opa_t)LV_OPA_MAX && dsc->radius != 0) {
bg_coords.x1 += (dsc->border_side & LV_BORDER_SIDE_LEFT) ? 1 : 0;
bg_coords.y1 += (dsc->border_side & LV_BORDER_SIDE_TOP) ? 1 : 0;
bg_coords.x2 -= (dsc->border_side & LV_BORDER_SIDE_RIGHT) ? 1 : 0;
bg_coords.y2 -= (dsc->border_side & LV_BORDER_SIDE_BOTTOM) ? 1 : 0;
}
lv_area_t clipped_coords;
if(!_lv_area_intersect(&clipped_coords, &bg_coords, draw_ctx->clip_area))
return LV_RES_INV;
lv_grad_dir_t grad_dir = dsc->bg_grad.dir;
lv_color_t bg_color = grad_dir == LV_GRAD_DIR_NONE ? dsc->bg_color : dsc->bg_grad.stops[0].color;
if(bg_color.full == dsc->bg_grad.stops[1].color.full) grad_dir = LV_GRAD_DIR_NONE;
bool mask_any = lv_draw_mask_is_any(&bg_coords);
/*
* Most simple case: just a plain rectangle (no mask, no radius, no gradient)
* shall fallback to lv_draw_sw_blend().
*
* Complex case: gradient or radius but no mask.
*/
if(!mask_any && ((dsc->radius != 0) || (grad_dir != LV_GRAD_DIR_NONE)) && !need_argb8565_support()) {
#if LV_USE_GPU_NXP_VG_LITE
lv_res_t res = lv_gpu_nxp_vglite_draw_bg(draw_ctx, dsc, &bg_coords);
if(res != LV_RES_OK)
VG_LITE_LOG_TRACE("VG-Lite draw bg failed. Fallback.");
return res;
#endif
}
return LV_RES_INV;
}
static void lv_draw_nxp_arc(lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center,
uint16_t radius, uint16_t start_angle, uint16_t end_angle)
{
bool done = false;
#if LV_DRAW_COMPLEX
if(dsc->opa <= LV_OPA_MIN)
return;
if(dsc->width == 0)
return;
if(start_angle == end_angle)
return;
#if LV_USE_GPU_NXP_VG_LITE
if(!need_argb8565_support()) {
done = (lv_gpu_nxp_vglite_draw_arc(draw_ctx, dsc, center, (int32_t)radius,
(int32_t)start_angle, (int32_t)end_angle) == LV_RES_OK);
if(!done)
VG_LITE_LOG_TRACE("VG-Lite draw arc failed. Fallback.");
}
#endif
#endif/*LV_DRAW_COMPLEX*/
if(!done)
lv_draw_sw_arc(draw_ctx, dsc, center, radius, start_angle, end_angle);
}
#endif /*LV_USE_GPU_NXP_PXP || LV_USE_GPU_NXP_VG_LITE*/

Some files were not shown because too many files have changed in this diff Show More