Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdl_render): support all draw task types #6437

Merged
merged 16 commits into from
Aug 26, 2024
6 changes: 6 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1510,10 +1510,16 @@ menu "LVGL configuration"
default 1 if LV_SDL_SINGLE_BUFFER
default 2 if LV_SDL_DOUBLE_BUFFER

config LV_SDL_ACCELERATED
bool "Use hardware acceleration"
depends on LV_USE_SDL
default y

config LV_SDL_FULLSCREEN
bool "SDL fullscreen"
depends on LV_USE_SDL
default n

config LV_SDL_DIRECT_EXIT
bool "Exit the application when all SDL windows are closed"
depends on LV_USE_SDL
Expand Down
11 changes: 5 additions & 6 deletions demos/widgets/lv_demo_widgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ static void profile_create(lv_obj_t * parent)
LV_IMAGE_DECLARE(img_demo_widgets_avatar);
lv_obj_t * avatar = lv_image_create(panel1);
lv_image_set_src(avatar, &img_demo_widgets_avatar);
// lv_image_set_src(avatar, "A:lvgl/demos/widgets/assets/avatar.png")

lv_obj_t * name = lv_label_create(panel1);
lv_label_set_text(name, "Elena Smith");
Expand Down Expand Up @@ -998,11 +997,11 @@ void shop_create(lv_obj_t * parent)
lv_obj_add_style(title, &style_title, 0);

LV_IMAGE_DECLARE(img_clothes);
create_shop_item(list, &img_clothes, "Blue jeans", "Clothes", "$722");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert unnecessary changes.

create_shop_item(list, &img_clothes, "Blue jeans", "Clothes", "$411");
create_shop_item(list, &img_clothes, "Blue jeans", "Clothes", "$917");
create_shop_item(list, &img_clothes, "Blue jeans", "Clothes", "$64");
create_shop_item(list, &img_clothes, "Blue jeans", "Clothes", "$805");
create_shop_item(list, &img_clothes, "Blue T-shirt", "Clothes", "$722");
create_shop_item(list, &img_clothes, "Blue T-shirt", "Clothes", "$411");
create_shop_item(list, &img_clothes, "Blue T-shirt", "Clothes", "$917");
create_shop_item(list, &img_clothes, "Blue T-shirt", "Clothes", "$64");
create_shop_item(list, &img_clothes, "Blue T-shirt", "Clothes", "$805");

lv_obj_t * notifications = lv_obj_create(parent);
if(disp_size == DISP_SMALL) {
Expand Down
1 change: 1 addition & 0 deletions lv_conf_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/
#define LV_SDL_BUF_COUNT 1 /*1 or 2*/
#define LV_SDL_ACCELERATED 1 /*1: Use hardware acceleration*/
#define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/
#define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/
#define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sudo dpkg --add-architecture i386
sudo apt update
sudo apt install gcc gcc-multilib g++-multilib ninja-build \
libpng-dev libjpeg-turbo8-dev libfreetype6-dev \
libglew-dev libglfw3-dev libsdl2-dev libsdl2-image-dev \
libglew-dev libglfw3-dev libsdl2-dev \
libpng-dev:i386 libjpeg-dev:i386 libfreetype6-dev:i386 \
ruby-full gcovr cmake python3 pngquant libinput-dev libxkbcommon-dev libdrm-dev pkg-config
pip3 install pypng lz4
1 change: 1 addition & 0 deletions src/draw/lv_draw_arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void lv_draw_arc_dsc_init(lv_draw_arc_dsc_t * dsc)
dsc->width = 1;
dsc->opa = LV_OPA_COVER;
dsc->color = lv_color_black();
dsc->base.dsc_size = sizeof(lv_draw_arc_dsc_t);
}

lv_draw_arc_dsc_t * lv_draw_task_get_arc_dsc(lv_draw_task_t * task)
Expand Down
1 change: 1 addition & 0 deletions src/draw/lv_draw_line.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void LV_ATTRIBUTE_FAST_MEM lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
dsc->width = 1;
dsc->opa = LV_OPA_COVER;
dsc->color = lv_color_black();
dsc->base.dsc_size = sizeof(lv_draw_line_dsc_t);
}

lv_draw_line_dsc_t * lv_draw_task_get_line_dsc(lv_draw_task_t * task)
Expand Down
1 change: 1 addition & 0 deletions src/draw/lv_draw_triangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * dsc)
dsc->bg_grad.stops[1].frac = 0xFF;
dsc->bg_grad.stops_count = 2;
dsc->bg_opa = LV_OPA_COVER;
dsc->base.dsc_size = sizeof(lv_draw_triangle_dsc_t);
LV_PROFILER_END;
}

Expand Down
Loading
Loading