From: Ander Conselvan de Oliveira Date: Wed, 31 Oct 2012 15:55:46 +0000 (+0200) Subject: compositor-drm: Add key binding for hidding overlays X-Git-Tag: submit/2.0alpha-wayland/20121121.143012~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da1c908a2bc51a6fcc58901a3772a1f1a0a3958a;p=profile%2Fivi%2Fweston.git compositor-drm: Add key binding for hidding overlays Pressing ctrl-alt-o will cause the overlays to be hidden, but surfaces will still be assigned to different planes. This helps with debugging of repaint culling below surfaces in other planes. --- diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 1133281..fac0f56 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -97,6 +97,7 @@ struct drm_compositor { struct wl_list sprite_list; int sprites_are_broken; + int sprites_hidden; int cursors_are_broken; @@ -396,7 +397,10 @@ drm_output_repaint(struct weston_output *output_base, continue; ret = drmModeSetPlane(compositor->drm.fd, s->plane_id, - output->crtc_id, s->pending_fb_id, flags, + output->crtc_id, + compositor->sprites_hidden ? + 0 : s->pending_fb_id, + flags, s->dest_x, s->dest_y, s->dest_w, s->dest_h, s->src_x, s->src_y, @@ -2220,6 +2224,15 @@ find_primary_gpu(struct drm_compositor *ec, const char *seat) return drm_device; } +static void +hide_sprites_binding(struct wl_seat *seat, uint32_t time, uint32_t key, + void *data) +{ + struct drm_compositor *c = data; + + c->sprites_hidden ^= 1; +} + static struct weston_compositor * drm_compositor_create(struct wl_display *display, int connector, const char *seat, int tty, @@ -2321,6 +2334,10 @@ drm_compositor_create(struct wl_display *display, udev_device_unref(drm_device); + weston_compositor_add_key_binding(&ec->base, KEY_O, + MODIFIER_CTRL | MODIFIER_ALT, + hide_sprites_binding, ec); + return &ec->base; err_udev_monitor: