diff --git a/env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev3.pack b/env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev4.pack similarity index 63% rename from env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev3.pack rename to env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev4.pack index 8c43ff8fb..3325d78a6 100644 Binary files a/env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev3.pack and b/env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev4.pack differ diff --git a/env_support/cmsis-pack/LVGL.lvgl.pdsc b/env_support/cmsis-pack/LVGL.lvgl.pdsc index 912218f4e..77899e141 100644 --- a/env_support/cmsis-pack/LVGL.lvgl.pdsc +++ b/env_support/cmsis-pack/LVGL.lvgl.pdsc @@ -36,10 +36,11 @@ https://github.com/lvgl/lvgl.git - + - LVGL 9.0.0-dev - New Driver Architecture - - Adds Helium support + - Accelerates SW-Render with NEON and Helium technology for Cortex architectures. + - Adds supports for GPUs: VG-Lite, PXP and Dave2D - Other fixes @@ -277,16 +278,6 @@ - - Enable LVGL Arm-2D GPU Support - - - - - - - - Enable LVGL Arm-2D GPU Support @@ -295,6 +286,7 @@ + @@ -305,6 +297,7 @@ + @@ -313,8 +306,9 @@ - + + @@ -322,9 +316,10 @@ - + + @@ -335,6 +330,18 @@ + + + + + Enable LVGL Arm-2D GPU Support + + + + + + + @@ -397,11 +404,10 @@ - - - + + @@ -415,7 +421,7 @@ - + @@ -456,8 +462,6 @@ - - @@ -600,6 +604,8 @@ + + @@ -608,7 +614,7 @@ - + @@ -636,7 +642,100 @@ - + + + + Add the display driver for Linux /dev/dri/card*/ + + + + + +/* use display driver for Linux /dev/dri/card*/ */ +#define LV_USE_LINUX_DRM 1 + + + + + + Add the display driver for Linux /dev/fb + + + + + + +/* use display driver for Linux /dev/fb */ +#define LV_USE_LINUX_FBDEV 1 + + + + + + Add the display driver for TFT_eSPI + + + + + +/* use display driver for TFT_eSPI */ +#define LV_USE_TFT_ESPI 1 + + + + + + Add the display driver for ILI9341 + + + + + +/* use display driver for ILI9341 */ +#define LV_USE_ILI9341 1 + + + + + + Add the display driver for st7735 + + + + + +/* use display driver for st7735 */ +#define LV_USE_ST7735 1 + + + + + + Add the display driver for st7789 + + + + + +/* use display driver for st7789 */ +#define LV_USE_ST7789 1 + + + + + + Add the display driver for st7796 + + + + + +/* use display driver for st7796 */ +#define LV_USE_ST7796 1 + + + + Add the support for pthreads @@ -791,13 +890,34 @@ + + An hardware acceleration from Renesas Dave2D + + + + + + + + + + + + + + + +/*! \brief enable Renesas Dave2D */ +#define LV_USE_DRAW_DAVE2D 1 + + + An hardware acceleration from NXP-PXP - @@ -820,17 +940,16 @@ - + - diff --git a/env_support/cmsis-pack/LVGL.pidx b/env_support/cmsis-pack/LVGL.pidx index cfab4afff..918eda250 100644 --- a/env_support/cmsis-pack/LVGL.pidx +++ b/env_support/cmsis-pack/LVGL.pidx @@ -2,8 +2,8 @@ LVGL https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/ - 2024-01-02 + 2024-01-13 - + diff --git a/env_support/cmsis-pack/README.md b/env_support/cmsis-pack/README.md index 1de0ead6c..a5a0eb983 100644 --- a/env_support/cmsis-pack/README.md +++ b/env_support/cmsis-pack/README.md @@ -89,6 +89,18 @@ remove the misleading guide above this code segment. - LV_USE_IMGFONT + - LV_USE_LINUX_DRM + + - LV_USE_TFT_ESPI + + - LV_USE_ST7735 + + - LV_USE_ST7789 + + - LV_USE_ST7796 + + - LV_USE_ILI9341 + 5. Update `LV_LOG_PRINTF` to `1` and `LV_LOG_LEVEL` to `LV_LOG_LEVEL_USER` diff --git a/env_support/cmsis-pack/lv_conf_cmsis.h b/env_support/cmsis-pack/lv_conf_cmsis.h index 59621573e..f55fbe3d9 100644 --- a/env_support/cmsis-pack/lv_conf_cmsis.h +++ b/env_support/cmsis-pack/lv_conf_cmsis.h @@ -71,6 +71,14 @@ } while(0) #endif +/*================= + * OPERATING SYSTEM + *=================*/ + +#if LV_USE_OS == LV_OS_CUSTOM + #define LV_OS_CUSTOM_INCLUDE +#endif + /*======================== * RENDERING CONFIGURATION *========================*/ @@ -130,13 +138,22 @@ #endif #endif +#if LV_USE_DRAW_VGLITE + /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ + #define LV_USE_VGLITE_BLIT_SPLIT 0 -/*================= - * OPERATING SYSTEM - *=================*/ + #if LV_USE_OS + /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ + #define LV_USE_VGLITE_DRAW_ASYNC 1 + #endif -#if LV_USE_OS == LV_OS_CUSTOM - #define LV_OS_CUSTOM_INCLUDE + /* Enable VGLite asserts. */ + #define LV_USE_VGLITE_ASSERT 0 +#endif + +#if LV_USE_DRAW_PXP + /* Enable PXP asserts. */ + #define LV_USE_PXP_ASSERT 0 #endif /*======================= @@ -330,7 +347,7 @@ #define LV_FONT_MONTSERRAT_18 0 #define LV_FONT_MONTSERRAT_20 0 #define LV_FONT_MONTSERRAT_22 0 -#define LV_FONT_MONTSERRAT_24 0 +#define LV_FONT_MONTSERRAT_24 1 #define LV_FONT_MONTSERRAT_26 0 #define LV_FONT_MONTSERRAT_28 0 #define LV_FONT_MONTSERRAT_30 0 @@ -779,15 +796,11 @@ #endif -/*Driver for /dev/dri/card*/ -#define LV_USE_LINUX_DRM 0 - -/*Interface for TFT_eSPI*/ -#define LV_USE_TFT_ESPI 0 - /*Driver for evdev input devices*/ #define LV_USE_EVDEV 0 +#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) + /*================== * EXAMPLES *==================*/ diff --git a/src/draw/sw/blend/helium/lv_blend_helium.h b/src/draw/sw/blend/helium/lv_blend_helium.h index 73b3d871f..32fe8192d 100644 --- a/src/draw/sw/blend/helium/lv_blend_helium.h +++ b/src/draw/sw/blend/helium/lv_blend_helium.h @@ -16,7 +16,11 @@ extern "C" { #include "../../../../lv_conf_internal.h" -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM && !defined(__ASSEMBLY__) && LV_USE_DRAW_ARM2D +#ifdef LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE +#include LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE +#endif + +#if LV_USE_DRAW_ARM2D #define __ARM_2D_IMPL__ #include "arm_2d.h" @@ -33,149 +37,245 @@ extern "C" { * DEFINES *********************/ +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565 #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc) \ _lv_color_blend_to_rgb565_helium(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc) \ _lv_color_blend_to_rgb565_with_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc) \ _lv_color_blend_to_rgb565_with_mask_helium(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc) \ _lv_color_blend_to_rgb565_mix_mask_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc) \ _lv_rgb565_blend_normal_to_rgb565_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ _lv_rgb565_blend_normal_to_rgb565_with_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ _lv_rgb565_blend_normal_to_rgb565_with_mask_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ _lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_with_opa_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_with_mask_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc) \ _lv_argb8888_blend_normal_to_rgb565_helium(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ _lv_argb8888_blend_normal_to_rgb565_with_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ _lv_argb8888_blend_normal_to_rgb565_with_mask_helium(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ _lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888 #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_with_opa_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_with_mask_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_with_opa_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_with_mask_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_helium(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_with_opa_helium(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_with_mask_helium(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_with_opa_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_with_mask_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_helium(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888 #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(dsc) \ _lv_color_blend_to_argb8888_helium(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(dsc) \ _lv_color_blend_to_argb8888_with_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(dsc) \ _lv_color_blend_to_argb8888_with_mask_helium(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(dsc) \ _lv_color_blend_to_argb8888_mix_mask_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc) \ _lv_rgb565_blend_normal_to_argb8888_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ _lv_rgb565_blend_normal_to_argb8888_with_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ _lv_rgb565_blend_normal_to_argb8888_with_mask_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ _lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_with_opa_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_with_mask_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_helium(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(dsc) \ _lv_argb8888_blend_normal_to_argb8888_helium(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ _lv_argb8888_blend_normal_to_argb8888_with_opa_helium(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ _lv_argb8888_blend_normal_to_argb8888_with_mask_helium(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_helium(dsc) +#endif /********************** * TYPEDEFS @@ -1336,7 +1436,7 @@ static inline lv_result_t _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_hel * MACROS **********************/ -#endif /*LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM && !defined(__ASSEMBLY__)*/ +#endif /* LV_USE_DRAW_ARM2D */ #ifdef __cplusplus } /*extern "C"*/ diff --git a/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c b/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c index 6d3cb5325..19a7848ef 100644 --- a/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c +++ b/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c @@ -67,22 +67,67 @@ LV_ATTRIBUTE_FAST_MEM static inline void * drawbuf_next_row(const void * buf, ui * MACROS **********************/ -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NONE +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888 #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID #endif diff --git a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c index 587680949..9922d5e19 100644 --- a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c +++ b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c @@ -54,22 +54,67 @@ LV_ATTRIBUTE_FAST_MEM static inline void * drawbuf_next_row(const void * buf, ui * MACROS **********************/ -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NONE +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565 #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID #endif diff --git a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c index a2b0aac13..7a9ad44d3 100644 --- a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c +++ b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c @@ -56,22 +56,67 @@ LV_ATTRIBUTE_FAST_MEM static inline void * drawbuf_next_row(const void * buf, ui * MACROS **********************/ -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NONE +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888 #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID #endif diff --git a/src/draw/sw/blend/neon/lv_blend_neon.h b/src/draw/sw/blend/neon/lv_blend_neon.h index 5719342d2..fe284ee4a 100644 --- a/src/draw/sw/blend/neon/lv_blend_neon.h +++ b/src/draw/sw/blend/neon/lv_blend_neon.h @@ -16,155 +16,254 @@ extern "C" { #include "../../../../lv_conf_internal.h" -#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON && !defined(__ASSEMBLY__) +#ifdef LV_DRAW_SW_NEON_CUSTOM_INCLUDE +#include LV_DRAW_SW_NEON_CUSTOM_INCLUDE +#endif /********************* * DEFINES *********************/ +#if !defined(__ASSEMBLY__) +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565 #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc) \ _lv_color_blend_to_rgb565_neon(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc) \ _lv_color_blend_to_rgb565_with_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc) \ _lv_color_blend_to_rgb565_with_mask_neon(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc) \ _lv_color_blend_to_rgb565_mix_mask_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc) \ _lv_rgb565_blend_normal_to_rgb565_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ _lv_rgb565_blend_normal_to_rgb565_with_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ _lv_rgb565_blend_normal_to_rgb565_with_mask_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ _lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_with_opa_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_with_mask_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc) \ _lv_argb8888_blend_normal_to_rgb565_neon(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc) \ _lv_argb8888_blend_normal_to_rgb565_with_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc) \ _lv_argb8888_blend_normal_to_rgb565_with_mask_neon(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc) \ _lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888 #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_with_opa_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_with_mask_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ _lv_color_blend_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_with_opa_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_with_mask_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ _lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_neon(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_with_opa_neon(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_with_mask_neon(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size, src_px_size) \ _lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size, src_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_with_opa_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_with_mask_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dst_px_size) \ _lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(dsc, dst_px_size) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888 #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(dsc) \ _lv_color_blend_to_argb8888_neon(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(dsc) \ _lv_color_blend_to_argb8888_with_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(dsc) \ _lv_color_blend_to_argb8888_with_mask_neon(dsc) +#endif +#ifndef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(dsc) \ _lv_color_blend_to_argb8888_mix_mask_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc) \ _lv_rgb565_blend_normal_to_argb8888_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ _lv_rgb565_blend_normal_to_argb8888_with_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ _lv_rgb565_blend_normal_to_argb8888_with_mask_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ _lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_with_opa_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_with_mask_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc, src_px_size) \ _lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(dsc, src_px_size) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888 #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(dsc) \ _lv_argb8888_blend_normal_to_argb8888_neon(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc) \ _lv_argb8888_blend_normal_to_argb8888_with_opa_neon(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc) \ _lv_argb8888_blend_normal_to_argb8888_with_mask_neon(dsc) +#endif +#ifndef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA #define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc) \ _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(dsc) +#endif /********************** * TYPEDEFS @@ -1183,12 +1282,12 @@ static inline lv_result_t _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neo return LV_RESULT_OK; } +#endif /* !defined(__ASSEMBLY__) */ + /********************** * MACROS **********************/ -#endif /*LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON && !defined(__ASSEMBLY__)*/ - #ifdef __cplusplus } /*extern "C"*/ #endif diff --git a/src/draw/sw/helium/lv_draw_sw_helium.h b/src/draw/sw/helium/lv_draw_sw_helium.h new file mode 100644 index 000000000..aa6361ebf --- /dev/null +++ b/src/draw/sw/helium/lv_draw_sw_helium.h @@ -0,0 +1,568 @@ +/** + * @file lv_draw_sw_helium.h + * + */ + +#ifndef LV_DRAW_SW_HELIUM_H +#define LV_DRAW_SW_HELIUM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* *INDENT-OFF* */ + +/********************* + * INCLUDES + *********************/ + +#include "../../../lv_conf_internal.h" + +#ifdef LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE +#include LV_DRAW_SW_HELIUM_CUSTOM_INCLUDE +#endif + +#if LV_USE_DRAW_ARM2D + +#define __ARM_2D_IMPL__ +#include "arm_2d.h" +#include "__arm_2d_impl.h" + +#if defined(__IS_COMPILER_ARM_COMPILER_5__) +#pragma diag_suppress 174,177,188,68,513,144,1296 +#elif defined(__IS_COMPILER_IAR__) +#pragma diag_suppress=Pa093 +#elif defined(__IS_COMPILER_GCC__) +#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" +#endif + +/********************* + * DEFINES + *********************/ +#ifndef LV_DRAW_SW_RGB565_SWAP + #define LV_DRAW_SW_RGB565_SWAP(__buf_ptr, __buf_size_px) \ + _lv_draw_sw_rgb565_swap_helium((__buf_ptr), (__buf_size_px)) +#endif + +#ifndef LV_DRAW_SW_IMAGE + #define LV_DRAW_SW_IMAGE(__transformed, \ + __cf, \ + __src_buf, \ + __img_coords, \ + __src_stride, \ + __blend_area, \ + __draw_unit, \ + __draw_dsc) \ + _lv_draw_sw_image_helium( (__transformed), \ + (__cf), \ + (uint8_t *)(__src_buf), \ + (__img_coords), \ + (__src_stride), \ + (__blend_area), \ + (__draw_unit), \ + (__draw_dsc)) +#endif + +#ifndef LV_DRAW_SW_RGB565_RECOLOR + #define LV_DRAW_SW_RGB565_RECOLOR(__src_buf, __blend_area, __color, __opa) \ + _lv_draw_sw_image_recolor_rgb565( (__src_buf), \ + &(__blend_area), \ + (__color), \ + (__opa)) +#endif + +#ifndef LV_DRAW_SW_RGB888_RECOLOR + #define LV_DRAW_SW_RGB888_RECOLOR( __src_buf, \ + __blend_area, \ + __color, \ + __opa, \ + __cf) \ + _lv_draw_sw_image_recolor_rgb888( (__src_buf), \ + &(__blend_area), \ + (__color), \ + (__opa), \ + (__cf)) +#endif + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ +extern void arm_2d_helper_swap_rgb16(uint16_t * phwBuffer, uint32_t wCount); + +/********************** + * MACROS + **********************/ + +#define __RECOLOUR_BEGIN() \ + do { \ + lv_color_t *rgb_tmp_buf = NULL; \ + if(draw_dsc->recolor_opa > LV_OPA_MIN) { \ + if(LV_COLOR_FORMAT_RGB565 == des_cf) { \ + rgb_tmp_buf \ + = lv_malloc(src_w * src_h * sizeof(uint16_t)); \ + if (NULL == rgb_tmp_buf) { \ + LV_LOG_WARN( \ + "Failed to allocate memory for accelerating recolor, " \ + "use normal route instead."); \ + break; \ + } \ + lv_memcpy( rgb_tmp_buf, \ + src_buf, \ + src_w * src_h * sizeof(uint16_t)); \ + arm_2d_size_t copy_size = { \ + .iWidth = src_w, \ + .iHeight = src_h, \ + }; \ + /* apply re-color */ \ + __arm_2d_impl_rgb565_colour_filling_with_opacity( \ + (uint16_t *)rgb_tmp_buf, \ + src_w, \ + ©_size, \ + lv_color_to_u16(draw_dsc->recolor), \ + draw_dsc->recolor_opa); \ + \ + /* replace src_buf for the following operation */ \ + src_buf = (const uint8_t *)rgb_tmp_buf; \ + } \ + else if(LV_COLOR_FORMAT_XRGB8888 == des_cf) { \ + rgb_tmp_buf \ + = lv_malloc(src_w * src_h * sizeof(uint32_t)); \ + if (NULL == rgb_tmp_buf) { \ + LV_LOG_WARN( \ + "Failed to allocate memory for accelerating recolor, " \ + "use normal route instead."); \ + break; \ + } \ + lv_memcpy( rgb_tmp_buf, \ + src_buf, \ + src_w * src_h * sizeof(uint32_t)); \ + arm_2d_size_t copy_size = { \ + .iWidth = src_w, \ + .iHeight = src_h, \ + }; \ + /* apply re-color */ \ + __arm_2d_impl_cccn888_colour_filling_with_opacity( \ + (uint32_t *)rgb_tmp_buf, \ + src_w, \ + ©_size, \ + lv_color_to_u32(draw_dsc->recolor), \ + 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_free(rgb_tmp_buf); \ + } \ + } while(0); + +static inline lv_result_t _lv_draw_sw_rgb565_swap_helium(void * buf, uint32_t buf_size_px) +{ + arm_2d_helper_swap_rgb16((uint16_t *)buf, buf_size_px); + return LV_RESULT_OK; +} + +static inline lv_result_t _lv_draw_sw_image_helium( + bool is_transform, + lv_color_format_t src_cf, + const uint8_t *src_buf, + const lv_area_t * coords, + int32_t src_stride, + const lv_area_t * des_area, + lv_draw_unit_t * draw_unit, + const lv_draw_image_dsc_t * draw_dsc) +{ + lv_result_t result = LV_RESULT_INVALID; + lv_layer_t * layer = draw_unit->target_layer; + lv_color_format_t des_cf = layer->color_format; + static bool arm_2d_initialized = false; + + if (!arm_2d_initialized) { + arm_2d_initialized = true; + arm_2d_init(); + } + + do { + if (!is_transform) { + break; + } + if(draw_dsc->scale_x != draw_dsc->scale_y) { + break; + } + /* filter the unsupported colour format combination */ + if((LV_COLOR_FORMAT_RGB565 == des_cf) + && !( (LV_COLOR_FORMAT_RGB565 == src_cf) + || (LV_COLOR_FORMAT_RGB565A8 == src_cf))) { + break; + } + if((LV_COLOR_FORMAT_XRGB8888 == des_cf) + && !( (LV_COLOR_FORMAT_ARGB8888 == src_cf) + || (LV_COLOR_FORMAT_XRGB8888 == src_cf))) { + break; + } + + /* ------------- prepare parameters for arm-2d APIs - BEGIN --------- */ + + lv_area_t blend_area; + if(!_lv_area_intersect(&blend_area, des_area, draw_unit->clip_area)) { + break; + } + + int32_t src_w = lv_area_get_width(coords); + int32_t src_h = lv_area_get_height(coords); + + arm_2d_size_t src_size = { + .iWidth = (int16_t)src_w, + .iHeight = (int16_t)src_h, + }; + +// arm_2d_size_t des_size; + +// do{ +// int32_t des_w = lv_area_get_width(&blend_area); +// int32_t des_h = lv_area_get_height(&blend_area); + +// LV_ASSERT(des_w <= INT16_MAX); +// LV_ASSERT(des_h <= INT16_MAX); + +// des_size.iWidth = (int16_t)des_w; +// des_size.iHeight = (int16_t)des_h; +// } while(0); +// +// arm_2d_size_t copy_size = { +// .iWidth = MIN(des_size.iWidth, src_size.iWidth), +// .iHeight = MIN(des_size.iHeight, src_size.iHeight), +// }; +// +// int32_t des_stride = lv_draw_buf_width_to_stride( +// lv_area_get_width(&layer->buf_area), +// des_cf); +// uint8_t *des_buf_moved = (uint8_t *)lv_draw_layer_go_to_xy( +// layer, +// blend_area.x1 - layer->buf_area.x1, +// blend_area.y1 - layer->buf_area.y1); + uint8_t *des_buf = (uint8_t *)layer->buf; + uint8_t opa = draw_dsc->opa; + + /* ------------- prepare parameters for arm-2d APIs - END ----------- */ + __RECOLOUR_BEGIN() + + static arm_2d_tile_t target_tile_origin; + static arm_2d_tile_t target_tile; + arm_2d_region_t clip_region; + static arm_2d_region_t target_region; + + target_region = (arm_2d_region_t) { + .tLocation = { + .iX = (int16_t)(coords->x1 - draw_unit->clip_area->x1), + .iY = (int16_t)(coords->y1 - draw_unit->clip_area->y1), + }, + .tSize = src_size, + }; + + target_tile_origin = (arm_2d_tile_t) { + .tRegion = { + .tSize = { + .iWidth = (int16_t)lv_area_get_width(&layer->buf_area), + .iHeight = (int16_t)lv_area_get_height(&layer->buf_area), + }, + }, + .tInfo = { + .bIsRoot = true, + }, + .phwBuffer = (uint16_t *)des_buf, + }; + + clip_region = (arm_2d_region_t) { + .tLocation = { + .iX = (int16_t)(draw_unit->clip_area->x1 - layer->buf_area.x1), + .iY = (int16_t)(draw_unit->clip_area->y1 - layer->buf_area.y1), + }, + .tSize = { + .iWidth = (int16_t)lv_area_get_width(draw_unit->clip_area), + .iHeight = (int16_t)lv_area_get_height(draw_unit->clip_area), + }, + }; + + arm_2d_tile_generate_child(&target_tile_origin, + &clip_region, + &target_tile, + false); + + static arm_2d_tile_t source_tile; + + source_tile = (arm_2d_tile_t) { + .tRegion = { + .tSize = { + .iWidth = (int16_t)src_w, + .iHeight = (int16_t)src_h, + }, + }, + .tInfo = { + .bIsRoot = true, + }, + .pchBuffer = (uint8_t *)src_buf, + }; + + static arm_2d_location_t source_center, target_center; + source_center.iX = draw_dsc->pivot.x; + source_center.iY = draw_dsc->pivot.y; + target_center = target_region.tLocation; + target_center.iX += draw_dsc->pivot.x; + target_center.iY += draw_dsc->pivot.y; + + if(LV_COLOR_FORMAT_A8 == src_cf) { + + source_tile.tInfo.bHasEnforcedColour = true; + source_tile.tInfo.tColourInfo.chScheme = ARM_2D_COLOUR_GRAY8; + + if(LV_COLOR_FORMAT_RGB565 == des_cf) { + + arm_2d_rgb565_fill_colour_with_mask_opacity_and_transform( + &source_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + lv_color_to_u16(draw_dsc->recolor), + opa, + &target_center + ); + + } + else if(LV_COLOR_FORMAT_XRGB8888 == des_cf) { + arm_2d_cccn888_fill_colour_with_mask_opacity_and_transform( + &source_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + lv_color_to_int(draw_dsc->recolor), + opa, + &target_center + ); + } + else { + break; + } + + } + else if(LV_COLOR_FORMAT_RGB565A8 == src_cf) { + LV_ASSERT(LV_COLOR_FORMAT_RGB565 == des_cf); + + /* mask_buf = src_buf + src_stride * src_w / header->w * src_h; */ + const uint8_t *mask_buf = src_buf + src_stride * src_h; + int32_t mask_stride = src_stride / 2; + + 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 = (uint8_t *)mask_buf; + + if(opa >= LV_OPA_MAX) { + arm_2d_rgb565_tile_transform_with_src_mask( + &source_tile, + &mask_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + &target_center + ); + } + else { + arm_2d_rgb565_tile_transform_with_src_mask_and_opacity( + &source_tile, + &mask_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + opa, + &target_center + ); + } + + } + else if(LV_COLOR_FORMAT_RGB565 == src_cf) { + LV_ASSERT(LV_COLOR_FORMAT_RGB565 == des_cf); + + if(opa >= LV_OPA_MAX) { + arm_2d_rgb565_tile_transform_only( + &source_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + &target_center + ); + } + else { + arm_2d_rgb565_tile_transform_only_with_opacity( + &source_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + opa, + &target_center + ); + } + + } + else if(LV_COLOR_FORMAT_ARGB8888 == src_cf) { + LV_ASSERT(LV_COLOR_FORMAT_XRGB8888 == des_cf); + + 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 = (uint8_t *)src_buf + 3; + + if(opa >= LV_OPA_MAX) { + arm_2d_cccn888_tile_transform_with_src_mask( + &source_tile, + &mask_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + &target_center + ); + } + else { + arm_2d_cccn888_tile_transform_with_src_mask_and_opacity( + &source_tile, + &mask_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + opa, + &target_center + ); + } + + } + else if(LV_COLOR_FORMAT_XRGB8888 == src_cf) { + LV_ASSERT(LV_COLOR_FORMAT_XRGB8888 == des_cf); + + if(opa >= LV_OPA_MAX) { + arm_2d_cccn888_tile_transform_only( + &source_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + &target_center + ); + } + else { + arm_2d_cccn888_tile_transform_only_with_opacity( + &source_tile, + &target_tile, + NULL, + source_center, + ARM_2D_ANGLE((draw_dsc->rotation / 10.0f)), + draw_dsc->scale_x / 256.0f, + opa, + &target_center + ); + } + + } + else { + break; + } + + result = LV_RESULT_OK; + + __RECOLOUR_END() + } while(0); + + return result; +} + +static inline lv_result_t _lv_draw_sw_image_recolor_rgb565( + const uint8_t *src_buf, + const lv_area_t * blend_area, + lv_color_t color, + lv_opa_t opa) +{ + int32_t src_w = lv_area_get_width(blend_area); + int32_t src_h = lv_area_get_height(blend_area); + + arm_2d_size_t copy_size = { + .iWidth = (int16_t)src_w, + .iHeight = (int16_t)src_h, + }; + + __arm_2d_impl_rgb565_colour_filling_with_opacity( + (uint16_t *)src_buf, + src_w, + ©_size, + lv_color_to_u16(color), + opa); + + return LV_RESULT_OK; +} + +static inline lv_result_t _lv_draw_sw_image_recolor_rgb888( + const uint8_t *src_buf, + const lv_area_t * blend_area, + lv_color_t color, + lv_opa_t opa, + lv_color_format_t src_cf) +{ + if(LV_COLOR_FORMAT_XRGB8888 != src_cf) { + return LV_RESULT_INVALID; + } + + int32_t src_w = lv_area_get_width(blend_area); + int32_t src_h = lv_area_get_height(blend_area); + + arm_2d_size_t copy_size = { + .iWidth = (int16_t)src_w, + .iHeight = (int16_t)src_h, + }; + + __arm_2d_impl_cccn888_colour_filling_with_opacity( + (uint32_t *)src_buf, + src_w, + ©_size, + lv_color_to_u32(color), + opa); + + return LV_RESULT_OK; +} + +#endif /* LV_USE_DRAW_ARM2D */ + +/* *INDENT-ON* */ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_DRAW_SW_HELIUM_H*/ diff --git a/src/draw/sw/lv_draw_sw.c b/src/draw/sw/lv_draw_sw.c index 2d1df5384..c9d79c36f 100644 --- a/src/draw/sw/lv_draw_sw.c +++ b/src/draw/sw/lv_draw_sw.c @@ -22,11 +22,58 @@ #include "../../libs/thorvg/thorvg_capi.h" #endif #endif + +#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM + #include "helium/lv_draw_sw_helium.h" +#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM + #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE +#endif + /********************* * DEFINES *********************/ #define DRAW_UNIT_ID_SW 1 +#ifndef LV_DRAW_SW_RGB565_SWAP + #define LV_DRAW_SW_RGB565_SWAP(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE90_ARGB8888 + #define LV_DRAW_SW_ROTATE90_ARGB8888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE180_ARGB8888 + #define LV_DRAW_SW_ROTATE180_ARGB8888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE270_ARGB8888 + #define LV_DRAW_SW_ROTATE270_ARGB8888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE90_RGB888 + #define LV_DRAW_SW_ROTATE90_RGB888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE180_RGB888 + #define LV_DRAW_SW_ROTATE180_RGB888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE270_RGB888 + #define LV_DRAW_SW_ROTATE270_RGB888(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE90_RGB565 + #define LV_DRAW_SW_ROTATE90_RGB565(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE180_RGB565 + #define LV_DRAW_SW_ROTATE180_RGB565(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_ROTATE270_RGB565 + #define LV_DRAW_SW_ROTATE270_RGB565(...) LV_RESULT_INVALID +#endif + /********************** * TYPEDEFS **********************/ @@ -137,6 +184,8 @@ static int32_t lv_draw_sw_delete(lv_draw_unit_t * draw_unit) void lv_draw_sw_rgb565_swap(void * buf, uint32_t buf_size_px) { + if(LV_DRAW_SW_RGB565_SWAP(buf, buf_size_px) == LV_RESULT_OK) return; + uint32_t u32_cnt = buf_size_px / 2; uint16_t * buf16 = buf; uint32_t * buf32 = buf; @@ -164,6 +213,7 @@ void lv_draw_sw_rgb565_swap(void * buf, uint32_t buf_size_px) uint32_t e = buf_size_px - 1; buf16[e] = ((buf16[e] & 0xff00) >> 8) | ((buf16[e] & 0x00ff) << 8); } + } void lv_draw_sw_rotate(const void * src, void * dest, int32_t src_width, int32_t src_height, int32_t src_sride, @@ -392,6 +442,10 @@ static void rotate90_argb8888(const uint32_t * src, uint32_t * dst, int32_t srcW int32_t srcStride, int32_t dstStride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE90_ARGB8888(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + srcStride /= sizeof(uint32_t); dstStride /= sizeof(uint32_t); @@ -408,6 +462,10 @@ static void rotate90_argb8888(const uint32_t * src, uint32_t * dst, int32_t srcW static void rotate180_argb8888(const uint32_t * src, uint32_t * dst, int32_t width, int32_t height, int32_t src_stride, int32_t dest_stride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE180_ARGB8888(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + src_stride /= sizeof(uint32_t); dest_stride /= sizeof(uint32_t); @@ -424,6 +482,10 @@ static void rotate270_argb8888(const uint32_t * src, uint32_t * dst, int32_t src int32_t srcStride, int32_t dstStride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE270_ARGB8888(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + srcStride /= sizeof(uint32_t); dstStride /= sizeof(uint32_t); @@ -440,6 +502,10 @@ static void rotate270_argb8888(const uint32_t * src, uint32_t * dst, int32_t src static void rotate90_rgb888(const uint8_t * src, uint8_t * dst, int32_t srcWidth, int32_t srcHeight, int32_t srcStride, int32_t dstStride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE90_RGB888(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + for(int32_t x = 0; x < srcWidth; ++x) { for(int32_t y = 0; y < srcHeight; ++y) { int32_t srcIndex = y * srcStride + x * 3; @@ -454,6 +520,9 @@ static void rotate90_rgb888(const uint8_t * src, uint8_t * dst, int32_t srcWidth static void rotate180_rgb888(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t src_stride, int32_t dest_stride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE180_RGB888(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } for(int32_t y = 0; y < height; ++y) { for(int32_t x = 0; x < width; ++x) { @@ -469,6 +538,10 @@ static void rotate180_rgb888(const uint8_t * src, uint8_t * dst, int32_t width, static void rotate270_rgb888(const uint8_t * src, uint8_t * dst, int32_t width, int32_t height, int32_t srcStride, int32_t dstStride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE270_RGB888(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + for(int32_t x = 0; x < width; ++x) { for(int32_t y = 0; y < height; ++y) { int32_t srcIndex = y * srcStride + x * 3; @@ -484,6 +557,10 @@ static void rotate90_rgb565(const uint16_t * src, uint16_t * dst, int32_t srcWid int32_t srcStride, int32_t dstStride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE90_RGB565(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + srcStride /= sizeof(uint16_t); dstStride /= sizeof(uint16_t); @@ -500,6 +577,10 @@ static void rotate90_rgb565(const uint16_t * src, uint16_t * dst, int32_t srcWid static void rotate180_rgb565(const uint16_t * src, uint16_t * dst, int32_t width, int32_t height, int32_t src_stride, int32_t dest_stride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE180_RGB565(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + src_stride /= sizeof(uint16_t); dest_stride /= sizeof(uint16_t); @@ -516,6 +597,10 @@ static void rotate270_rgb565(const uint16_t * src, uint16_t * dst, int32_t srcWi int32_t srcStride, int32_t dstStride) { + if(LV_RESULT_OK == LV_DRAW_SW_ROTATE270_RGB565(src, dst, srcWidth, srcHeight, srcStride, dstStride)) { + return ; + } + srcStride /= sizeof(uint16_t); dstStride /= sizeof(uint16_t); diff --git a/src/draw/sw/lv_draw_sw_img.c b/src/draw/sw/lv_draw_sw_img.c index ae46abcde..06c8b46f0 100644 --- a/src/draw/sw/lv_draw_sw_img.c +++ b/src/draw/sw/lv_draw_sw_img.c @@ -19,11 +19,29 @@ #include "../../stdlib/lv_string.h" #include "../../core/lv_global.h" +#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM + #include "helium/lv_draw_sw_helium.h" +#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM + #include LV_DRAW_SW_ASM_CUSTOM_INCLUDE +#endif + /********************* * DEFINES *********************/ #define MAX_BUF_SIZE (uint32_t) (4 * lv_display_get_horizontal_resolution(_lv_refr_get_disp_refreshing()) * lv_color_format_get_size(lv_display_get_color_format(_lv_refr_get_disp_refreshing()))) +#ifndef LV_DRAW_SW_IMAGE + #define LV_DRAW_SW_IMAGE(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB565_RECOLOR + #define LV_DRAW_SW_RGB565_RECOLOR(...) LV_RESULT_INVALID +#endif + +#ifndef LV_DRAW_SW_RGB888_RECOLOR + #define LV_DRAW_SW_RGB888_RECOLOR(...) LV_RESULT_INVALID +#endif + /********************** * TYPEDEFS **********************/ @@ -225,8 +243,17 @@ static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t blend_dsc.src_color_format = cf; lv_draw_sw_blend(draw_unit, &blend_dsc); } - /*In the other cases every pixel need to be checked one-by-one*/ - else { + /* check whethr it is possible to accelerate the operation in synchronouse mode */ + else if(LV_RESULT_INVALID == LV_DRAW_SW_IMAGE(transformed, /* whether require transform */ + cf, /* image format */ + src_buf, /* image buffer */ + img_coords, /* src_h, src_w, src_x1, src_y1 */ + img_stride, /* image stride */ + clipped_img_area, /* blend area */ + draw_unit, /* target buffer, buffer width, buffer height, buffer stride */ + draw_dsc)) { /* opa, recolour_opa and colour */ + /*In the other cases every pixel need to be checked one-by-one*/ + lv_area_t blend_area = *clipped_img_area; blend_dsc.blend_area = &blend_area; @@ -240,6 +267,7 @@ static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t if(cf == LV_COLOR_FORMAT_RGB888 || cf == LV_COLOR_FORMAT_XRGB8888) cf_final = LV_COLOR_FORMAT_ARGB8888; else if(cf == LV_COLOR_FORMAT_RGB565) cf_final = LV_COLOR_FORMAT_RGB565A8; } + uint8_t * tmp_buf; uint32_t px_size = lv_color_format_get_size(cf_final); int32_t buf_h; @@ -255,6 +283,7 @@ static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t if(buf_h > blend_h) buf_h = blend_h; tmp_buf = lv_malloc(buf_stride * buf_h); } + LV_ASSERT_MALLOC(tmp_buf); blend_dsc.src_buf = tmp_buf; blend_dsc.src_color_format = cf_final; @@ -330,31 +359,35 @@ static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t lv_opa_t mix = draw_dsc->recolor_opa; lv_opa_t mix_inv = 255 - mix; if(cf_final == LV_COLOR_FORMAT_RGB565A8 || cf_final == LV_COLOR_FORMAT_RGB565) { - uint16_t c_mult[3]; - c_mult[0] = (color.blue >> 3) * mix; - c_mult[1] = (color.green >> 2) * mix; - c_mult[2] = (color.red >> 3) * mix; - uint16_t * buf16 = (uint16_t *)tmp_buf; - int32_t i; - int32_t size = lv_area_get_size(&blend_area); - for(i = 0; i < size; i++) { - buf16[i] = (((c_mult[2] + ((buf16[i] >> 11) & 0x1F) * mix_inv) << 3) & 0xF800) + - (((c_mult[1] + ((buf16[i] >> 5) & 0x3F) * mix_inv) >> 3) & 0x07E0) + - ((c_mult[0] + (buf16[i] & 0x1F) * mix_inv) >> 8); + if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_RECOLOR(tmp_buf, blend_area, color, mix)) { + uint16_t c_mult[3]; + c_mult[0] = (color.blue >> 3) * mix; + c_mult[1] = (color.green >> 2) * mix; + c_mult[2] = (color.red >> 3) * mix; + uint16_t * buf16 = (uint16_t *)tmp_buf; + int32_t i; + int32_t size = lv_area_get_size(&blend_area); + for(i = 0; i < size; i++) { + buf16[i] = (((c_mult[2] + ((buf16[i] >> 11) & 0x1F) * mix_inv) << 3) & 0xF800) + + (((c_mult[1] + ((buf16[i] >> 5) & 0x3F) * mix_inv) >> 3) & 0x07E0) + + ((c_mult[0] + (buf16[i] & 0x1F) * mix_inv) >> 8); + } } } else if(cf_final != LV_COLOR_FORMAT_A8) { - uint32_t size = lv_area_get_size(&blend_area); - uint32_t i; - uint16_t c_mult[3]; - c_mult[0] = color.blue * mix; - c_mult[1] = color.green * mix; - c_mult[2] = color.red * mix; - uint8_t * tmp_buf_2 = tmp_buf; - for(i = 0; i < size * px_size; i += px_size) { - tmp_buf_2[i + 0] = (c_mult[0] + (tmp_buf_2[i + 0] * mix_inv)) >> 8; - tmp_buf_2[i + 1] = (c_mult[1] + (tmp_buf_2[i + 1] * mix_inv)) >> 8; - tmp_buf_2[i + 2] = (c_mult[2] + (tmp_buf_2[i + 2] * mix_inv)) >> 8; + if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_RECOLOR(tmp_buf, blend_area, color, mix, cf_final)) { + uint32_t size = lv_area_get_size(&blend_area); + uint32_t i; + uint16_t c_mult[3]; + c_mult[0] = color.blue * mix; + c_mult[1] = color.green * mix; + c_mult[2] = color.red * mix; + uint8_t * tmp_buf_2 = tmp_buf; + for(i = 0; i < size * px_size; i += px_size) { + tmp_buf_2[i + 0] = (c_mult[0] + (tmp_buf_2[i + 0] * mix_inv)) >> 8; + tmp_buf_2[i + 1] = (c_mult[1] + (tmp_buf_2[i + 1] * mix_inv)) >> 8; + tmp_buf_2[i + 2] = (c_mult[2] + (tmp_buf_2[i + 2] * mix_inv)) >> 8; + } } } }