[PATCH weston 1/2] compositor-drm: Add debug binding for toggling sprites
Kristian Høgsberg
hoegsberg at gmail.com
Fri Nov 23 18:32:26 PST 2012
On Thu, Nov 22, 2012 at 03:56:59PM +0200, Ander Conselvan de Oliveira wrote:
> While at it, consolidate all the bindings we already have into one
> single function.
Thanks - and consolidating makes a lot of sense. Committed.
Kristian
> ---
> src/compositor-drm.c | 31 ++++++++++++++++++-------------
> 1 file changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index 142faa5..1ecd93c 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -2113,20 +2113,23 @@ find_primary_gpu(struct drm_compositor *ec, const char *seat)
> }
>
> static void
> -hide_sprites_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
> - void *data)
> +planes_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
> {
> struct drm_compositor *c = data;
>
> - c->sprites_hidden ^= 1;
> -}
> -
> -static void
> -cursor_binding(struct wl_seat *seat, uint32_t time, uint32_t key, void *data)
> -{
> - struct drm_compositor *c = data;
> -
> - c->cursors_are_broken ^= 1;
> + switch (key) {
> + case KEY_C:
> + c->cursors_are_broken ^= 1;
> + break;
> + case KEY_V:
> + c->sprites_are_broken ^= 1;
> + break;
> + case KEY_O:
> + c->sprites_hidden ^= 1;
> + break;
> + default:
> + break;
> + }
> }
>
> static struct weston_compositor *
> @@ -2232,9 +2235,11 @@ drm_compositor_create(struct wl_display *display,
> udev_device_unref(drm_device);
>
> weston_compositor_add_debug_binding(&ec->base, KEY_O,
> - hide_sprites_binding, ec);
> + planes_binding, ec);
> weston_compositor_add_debug_binding(&ec->base, KEY_C,
> - cursor_binding, ec);
> + planes_binding, ec);
> + weston_compositor_add_debug_binding(&ec->base, KEY_V,
> + planes_binding, ec);
>
> return &ec->base;
>
> --
> 1.7.10.4
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list