fix(lottie): smooth edges on lottie animation (#8189)

This commit is contained in:
Felix Biego
2025-05-05 15:18:59 +03:00
committed by GitHub
parent 22abb53307
commit ea3131641d
15 changed files with 19 additions and 19 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

+9 -9
View File
@@ -29,7 +29,7 @@ void tearDown(void)
void test_lottie_simple(void)
{
lv_obj_t * lottie = lv_lottie_create(lv_screen_active());
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
lv_lottie_set_src_data(lottie, test_lottie_approve, test_lottie_approve_size);
lv_obj_center(lottie);
@@ -54,7 +54,7 @@ void test_lottie_simple(void)
void test_lottie_load_from_file(void)
{
lv_obj_t * lottie = lv_lottie_create(lv_screen_active());
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
lv_lottie_set_src_file(lottie, "src/test_assets/test_lottie_approve.json");
lv_obj_center(lottie);
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/lottie_1.png");
@@ -80,7 +80,7 @@ void test_lottie_missing_settings(void)
uint32_t tmp_buf[LV_TEST_WIDTH_TO_STRIDE(100, 4) * 100 + LV_DRAW_BUF_ALIGN];
lv_obj_t * lottie1 = lv_lottie_create(lv_screen_active());
lv_lottie_set_buffer(lottie1, 100, 100, lv_draw_buf_align(tmp_buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie1, 100, 100, lv_draw_buf_align(tmp_buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
/*Shouldn't crash without source*/
lv_timer_handler();
@@ -92,7 +92,7 @@ void test_lottie_missing_settings(void)
/*Shouldn't crash without buffer*/
lv_timer_handler();
lv_lottie_set_buffer(lottie2, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie2, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
lv_obj_center(lottie2);
lv_test_fast_forward(950);
@@ -102,7 +102,7 @@ void test_lottie_missing_settings(void)
void test_lottie_rescale(void)
{
lv_obj_t * lottie = lv_lottie_create(lv_screen_active());
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
lv_lottie_set_src_data(lottie, test_lottie_approve, test_lottie_approve_size);
lv_obj_center(lottie);
@@ -110,7 +110,7 @@ void test_lottie_rescale(void)
lv_test_fast_forward(200);
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/lottie_2.png");
lv_lottie_set_buffer(lottie, 50, 50, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie, 50, 50, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/lottie_2_small.png");
/*Should be the last frame*/
@@ -122,7 +122,7 @@ void test_lottie_rescale(void)
void test_lottie_non_uniform_shape(void)
{
lv_obj_t * lottie = lv_lottie_create(lv_screen_active());
lv_lottie_set_buffer(lottie, 50, 200, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie, 50, 200, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
lv_lottie_set_src_data(lottie, test_lottie_approve, test_lottie_approve_size);
lv_obj_center(lottie);
@@ -137,7 +137,7 @@ void test_lottie_memory_leak(void)
uint32_t i;
for(i = 0; i < 32; i++) {
lv_obj_t * lottie = lv_lottie_create(lv_screen_active());
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
lv_lottie_set_src_data(lottie, test_lottie_approve, test_lottie_approve_size);
lv_obj_center(lottie);
lv_test_fast_forward(753 * i); /*Render a random frame*/
@@ -150,7 +150,7 @@ void test_lottie_memory_leak(void)
void test_lottie_no_jump_when_visible_again(void)
{
lv_obj_t * lottie = lv_lottie_create(lv_screen_active());
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888));
lv_lottie_set_buffer(lottie, 100, 100, lv_draw_buf_align(buf, LV_COLOR_FORMAT_ARGB8888_PREMULTIPLIED));
lv_lottie_set_src_data(lottie, test_lottie_approve, test_lottie_approve_size);
lv_obj_center(lottie);