@@ -18,6 +18,8 @@ extern "C" {
1818#warning "esp_lvgl_port_lv_blend.h included, but CONFIG_LV_DRAW_SW_ASM_CUSTOM not set. Assembly rendering not used"
1919#else
2020
21+ #include "lv_version.h"
22+
2123/*********************
2224 * DEFINES
2325 *********************/
@@ -53,31 +55,92 @@ typedef struct {
5355 * GLOBAL PROTOTYPES
5456 **********************/
5557
58+ #if ((LVGL_VERSION_MAJOR == 9 ) && (LVGL_VERSION_MINOR == 1 ))
59+
60+ typedef struct {
61+ void * dest_buf ;
62+ int32_t dest_w ;
63+ int32_t dest_h ;
64+ int32_t dest_stride ;
65+ const lv_opa_t * mask_buf ;
66+ int32_t mask_stride ;
67+ lv_color_t color ;
68+ lv_opa_t opa ;
69+ } bsp_blend_fill_dsc_t ;
70+
71+ typedef struct {
72+ void * dest_buf ;
73+ int32_t dest_w ;
74+ int32_t dest_h ;
75+ int32_t dest_stride ;
76+ const lv_opa_t * mask_buf ;
77+ int32_t mask_stride ;
78+ const void * src_buf ;
79+ int32_t src_stride ;
80+ lv_color_format_t src_color_format ;
81+ lv_opa_t opa ;
82+ lv_blend_mode_t blend_mode ;
83+ } bsp_blend_image_dsc_t ;
84+
85+ #elif ((LVGL_VERSION_MAJOR == 9 ) && (LVGL_VERSION_MINOR == 2 ))
86+
87+ typedef struct {
88+ void * dest_buf ;
89+ int32_t dest_w ;
90+ int32_t dest_h ;
91+ int32_t dest_stride ;
92+ const lv_opa_t * mask_buf ;
93+ int32_t mask_stride ;
94+ lv_color_t color ;
95+ lv_opa_t opa ;
96+ lv_area_t relative_area ;
97+ } bsp_blend_fill_dsc_t ;
98+
99+ typedef struct {
100+ void * dest_buf ;
101+ int32_t dest_w ;
102+ int32_t dest_h ;
103+ int32_t dest_stride ;
104+ const lv_opa_t * mask_buf ;
105+ int32_t mask_stride ;
106+ const void * src_buf ;
107+ int32_t src_stride ;
108+ lv_color_format_t src_color_format ;
109+ lv_opa_t opa ;
110+ lv_blend_mode_t blend_mode ;
111+ lv_area_t relative_area ; /**< The blend area relative to the layer's buffer area. */
112+ lv_area_t src_area ; /**< The original src area. */
113+ } bsp_blend_image_dsc_t ;
114+
115+ #endif
116+
56117extern int lv_color_blend_to_argb8888_esp (asm_dsc_t * asm_dsc );
57118
58- static inline lv_result_t _lv_color_blend_to_argb8888_esp (_lv_draw_sw_blend_fill_dsc_t * dsc )
119+ static inline lv_result_t _lv_color_blend_to_argb8888_esp (void * dsc )
59120{
121+ bsp_blend_fill_dsc_t * fill_dsc = (bsp_blend_fill_dsc_t * ) dsc ;
60122 asm_dsc_t asm_dsc = {
61- .dst_buf = dsc -> dest_buf ,
62- .dst_w = dsc -> dest_w ,
63- .dst_h = dsc -> dest_h ,
64- .dst_stride = dsc -> dest_stride ,
65- .src_buf = & dsc -> color ,
123+ .dst_buf = fill_dsc -> dest_buf ,
124+ .dst_w = fill_dsc -> dest_w ,
125+ .dst_h = fill_dsc -> dest_h ,
126+ .dst_stride = fill_dsc -> dest_stride ,
127+ .src_buf = & fill_dsc -> color ,
66128 };
67129
68130 return lv_color_blend_to_argb8888_esp (& asm_dsc );
69131}
70132
71133extern int lv_color_blend_to_rgb565_esp (asm_dsc_t * asm_dsc );
72134
73- static inline lv_result_t _lv_color_blend_to_rgb565_esp (_lv_draw_sw_blend_fill_dsc_t * dsc )
135+ static inline lv_result_t _lv_color_blend_to_rgb565_esp (void * dsc )
74136{
137+ bsp_blend_fill_dsc_t * fill_dsc = (bsp_blend_fill_dsc_t * ) dsc ;
75138 asm_dsc_t asm_dsc = {
76- .dst_buf = dsc -> dest_buf ,
77- .dst_w = dsc -> dest_w ,
78- .dst_h = dsc -> dest_h ,
79- .dst_stride = dsc -> dest_stride ,
80- .src_buf = & dsc -> color ,
139+ .dst_buf = fill_dsc -> dest_buf ,
140+ .dst_w = fill_dsc -> dest_w ,
141+ .dst_h = fill_dsc -> dest_h ,
142+ .dst_stride = fill_dsc -> dest_stride ,
143+ .src_buf = & fill_dsc -> color ,
81144 };
82145
83146 return lv_color_blend_to_rgb565_esp (& asm_dsc );
0 commit comments