return client;
}
-struct client *
-create_client_and_test_surface(int x, int y, int width, int height)
+struct surface *
+create_test_surface(struct client *client)
{
- struct client *client;
struct surface *surface;
- pixman_color_t color = { 16384, 16384, 16384, 16384 }; /* uint16_t */
- pixman_image_t *solid;
-
- client = create_client();
- /* initialize the client surface */
surface = xzalloc(sizeof *surface);
+
surface->wl_surface =
wl_compositor_create_surface(client->wl_compositor);
assert(surface->wl_surface);
wl_surface_add_listener(surface->wl_surface, &surface_listener,
surface);
- client->surface = surface;
wl_surface_set_user_data(surface->wl_surface, surface);
+ return surface;
+}
+
+struct client *
+create_client_and_test_surface(int x, int y, int width, int height)
+{
+ struct client *client;
+ struct surface *surface;
+ pixman_color_t color = { 16384, 16384, 16384, 16384 }; /* uint16_t */
+ pixman_image_t *solid;
+
+ client = create_client();
+
+ /* initialize the client surface */
+ surface = create_test_surface(client);
+ client->surface = surface;
+
surface->width = width;
surface->height = height;
surface->buffer = create_shm_buffer_a8r8g8b8(client, width, height);