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 <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2022-10-10 16:19:22 +03:00 committed by Pekka Paalanen
parent 2cf85ab637
commit 142ec0f477
4 changed files with 40 additions and 0 deletions

View File

@ -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);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B