From 142ec0f477fae1a5954ee133ecd1f09b20b725f5 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 10 Oct 2022 16:19:22 +0300 Subject: [PATCH] tests: add output_icc_decorations Here are more tests for output decorations drawing, this time through the color-lcms plugin. This is the only practical way to exercise the input-to-output category of color transformations. Signed-off-by: Pekka Paalanen --- tests/color-icc-output-test.c | 40 ++++++++++++++++++ tests/reference/output-icc-decorations-00.png | Bin 0 -> 650 bytes tests/reference/output-icc-decorations-01.png | Bin 0 -> 653 bytes tests/reference/output-icc-decorations-02.png | Bin 0 -> 652 bytes 4 files changed, 40 insertions(+) create mode 100644 tests/reference/output-icc-decorations-00.png create mode 100644 tests/reference/output-icc-decorations-01.png create mode 100644 tests/reference/output-icc-decorations-02.png diff --git a/tests/color-icc-output-test.c b/tests/color-icc-output-test.c index e6371363d..60effc45f 100644 --- a/tests/color-icc-output-test.c +++ b/tests/color-icc-output-test.c @@ -450,6 +450,7 @@ fixture_setup(struct weston_test_harness *harness, const struct setup_args *arg) weston_ini_setup(&setup, cfgln("[core]"), + cfgln("output-decorations=true"), cfgln("color-management=true"), cfgln("[output]"), cfgln("name=headless"), @@ -587,6 +588,9 @@ process_pipeline_comparison(const struct buffer *src_buf, * The groundtruth conversion comes from the struct lcms_pipeline definitions. * The first error source is converting those to ICC files. The second error * source is Weston. + * + * This tests particularly the chain of input-to-blend followed by + * blend-to-output categories of color transformations. */ TEST(opaque_pixel_conversion) { @@ -845,3 +849,39 @@ TEST(output_icc_alpha_blend) wl_subcompositor_destroy(subco); client_destroy(client); /* destroys bg */ } + +/* + * Test that output decorations have the expected colors. + * + * This is the only way to test input-to-output category of color + * transformations. They are used only for output decorations and some other + * debug-like features. The input color space is hardcoded to sRGB in the + * compositor. + * + * Because the output decorations are drawn with Cairo, we do not have an + * easy access to the ground-truth image and so do not check the results + * against a reference formula. + */ +TEST(output_icc_decorations) +{ + int seq_no = get_test_fixture_index(); + const struct setup_args *arg = &my_setup_args[seq_no]; + struct client *client; + struct buffer *shot; + pixman_image_t *img; + bool match; + + client = create_client(); + + shot = client_capture_output(client, client->output, + WESTON_CAPTURE_V1_SOURCE_FULL_FRAMEBUFFER); + img = image_convert_to_a8r8g8b8(shot->image); + + match = verify_image(img, "output-icc-decorations", + arg->ref_image_index, NULL, seq_no); + assert(match); + + pixman_image_unref(img); + buffer_destroy(shot); + client_destroy(client); +} diff --git a/tests/reference/output-icc-decorations-00.png b/tests/reference/output-icc-decorations-00.png new file mode 100644 index 0000000000000000000000000000000000000000..2bac388fc320d0c19310cb673c23c1e827d12d87 GIT binary patch literal 650 zcmeAS@N?(olHy`uVBq!ia0y~yVDtg9D>;~eIHSt{yup#Saq^Tvw&_n$wVTF-BB8fZKo(6H~vw5o#%1~bk-pM3Jk$B%|z^875ZGlXkoCh5wvWa{W`CdeM#xdE2Z1 zf4uk2{h|DIYo{j#JN4(L-_^Dewv2gMd{tHl#5ief>GJKn=HBMH-7-+tae;rx%zMNlTePgG(C5w6y$GJjTKh4ucK${D0t#zC0|D?c6`+m_*UAQZDh}}C` z|L0fn|D_iM_t*Qq+jDWUOp`EJFU*lEZ8~Yc5yd3lC z#O!6BdzpS^@4vr1ZlcYnRjY#5H~ib>tiZogJZJlDoAdMM&Ffm^v6s7QN#?AxX`AEL k_a9Hb{T-Ba@PLvd(oeUgc?D0<5(cUAboFyt=akR{0F<^Bo&W#< literal 0 HcmV?d00001 diff --git a/tests/reference/output-icc-decorations-01.png b/tests/reference/output-icc-decorations-01.png new file mode 100644 index 0000000000000000000000000000000000000000..90aa82735557a16789d5cb86b2b4b5cfe15dc7f1 GIT binary patch literal 653 zcmeAS@N?(olHy`uVBq!ia0y~yVDtg9D>;~eWMRm1E(W35*&M4bv0_#JCL@<}q}I zE7;oZRpDS1KXdYX=!v7Yd3ASRGg+SonvMrFgn!ii+F*13_~XL;_w&tWuS`G4y>eC7 z)~K`3KOcTLq2xmJrK_8DX8WiuzPLi8>q_&3ts<@$UzU8biC=%+lfBk|SJkxC=7S1f zIVxfgKQ#E-@noX)(!-LyZpt7g^ZBXvzu6XCGn?%jIqiGY+S_lxRqd@_Tc$Yiuw`oG zxwOsIYt82R$;;eP8-{Ot+!8hE>LQJAaniUoV@MUbN$}$xV3lME})%r;?{rvaoy(5bhtzA z2+uoN|1ZwAPUFgv_457y?sUwRX%e=CJ5$kOBG@b!zJr~lNzD6j@9XjXCB%fMca z`E+9SDlc26xa)QM{cV*hpRAs$KmVY;t-^%uSD3fm&YkysZP;pH&~JXw8WOrSMo+x^ k=*NnhZ+r1XDoD!oBcGf>nwyA+ek_RV>FVdQ&MBb@02O8xlmGw# literal 0 HcmV?d00001 diff --git a/tests/reference/output-icc-decorations-02.png b/tests/reference/output-icc-decorations-02.png new file mode 100644 index 0000000000000000000000000000000000000000..dbb892897d83eebc17947ff7193fdca946686e1d GIT binary patch literal 652 zcmeAS@N?(olHy`uVBq!ia0y~yVDtg9D>;~e5iM^cYafj(aavV#fvn8^qa~wyB6u3wmEM;+xL=d{A7@%h0L-z#Wg z*=N)G`|lLWHVIp@s26egJt ztJ|yS!gu}mmC9>-4jE58+-nzh_W+o&XR>oj{rpSPH+G(Q=rx}!Kj%5n0F(c7@5qNd z@cQqwt8s4iB?LU@-gaJBzn*i}lotESBq>K3@Oq;Xaw`iWU>WYUX|L z`}g|${NwtqZ9jfK{@rX|1<~umcd%0i?pT32CtwmdKI;Vst049GEVE_OC literal 0 HcmV?d00001