[mutter] tests/wayland: Add test for buffer transforms



commit b988fd73c909cc859999881374bb1fc2839eae35
Author: Robert Mader <robert mader collabora com>
Date:   Sat May 21 18:18:01 2022 +0200

    tests/wayland: Add test for buffer transforms
    
    Ensure that buffer transforms are correctly rendered.
    
    This test would fail without the commit
    "wayland/surface: Swap 90 and 270 degree transforms"
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1055>

 src/tests/ref-tests/wayland_buffer_transform_0.ref.png | Bin 0 -> 1421 bytes
 src/tests/ref-tests/wayland_buffer_transform_1.ref.png | Bin 0 -> 1420 bytes
 src/tests/ref-tests/wayland_buffer_transform_2.ref.png | Bin 0 -> 1419 bytes
 src/tests/ref-tests/wayland_buffer_transform_3.ref.png | Bin 0 -> 1422 bytes
 src/tests/ref-tests/wayland_buffer_transform_4.ref.png | Bin 0 -> 1419 bytes
 src/tests/ref-tests/wayland_buffer_transform_5.ref.png | Bin 0 -> 1422 bytes
 src/tests/ref-tests/wayland_buffer_transform_6.ref.png | Bin 0 -> 1422 bytes
 src/tests/ref-tests/wayland_buffer_transform_7.ref.png | Bin 0 -> 1420 bytes
 src/tests/wayland-test-clients/meson.build             |   3 +++
 src/tests/wayland-unit-tests.c                         |  12 ++++++++++++
 10 files changed, 15 insertions(+)
---
diff --git a/src/tests/ref-tests/wayland_buffer_transform_0.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_0.ref.png
new file mode 100644
index 0000000000..24f2f80b84
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_0.ref.png differ
diff --git a/src/tests/ref-tests/wayland_buffer_transform_1.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_1.ref.png
new file mode 100644
index 0000000000..b39b9c654d
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_1.ref.png differ
diff --git a/src/tests/ref-tests/wayland_buffer_transform_2.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_2.ref.png
new file mode 100644
index 0000000000..c9242749af
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_2.ref.png differ
diff --git a/src/tests/ref-tests/wayland_buffer_transform_3.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_3.ref.png
new file mode 100644
index 0000000000..fcbcb54a18
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_3.ref.png differ
diff --git a/src/tests/ref-tests/wayland_buffer_transform_4.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_4.ref.png
new file mode 100644
index 0000000000..8bf3fc7cac
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_4.ref.png differ
diff --git a/src/tests/ref-tests/wayland_buffer_transform_5.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_5.ref.png
new file mode 100644
index 0000000000..9833db07c3
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_5.ref.png differ
diff --git a/src/tests/ref-tests/wayland_buffer_transform_6.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_6.ref.png
new file mode 100644
index 0000000000..9a68091077
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_6.ref.png differ
diff --git a/src/tests/ref-tests/wayland_buffer_transform_7.ref.png 
b/src/tests/ref-tests/wayland_buffer_transform_7.ref.png
new file mode 100644
index 0000000000..31a32fb258
Binary files /dev/null and b/src/tests/ref-tests/wayland_buffer_transform_7.ref.png differ
diff --git a/src/tests/wayland-test-clients/meson.build b/src/tests/wayland-test-clients/meson.build
index 083c75057d..6633b56f4c 100644
--- a/src/tests/wayland-test-clients/meson.build
+++ b/src/tests/wayland-test-clients/meson.build
@@ -46,6 +46,9 @@ common_sources = [
 ]
 
 wayland_test_clients = [
+  {
+    'name': 'buffer-transform',
+  },
   {
     'name': 'subsurface-remap-toplevel',
   },
diff --git a/src/tests/wayland-unit-tests.c b/src/tests/wayland-unit-tests.c
index 116531ba4e..9acbca23c6 100644
--- a/src/tests/wayland-unit-tests.c
+++ b/src/tests/wayland-unit-tests.c
@@ -65,6 +65,16 @@ subsurface_remap_toplevel (void)
   meta_wayland_test_client_finish (wayland_test_client);
 }
 
+static void
+buffer_transform (void)
+{
+  MetaWaylandTestClient *wayland_test_client;
+
+  wayland_test_client =
+    meta_wayland_test_client_new ("buffer-transform");
+  meta_wayland_test_client_finish (wayland_test_client);
+}
+
 static void
 subsurface_reparenting (void)
 {
@@ -656,6 +666,8 @@ on_after_tests (void)
 static void
 init_tests (void)
 {
+  g_test_add_func ("/wayland/buffer/transform",
+                   buffer_transform);
   g_test_add_func ("/wayland/subsurface/remap-toplevel",
                    subsurface_remap_toplevel);
   g_test_add_func ("/wayland/subsurface/reparent",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]