1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

test add 3rd party libs to all tests and also fix them

Fixes: #2661
This commit is contained in:
Gabor Kiss-Vamosi 2021-10-12 17:03:50 +02:00
parent 273a0eb32f
commit 7a95fa9e2d
4 changed files with 47 additions and 10 deletions

View File

@ -365,7 +365,7 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
if(obj->styles[i].is_trans) continue; if(obj->styles[i].is_trans) continue;
lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector); lv_state_t state_act = lv_obj_style_get_selector_state(obj->styles[i].selector);
/*The style is valid for a stat but not the other*/ /*The style is valid for a state but not the other*/
bool valid1 = state_act & (~state1) ? false : true; bool valid1 = state_act & (~state1) ? false : true;
bool valid2 = state_act & (~state2) ? false : true; bool valid2 = state_act & (~state2) ? false : true;
if(valid1 != valid2) { if(valid1 != valid2) {

View File

@ -1,6 +1,7 @@
#include "gifdec.h" #include "gifdec.h"
#include "../../../misc/lv_log.h" #include "../../../misc/lv_log.h"
#include "../../../misc/lv_mem.h" #include "../../../misc/lv_mem.h"
#include "../../../misc/lv_color.h"
#if LV_USE_GIF #if LV_USE_GIF
#include <stdio.h> #include <stdio.h>
@ -111,7 +112,7 @@ static gd_GIF * gif_open(gd_GIF * gif_base)
gif = lv_mem_alloc(sizeof(gd_GIF) + 5 * width * height); gif = lv_mem_alloc(sizeof(gd_GIF) + 5 * width * height);
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
gif = lv_mem_alloc(sizeof(gd_GIF) + 4 * width * height); gif = lv_mem_alloc(sizeof(gd_GIF) + 4 * width * height);
#elif LV_COLOR_DEPTH == 8 #elif LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
gif = lv_mem_alloc(sizeof(gd_GIF) + 3 * width * height); gif = lv_mem_alloc(sizeof(gd_GIF) + 3 * width * height);
#endif #endif
@ -130,7 +131,7 @@ static gd_GIF * gif_open(gd_GIF * gif_base)
gif->frame = &gif->canvas[4 * width * height]; gif->frame = &gif->canvas[4 * width * height];
#elif LV_COLOR_DEPTH == 16 #elif LV_COLOR_DEPTH == 16
gif->frame = &gif->canvas[3 * width * height]; gif->frame = &gif->canvas[3 * width * height];
#elif LV_COLOR_DEPTH == 8 #elif LV_COLOR_DEPTH == 8 || LV_COLOR_DEPTH == 1
gif->frame = &gif->canvas[2 * width * height]; gif->frame = &gif->canvas[2 * width * height];
#endif #endif
if (gif->bgindex) if (gif->bgindex)
@ -498,6 +499,10 @@ render_frame_rect(gd_GIF *gif, uint8_t *buffer)
lv_color_t c = lv_color_make(*(color + 0), *(color + 1), *(color + 2)); lv_color_t c = lv_color_make(*(color + 0), *(color + 1), *(color + 2));
buffer[(i+k)*2 + 0] = c.full; buffer[(i+k)*2 + 0] = c.full;
buffer[(i+k)*2 + 1] = 0xff; buffer[(i+k)*2 + 1] = 0xff;
#elif LV_COLOR_DEPTH == 1
uint8_t b = (*(color + 0)) | (*(color + 1)) | (*(color + 2));
buffer[(i+k)*2 + 0] = b > 128 ? 1 : 0;
buffer[(i+k)*2 + 1] = 0xff;
#endif #endif
} }
} }
@ -534,6 +539,10 @@ dispose(gd_GIF *gif)
lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2)); lv_color_t c = lv_color_make(*(bgcolor + 0), *(bgcolor + 1), *(bgcolor + 2));
gif->canvas[(i+k)*2 + 0] = c.full; gif->canvas[(i+k)*2 + 0] = c.full;
gif->canvas[(i+k)*2 + 1] = opa; gif->canvas[(i+k)*2 + 1] = opa;
#elif LV_COLOR_DEPTH == 1
uint8_t b = (*(bgcolor + 0)) | (*(bgcolor + 1)) | (*(bgcolor + 2));
gif->canvas[(i+k)*2 + 0] = b > 128 ? 1 : 0;
gif->canvas[(i+k)*2 + 1] = opa;
#endif #endif
} }
i += gif->width; i += gif->width;

View File

@ -222,13 +222,22 @@ static void convert_color_depth(uint8_t * img, uint32_t px_cnt)
} }
#elif LV_COLOR_DEPTH == 8 #elif LV_COLOR_DEPTH == 8
lv_color32_t * img_argb = (lv_color32_t*)img; lv_color32_t * img_argb = (lv_color32_t*)img;
lv_color_t c; lv_color_t c;
uint32_t i; uint32_t i;
for(i = 0; i < px_cnt; i++) { for(i = 0; i < px_cnt; i++) {
c = lv_color_make(img_argb[i].red, img_argb[i].green, img_argb[i].blue); c = lv_color_make(img_argb[i].ch.red, img_argb[i].ch.green, img_argb[i].ch.blue);
img[i*2 + 1] = img_argb[i].alpha; img[i*2 + 1] = img_argb[i].ch.alpha;
img[i*2 + 0] = c.full img[i*2 + 0] = c.full;
} }
#elif LV_COLOR_DEPTH == 1
lv_color32_t * img_argb = (lv_color32_t*)img;
uint8_t b;
uint32_t i;
for(i = 0; i < px_cnt; i++) {
b = img_argb[i].ch.red | img_argb[i].ch.green | img_argb[i].ch.blue;
img[i*2 + 1] = img_argb[i].ch.alpha;
img[i*2 + 0] = b > 128 ? 1 : 0;
}
#endif #endif
} }

View File

@ -31,6 +31,10 @@ set(LVGL_TEST_OPTIONS_MINIMAL_MONOCHROME
-DLV_USE_ARABIC_PERSIAN_CHARS=0 -DLV_USE_ARABIC_PERSIAN_CHARS=0
-DLV_BUILD_EXAMPLES=1 -DLV_BUILD_EXAMPLES=1
-DLV_FONT_DEFAULT=&lv_font_montserrat_14 -DLV_FONT_DEFAULT=&lv_font_montserrat_14
-DLV_USE_PNG=1
-DLV_USE_BMP=1
-DLV_USE_GIF=1
-DLV_USE_QRCODE=1
) )
set(LVGL_TEST_OPTIONS_NORMAL_8BIT set(LVGL_TEST_OPTIONS_NORMAL_8BIT
@ -51,6 +55,11 @@ set(LVGL_TEST_OPTIONS_NORMAL_8BIT
-DLV_USE_ARABIC_PERSIAN_CHARS=0 -DLV_USE_ARABIC_PERSIAN_CHARS=0
-DLV_BUILD_EXAMPLES=1 -DLV_BUILD_EXAMPLES=1
-DLV_FONT_DEFAULT=&lv_font_montserrat_14 -DLV_FONT_DEFAULT=&lv_font_montserrat_14
-DLV_USE_PNG=1
-DLV_USE_BMP=1
-DLV_USE_SJPG=1
-DLV_USE_GIF=1
-DLV_USE_QRCODE=1
) )
set(LVGL_TEST_OPTIONS_16BIT set(LVGL_TEST_OPTIONS_16BIT
@ -72,6 +81,11 @@ set(LVGL_TEST_OPTIONS_16BIT
-DLV_USE_ARABIC_PERSIAN_CHARS=0 -DLV_USE_ARABIC_PERSIAN_CHARS=0
-DLV_BUILD_EXAMPLES=1 -DLV_BUILD_EXAMPLES=1
-DLV_FONT_DEFAULT=&lv_font_montserrat_14 -DLV_FONT_DEFAULT=&lv_font_montserrat_14
-DLV_USE_PNG=1
-DLV_USE_BMP=1
-DLV_USE_SJPG=1
-DLV_USE_GIF=1
-DLV_USE_QRCODE=1
) )
set(LVGL_TEST_OPTIONS_16BIT_SWAP set(LVGL_TEST_OPTIONS_16BIT_SWAP
@ -93,6 +107,11 @@ set(LVGL_TEST_OPTIONS_16BIT_SWAP
-DLV_USE_ARABIC_PERSIAN_CHARS=0 -DLV_USE_ARABIC_PERSIAN_CHARS=0
-DLV_BUILD_EXAMPLES=1 -DLV_BUILD_EXAMPLES=1
-DLV_FONT_DEFAULT=&lv_font_montserrat_14 -DLV_FONT_DEFAULT=&lv_font_montserrat_14
-DLV_USE_PNG=1
-DLV_USE_BMP=1
-DLV_USE_SJPG=1
-DLV_USE_GIF=1
-DLV_USE_QRCODE=1
) )
set(LVGL_TEST_OPTIONS_FULL_32BIT set(LVGL_TEST_OPTIONS_FULL_32BIT