mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
wayland: Clean up a bit more
This commit is contained in:
parent
a74acf0ec2
commit
5d16194b03
@ -126,16 +126,6 @@ meta_wayland_compositor_repick (MetaWaylandCompositor *compositor)
|
||||
meta_wayland_seat_repick (compositor->seat);
|
||||
}
|
||||
|
||||
static void
|
||||
wl_compositor_create_surface (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
guint32 id)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = wl_resource_get_user_data (resource);
|
||||
|
||||
meta_wayland_surface_create (compositor, client, resource, id);
|
||||
}
|
||||
|
||||
static void
|
||||
wl_region_destroy (struct wl_client *client,
|
||||
struct wl_resource *resource)
|
||||
@ -171,14 +161,14 @@ wl_region_subtract (struct wl_client *client,
|
||||
cairo_region_subtract_rectangle (region->region, &rectangle);
|
||||
}
|
||||
|
||||
static const struct wl_region_interface meta_wayland_region_interface = {
|
||||
static const struct wl_region_interface meta_wayland_wl_region_interface = {
|
||||
wl_region_destroy,
|
||||
wl_region_add,
|
||||
wl_region_subtract
|
||||
};
|
||||
|
||||
static void
|
||||
meta_wayland_region_resource_destroy_cb (struct wl_resource *resource)
|
||||
wl_region_destructor (struct wl_resource *resource)
|
||||
{
|
||||
MetaWaylandRegion *region = wl_resource_get_user_data (resource);
|
||||
|
||||
@ -186,6 +176,15 @@ meta_wayland_region_resource_destroy_cb (struct wl_resource *resource)
|
||||
g_slice_free (MetaWaylandRegion, region);
|
||||
}
|
||||
|
||||
static void
|
||||
wl_compositor_create_surface (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
guint32 id)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = wl_resource_get_user_data (resource);
|
||||
meta_wayland_surface_create (compositor, client, resource, id);
|
||||
}
|
||||
|
||||
static void
|
||||
wl_compositor_create_region (struct wl_client *client,
|
||||
struct wl_resource *compositor_resource,
|
||||
@ -194,29 +193,16 @@ wl_compositor_create_region (struct wl_client *client,
|
||||
MetaWaylandRegion *region = g_slice_new0 (MetaWaylandRegion);
|
||||
|
||||
region->resource = wl_resource_create (client, &wl_region_interface, wl_resource_get_version (compositor_resource), id);
|
||||
wl_resource_set_implementation (region->resource, &meta_wayland_region_interface, region, meta_wayland_region_resource_destroy_cb);
|
||||
wl_resource_set_implementation (region->resource, &meta_wayland_wl_region_interface, region, wl_region_destructor);
|
||||
|
||||
region->region = cairo_region_create ();
|
||||
}
|
||||
|
||||
const static struct wl_compositor_interface meta_wayland_compositor_interface = {
|
||||
const static struct wl_compositor_interface meta_wayland_wl_compositor_interface = {
|
||||
wl_compositor_create_surface,
|
||||
wl_compositor_create_region
|
||||
};
|
||||
|
||||
void
|
||||
meta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
while (!wl_list_empty (&compositor->frame_callbacks))
|
||||
{
|
||||
MetaWaylandFrameCallback *callback =
|
||||
wl_container_of (compositor->frame_callbacks.next, callback, link);
|
||||
|
||||
wl_callback_send_done (callback->resource, get_time ());
|
||||
wl_resource_destroy (callback->resource);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
compositor_bind (struct wl_client *client,
|
||||
void *data,
|
||||
@ -227,7 +213,7 @@ compositor_bind (struct wl_client *client,
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &wl_compositor_interface, version, id);
|
||||
wl_resource_set_implementation (resource, &meta_wayland_compositor_interface, compositor, NULL);
|
||||
wl_resource_set_implementation (resource, &meta_wayland_wl_compositor_interface, compositor, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -246,6 +232,19 @@ meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
|
||||
meta_wayland_seat_update (compositor->seat, event);
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
while (!wl_list_empty (&compositor->frame_callbacks))
|
||||
{
|
||||
MetaWaylandFrameCallback *callback =
|
||||
wl_container_of (compositor->frame_callbacks.next, callback, link);
|
||||
|
||||
wl_callback_send_done (callback->resource, get_time ());
|
||||
wl_resource_destroy (callback->resource);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_wayland_compositor_handle_event:
|
||||
* @compositor: the #MetaWaylandCompositor instance
|
||||
|
Loading…
Reference in New Issue
Block a user