summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.com>2022-10-10 16:19:22 +0300
committerPekka Paalanen <pq@iki.fi>2022-12-02 13:36:25 +0000
commit142ec0f477fae1a5954ee133ecd1f09b20b725f5 (patch)
tree3eaded6c4907f2a4189f0a58c0398a097cb64a29 /tests
parent2cf85ab637f0668bf5abdbb4f2685688b1c9f7df (diff)
downloadweston-142ec0f477fae1a5954ee133ecd1f09b20b725f5.tar.gz
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/color-icc-output-test.c40
-rw-r--r--tests/reference/output-icc-decorations-00.pngbin0 -> 650 bytes
-rw-r--r--tests/reference/output-icc-decorations-01.pngbin0 -> 653 bytes
-rw-r--r--tests/reference/output-icc-decorations-02.pngbin0 -> 652 bytes
4 files changed, 40 insertions, 0 deletions
diff --git a/tests/color-icc-output-test.c b/tests/color-icc-output-test.c
index e6371363..60effc45 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 00000000..2bac388f
--- /dev/null
+++ b/tests/reference/output-icc-decorations-00.png
Binary files differ
diff --git a/tests/reference/output-icc-decorations-01.png b/tests/reference/output-icc-decorations-01.png
new file mode 100644
index 00000000..90aa8273
--- /dev/null
+++ b/tests/reference/output-icc-decorations-01.png
Binary files differ
diff --git a/tests/reference/output-icc-decorations-02.png b/tests/reference/output-icc-decorations-02.png
new file mode 100644
index 00000000..dbb89289
--- /dev/null
+++ b/tests/reference/output-icc-decorations-02.png
Binary files differ