diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index a9fe826100..c52eb34afe 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -16,7 +16,8 @@ jobs: # See BUILD_OPTIONS in tests/CMakeLists.txt. build_option: ['OPTIONS_16BIT', 'OPTIONS_24BIT', - 'OPTIONS_FULL_32BIT'] + 'OPTIONS_FULL_32BIT', + "OPTIONS_VG_LITE"] name: Build ${{ matrix.build_option }} steps: - uses: actions/checkout@v4 diff --git a/src/draw/vg_lite/lv_draw_vg_lite_vector.c b/src/draw/vg_lite/lv_draw_vg_lite_vector.c index 93138127a3..c07b57051e 100644 --- a/src/draw/vg_lite/lv_draw_vg_lite_vector.c +++ b/src/draw/vg_lite/lv_draw_vg_lite_vector.c @@ -160,7 +160,7 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec case LV_VECTOR_DRAW_STYLE_GRADIENT: { /* draw gradient */ lv_area_t grad_area; - lv_area_set(&grad_area, min_x, min_y, max_x, max_y); + lv_area_set(&grad_area, (int32_t)min_x, (int32_t)min_y, (int32_t)max_x, (int32_t)max_y); lv_vector_gradient_style_t style = dsc->fill_dsc.gradient.style; vg_lite_gradient_spreadmode_t spreadmode = lv_spread_to_vg(dsc->fill_dsc.gradient.spread); LV_UNUSED(spreadmode); diff --git a/src/draw/vg_lite/lv_vg_lite_utils.c b/src/draw/vg_lite/lv_vg_lite_utils.c index cae1f52263..8ac988234d 100644 --- a/src/draw/vg_lite/lv_vg_lite_utils.c +++ b/src/draw/vg_lite/lv_vg_lite_utils.c @@ -382,6 +382,7 @@ vg_lite_buffer_format_t lv_vg_lite_vg_fmt(lv_color_format_t cf) } LV_ASSERT(false); + return 0; } void lv_vg_lite_buffer_format_bytes( diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5a8480f09e..9d93e7e32a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -43,6 +43,10 @@ include(CTest) set(LVGL_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(LVGL_TEST_OPTIONS_VG_LITE + -DLV_TEST_OPTION=6 +) + set(LVGL_TEST_OPTIONS_MINIMAL_MONOCHROME -DLV_TEST_OPTION=1 ) @@ -78,7 +82,9 @@ set(LVGL_TEST_OPTIONS_TEST_DEFHEAP --coverage ) -if (OPTIONS_NORMAL_8BIT) +if (OPTIONS_VG_LITE) + set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_VG_LITE}) +elseif (OPTIONS_NORMAL_8BIT) set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_NORMAL_8BIT}) elseif (OPTIONS_16BIT) set (BUILD_OPTIONS ${LVGL_TEST_OPTIONS_16BIT}) diff --git a/tests/main.py b/tests/main.py index 6b61a93844..e6d70455e9 100755 --- a/tests/main.py +++ b/tests/main.py @@ -16,6 +16,7 @@ build_only_options = { 'OPTIONS_16BIT': 'Minimal config, 16 bit color depth', 'OPTIONS_24BIT': 'Normal config, 24 bit color depth', 'OPTIONS_FULL_32BIT': 'Full config, 32 bit color depth', + 'OPTIONS_VG_LITE': 'VG-Lite simulator with full config, 32 bit color depth', } test_options = { diff --git a/tests/src/lv_test_conf.h b/tests/src/lv_test_conf.h index f7195372b7..87124034ad 100644 --- a/tests/src/lv_test_conf.h +++ b/tests/src/lv_test_conf.h @@ -62,11 +62,29 @@ typedef void * lv_user_data_t; ***********************/ #define LV_USE_DEV_VERSION - #if !(defined(LV_TEST_OPTION)) || LV_TEST_OPTION == 5 #define LV_COLOR_DEPTH 32 #define LV_DPI_DEF 160 #include "lv_test_conf_full.h" +#elif LV_TEST_OPTION == 6 +#define LV_COLOR_DEPTH 32 +#define LV_DPI_DEF 160 + +#define LV_USE_THORVG_INTERNAL 1 +/* Use VG-Lite GPU. */ +#define LV_USE_DRAW_VG_LITE 1 + +/* Enbale VG-Lite custom external 'gpu_init()' function */ +#define LV_VG_LITE_USE_GPU_INIT 1 + +/* Enable VG-Lite assert. */ +#define LV_VG_LITE_USE_ASSERT 1 + +/* Simulate VG-Lite hardware using ThorVG */ +#define LV_USE_VG_LITE_THORVG 1 + +#define LV_VG_LITE_THORVG_TRACE_API 1 +#include "lv_test_conf_full.h" #elif LV_TEST_OPTION == 4 #define LV_COLOR_DEPTH 24 #define LV_DPI_DEF 120