-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vg_lite): add ARGB1555 ARGB4444 ARGB2222 support (lvgl#7028)
Signed-off-by: yushuailong1 <yushuailong1@xiaomi.com> Co-authored-by: yushuailong1 <yushuailong1@xiaomi.com> Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com> Co-authored-by: FASTSHIFT <vifextech@foxmail.com>
- Loading branch information
1 parent
8030bd6
commit e4473b1
Showing
110 changed files
with
325 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+18.1 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_arc_image_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.7 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_arc_image_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.1 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_arc_normal_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_arc_normal_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.4 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_blend_mode_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.7 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_blend_mode_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.4 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_border_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.8 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_border_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.8 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_box_shadow_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.6 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_box_shadow_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.32 KB
.../ref_imgs_vg_lite/draw/render/argb1555/demo_render_conical_gradient_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.32 KB
.../ref_imgs_vg_lite/draw/render/argb1555/demo_render_conical_gradient_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.7 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_fill_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_fill_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.5 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_normal_1_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.6 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_normal_1_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.9 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_normal_2_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.7 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_normal_2_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_recolor_1_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.1 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_recolor_1_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.39 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_recolor_2_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.6 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_image_recolor_2_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.3 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_layer_normal_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.9 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_layer_normal_opa_255.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.5 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_line_opa_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.5 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_line_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+11.1 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_linear_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+11.1 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_linear_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+25.8 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_radial_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+25.8 KB
...s/ref_imgs_vg_lite/draw/render/argb1555/demo_render_radial_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+16.6 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_text_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_text_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_triangle_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+17.7 KB
tests/ref_imgs_vg_lite/draw/render/argb1555/demo_render_triangle_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+8.11 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_arc_image_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+10.4 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_arc_image_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+6.58 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_arc_normal_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+4.76 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_arc_normal_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+10.5 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_blend_mode_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_blend_mode_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+6.21 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_border_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+6.84 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_border_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+5.63 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_box_shadow_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+7.31 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_box_shadow_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+3.72 KB
.../ref_imgs_vg_lite/draw/render/argb2222/demo_render_conical_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+3.72 KB
.../ref_imgs_vg_lite/draw/render/argb2222/demo_render_conical_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+6.27 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_fill_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+7.2 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_fill_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+12.5 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_normal_1_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_normal_1_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+6.18 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_normal_2_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+6.6 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_normal_2_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+9.74 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_recolor_1_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_recolor_1_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+4.99 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_recolor_2_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+5.24 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_image_recolor_2_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+16.7 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_layer_normal_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+17.3 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_layer_normal_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+6.01 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_line_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+6.65 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_line_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+6.29 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_linear_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+6.29 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_linear_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+9.8 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_radial_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+9.8 KB
...s/ref_imgs_vg_lite/draw/render/argb2222/demo_render_radial_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+10 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_text_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+9.73 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_text_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+8.9 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_triangle_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+9.28 KB
tests/ref_imgs_vg_lite/draw/render/argb2222/demo_render_triangle_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_arc_image_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+17.1 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_arc_image_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+10.3 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_arc_normal_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+8.73 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_arc_normal_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+22.4 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_blend_mode_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+26.8 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_blend_mode_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+8.93 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_border_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+9.15 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_border_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+10.2 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_box_shadow_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+11.2 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_box_shadow_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+4.76 KB
.../ref_imgs_vg_lite/draw/render/argb4444/demo_render_conical_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+4.76 KB
.../ref_imgs_vg_lite/draw/render/argb4444/demo_render_conical_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+11.3 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_fill_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+12.3 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_fill_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+22.4 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_normal_1_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+28.1 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_normal_1_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+10.3 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_normal_2_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_normal_2_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+16.4 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_recolor_1_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+19 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_recolor_1_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+7.63 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_recolor_2_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+8.51 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_image_recolor_2_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+31 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_layer_normal_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+31.8 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_layer_normal_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+8.14 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_line_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+9.55 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_line_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+9.2 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_linear_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+9.2 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_linear_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+18.5 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_radial_gradient_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+18.5 KB
...s/ref_imgs_vg_lite/draw/render/argb4444/demo_render_radial_gradient_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_text_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+13.6 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_text_opa_255.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_triangle_opa_128.png
Oops, something went wrong.
Binary file added
BIN
+13.9 KB
tests/ref_imgs_vg_lite/draw/render/argb4444/demo_render_triangle_opa_255.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#if LV_BUILD_TEST | ||
#include "../lvgl.h" | ||
#include "../../lvgl_private.h" | ||
#include "../demos/lv_demos.h" | ||
|
||
#include "unity/unity.h" | ||
|
||
void setUp(void) | ||
{ | ||
/* Function run before every test */ | ||
} | ||
|
||
void tearDown(void) | ||
{ | ||
/* Function run after every test */ | ||
} | ||
|
||
void test_render_to_argb1555(void) | ||
{ | ||
/** | ||
* There is a slight color deviation between thorvg on 32-bit and 64-bit platforms. | ||
* The deviation will be amplified when using lower precision color formats. | ||
* Only 64-bit platforms are tested here. | ||
*/ | ||
#if LV_USE_DRAW_VG_LITE && LV_USE_SNAPSHOT && !defined(NON_AMD64_BUILD) | ||
|
||
lv_opa_t opa_values[2] = {0xff, 0x80}; | ||
uint32_t opa; | ||
for(opa = 0; opa < 2; opa++) { | ||
uint32_t i; | ||
for(i = 0; i < LV_DEMO_RENDER_SCENE_NUM; i++) { | ||
|
||
/*Skip test with transformed indexed images if they are not loaded to RAM*/ | ||
if(LV_BIN_DECODER_RAM_LOAD == 0 && | ||
(i == LV_DEMO_RENDER_SCENE_IMAGE_NORMAL_2 || | ||
i == LV_DEMO_RENDER_SCENE_IMAGE_RECOLOR_2)) continue; | ||
|
||
lv_demo_render(i, opa_values[opa]); | ||
lv_draw_buf_t * draw_buf = lv_snapshot_take(lv_screen_active(), LV_COLOR_FORMAT_ARGB1555); | ||
lv_obj_t * img = lv_image_create(lv_layer_top()); | ||
lv_image_set_src(img, draw_buf); | ||
|
||
char buf[128]; | ||
lv_snprintf(buf, sizeof(buf), "draw/render/argb1555/demo_render_%s_opa_%d.png", | ||
lv_demo_render_get_scene_name(i), opa_values[opa]); | ||
TEST_ASSERT_EQUAL_SCREENSHOT(buf); | ||
lv_obj_delete(img); | ||
lv_draw_buf_destroy(draw_buf); | ||
} | ||
} | ||
#else | ||
TEST_PASS(); | ||
#endif | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#if LV_BUILD_TEST | ||
#include "../lvgl.h" | ||
#include "../../lvgl_private.h" | ||
#include "../demos/lv_demos.h" | ||
|
||
#include "unity/unity.h" | ||
|
||
void setUp(void) | ||
{ | ||
/* Function run before every test */ | ||
} | ||
|
||
void tearDown(void) | ||
{ | ||
/* Function run after every test */ | ||
} | ||
|
||
void test_render_to_argb2222(void) | ||
{ | ||
/** | ||
* There is a slight color deviation between thorvg on 32-bit and 64-bit platforms. | ||
* The deviation will be amplified when using lower precision color formats. | ||
* Only 64-bit platforms are tested here. | ||
*/ | ||
#if LV_USE_DRAW_VG_LITE && LV_USE_SNAPSHOT && !defined(NON_AMD64_BUILD) | ||
|
||
lv_opa_t opa_values[2] = {0xff, 0x80}; | ||
uint32_t opa; | ||
for(opa = 0; opa < 2; opa++) { | ||
uint32_t i; | ||
for(i = 0; i < LV_DEMO_RENDER_SCENE_NUM; i++) { | ||
|
||
/*Skip test with transformed indexed images if they are not loaded to RAM*/ | ||
if(LV_BIN_DECODER_RAM_LOAD == 0 && | ||
(i == LV_DEMO_RENDER_SCENE_IMAGE_NORMAL_2 || | ||
i == LV_DEMO_RENDER_SCENE_IMAGE_RECOLOR_2)) continue; | ||
|
||
lv_demo_render(i, opa_values[opa]); | ||
lv_draw_buf_t * draw_buf = lv_snapshot_take(lv_screen_active(), LV_COLOR_FORMAT_ARGB2222); | ||
lv_obj_t * img = lv_image_create(lv_layer_top()); | ||
lv_image_set_src(img, draw_buf); | ||
|
||
char buf[128]; | ||
lv_snprintf(buf, sizeof(buf), "draw/render/argb2222/demo_render_%s_opa_%d.png", | ||
lv_demo_render_get_scene_name(i), opa_values[opa]); | ||
TEST_ASSERT_EQUAL_SCREENSHOT(buf); | ||
lv_obj_delete(img); | ||
lv_draw_buf_destroy(draw_buf); | ||
} | ||
} | ||
#else | ||
TEST_PASS(); | ||
#endif | ||
} | ||
|
||
#endif |
Oops, something went wrong.