From 63953a0717685edf3c83832a80ee21d131dbd3ea Mon Sep 17 00:00:00 2001 From: pengyiqiang Date: Mon, 18 Dec 2023 12:02:30 +0800 Subject: [PATCH] fix(draw_vector): fix build break when thorvg disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` lvgl/demos/lv_demos.c:74:37: error: ‘lv_demo_vector_graphic’ undeclared here (not in a function) 74 | { "vector_graphic", .entry_cb = lv_demo_vector_graphic }, | ^~~~~~~~~~~~~~~~~~~~~ /usr/bin/ld: lib/liblvgl.a(lv_draw_sw.c.o): in function `execute_drawing': lvgl/src/draw/sw/lv_draw_sw.c:338: undefined reference to `lv_draw_sw_vector' ``` Signed-off-by: pengyiqiang --- demos/lv_demos.h | 2 +- src/draw/sw/lv_draw_sw.c | 2 +- src/draw/sw/lv_draw_sw.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/lv_demos.h b/demos/lv_demos.h index 34e5c20a4..00eb0a688 100644 --- a/demos/lv_demos.h +++ b/demos/lv_demos.h @@ -51,7 +51,7 @@ extern "C" { #include "multilang/lv_demo_multilang.h" #endif -#if LV_USE_DEMO_VECTOR_GRAPHIC && LV_USE_VECTOR_GRAPHIC && (LV_USE_THORVG_INTERNAL || LV_USE_THORVG_EXTERNAL) +#if LV_USE_DEMO_VECTOR_GRAPHIC && LV_USE_VECTOR_GRAPHIC #include "vector_graphic/lv_demo_vector_graphic.h" #endif diff --git a/src/draw/sw/lv_draw_sw.c b/src/draw/sw/lv_draw_sw.c index eccb0614f..939ceacb1 100644 --- a/src/draw/sw/lv_draw_sw.c +++ b/src/draw/sw/lv_draw_sw.c @@ -333,7 +333,7 @@ static void execute_drawing(lv_draw_sw_unit_t * u) case LV_DRAW_TASK_TYPE_MASK_RECTANGLE: lv_draw_sw_mask_rect((lv_draw_unit_t *)u, t->draw_dsc, &t->area); break; -#if LV_USE_VECTOR_GRAPHIC +#if LV_USE_VECTOR_GRAPHIC && (LV_USE_THORVG_EXTERNAL || LV_USE_THORVG_INTERNAL) case LV_DRAW_TASK_TYPE_VECTOR: lv_draw_sw_vector((lv_draw_unit_t *)u, t->draw_dsc); break; diff --git a/src/draw/sw/lv_draw_sw.h b/src/draw/sw/lv_draw_sw.h index 0f2a2fd4f..d0ef77075 100644 --- a/src/draw/sw/lv_draw_sw.h +++ b/src/draw/sw/lv_draw_sw.h @@ -162,7 +162,7 @@ void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_are int32_t src_w, int32_t src_h, int32_t src_stride, const lv_draw_image_dsc_t * draw_dsc, const lv_draw_image_sup_t * sup, lv_color_format_t cf, void * dest_buf); -#if LV_USE_VECTOR_GRAPHIC +#if LV_USE_VECTOR_GRAPHIC && (LV_USE_THORVG_EXTERNAL || LV_USE_THORVG_INTERNAL) /** * Draw vector graphics with SW render. * @param draw_unit pointer to a draw unit