compositor: add an assign_planes hook to the output

This allows each output back end to optimize drawing using overlay planes
and cursors (yet to be integrated).  If a surface is assigned to a
plane, the back end should clear its damage field so that the later
repaint code won't look at it.
Jesse Barnes 13 years ago committed by Kristian Høgsberg
parent 2493be40a3
commit 5308a5e09b
  1. 1
      src/compositor-drm.c
  2. 1
      src/compositor-openwfd.c
  3. 1
      src/compositor-wayland.c
  4. 1
      src/compositor-x11.c
  5. 9
      src/compositor.c
  6. 1
      src/compositor.h

@ -621,6 +621,7 @@ create_output_for_connector(struct drm_compositor *ec,
output->base.repaint = drm_output_repaint; output->base.repaint = drm_output_repaint;
output->base.set_hardware_cursor = drm_output_set_cursor; output->base.set_hardware_cursor = drm_output_set_cursor;
output->base.destroy = drm_output_destroy; output->base.destroy = drm_output_destroy;
output->base.assign_planes = NULL;
return 0; return 0;

@ -406,6 +406,7 @@ create_output_for_port(struct wfd_compositor *ec,
wfd_output_prepare_scanout_surface; wfd_output_prepare_scanout_surface;
output->base.set_hardware_cursor = wfd_output_set_cursor; output->base.set_hardware_cursor = wfd_output_set_cursor;
output->base.destroy = wfd_output_destroy; output->base.destroy = wfd_output_destroy;
output->base.assign_planes = NULL;
wl_list_insert(ec->base.output_list.prev, &output->base.link); wl_list_insert(ec->base.output_list.prev, &output->base.link);

@ -442,6 +442,7 @@ wayland_compositor_create_output(struct wayland_compositor *c,
output->base.repaint = wayland_output_repaint; output->base.repaint = wayland_output_repaint;
output->base.set_hardware_cursor = wayland_output_set_cursor; output->base.set_hardware_cursor = wayland_output_set_cursor;
output->base.destroy = wayland_output_destroy; output->base.destroy = wayland_output_destroy;
output->base.assign_planes = NULL;
wl_list_insert(c->base.output_list.prev, &output->base.link); wl_list_insert(c->base.output_list.prev, &output->base.link);

@ -448,6 +448,7 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y,
output->base.repaint = x11_output_repaint; output->base.repaint = x11_output_repaint;
output->base.set_hardware_cursor = x11_output_set_cursor; output->base.set_hardware_cursor = x11_output_set_cursor;
output->base.destroy = x11_output_destroy; output->base.destroy = x11_output_destroy;
output->base.assign_planes = NULL;
wl_list_insert(c->base.output_list.prev, &output->base.link); wl_list_insert(c->base.output_list.prev, &output->base.link);

@ -986,6 +986,15 @@ weston_output_repaint(struct weston_output *output, int msecs)
&es->transform.boundingbox); &es->transform.boundingbox);
} }
if (output->assign_planes)
/*
* This will queue flips for the fbs and sprites where
* applicable and clear the damage for those surfaces.
* The repaint loop below will repaint everything
* else.
*/
output->assign_planes(output);
weston_output_set_cursor(output, ec->input_device); weston_output_set_cursor(output, ec->input_device);
wl_list_for_each(es, &ec->surface_list, link) { wl_list_for_each(es, &ec->surface_list, link) {

@ -87,6 +87,7 @@ struct weston_output {
int (*set_hardware_cursor)(struct weston_output *output, int (*set_hardware_cursor)(struct weston_output *output,
struct weston_input_device *input); struct weston_input_device *input);
void (*destroy)(struct weston_output *output); void (*destroy)(struct weston_output *output);
void (*assign_planes)(struct weston_output *output);
}; };
struct weston_input_device { struct weston_input_device {

Loading…
Cancel
Save