tests/wayland-test-driver: Add surface argument to sync_point request

Will allow more "specific" sync points; will be used in the future by
new tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1993>
This commit is contained in:
Jonas Ådahl 2021-09-07 10:31:26 +02:00 committed by Marge Bot
parent ed677f49ff
commit d8521ffc56
4 changed files with 9 additions and 4 deletions

View File

@ -81,12 +81,14 @@ sync_actor_destroy (struct wl_client *client,
static void static void
sync_point (struct wl_client *client, sync_point (struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
uint32_t sequence) uint32_t sequence,
struct wl_resource *surface_resource)
{ {
MetaWaylandTestDriver *test_driver = wl_resource_get_user_data (resource); MetaWaylandTestDriver *test_driver = wl_resource_get_user_data (resource);
g_signal_emit (test_driver, signals[SYNC_POINT], 0, g_signal_emit (test_driver, signals[SYNC_POINT], 0,
sequence, sequence,
surface_resource,
client); client);
} }
@ -133,8 +135,9 @@ meta_wayland_test_driver_class_init (MetaWaylandTestDriverClass *klass)
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, 0,
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_NONE, 3,
G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_POINTER,
G_TYPE_POINTER); G_TYPE_POINTER);
} }

View File

@ -8,6 +8,7 @@
<request name="sync_point"> <request name="sync_point">
<arg name="sequence" type="uint"/> <arg name="sequence" type="uint"/>
<arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
</request> </request>
</interface> </interface>
</protocol> </protocol>

View File

@ -236,7 +236,7 @@ handle_frame_callback (void *data,
{ {
case STATE_WAIT_FOR_FRAME_1: case STATE_WAIT_FOR_FRAME_1:
reset_surface (); reset_surface ();
test_driver_sync_point (test_driver, 1); test_driver_sync_point (test_driver, 1, NULL);
break; break;
case STATE_WAIT_FOR_FRAME_2: case STATE_WAIT_FOR_FRAME_2:
exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
@ -395,7 +395,7 @@ main (int argc,
xdg_toplevel_set_max_size(xdg_toplevel, 700, 500); xdg_toplevel_set_max_size(xdg_toplevel, 700, 500);
wl_surface_commit (surface); wl_surface_commit (surface);
test_driver_sync_point (test_driver, 0); test_driver_sync_point (test_driver, 0, NULL);
running = TRUE; running = TRUE;
while (running) while (running)

View File

@ -202,6 +202,7 @@ typedef struct _ApplyLimitData
static void static void
on_sync_point (MetaWaylandTestDriver *test_driver, on_sync_point (MetaWaylandTestDriver *test_driver,
unsigned int sequence, unsigned int sequence,
struct wl_resource *surface_resource,
struct wl_client *wl_client, struct wl_client *wl_client,
ApplyLimitData *data) ApplyLimitData *data)
{ {