From 1a084807ce6ce1d8e4b8c35e3195240507ebffe8 Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 18 Jan 2018 03:31:46 +0100 Subject: rootston: do not redraw if output has no damage --- include/rootston/desktop.h | 17 ++++------------- include/rootston/output.h | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 include/rootston/output.h (limited to 'include') diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index 9dfd7b10..3d0e2a2b 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -16,15 +16,7 @@ #include #include "rootston/view.h" #include "rootston/config.h" - -struct roots_output { - struct roots_desktop *desktop; - struct wlr_output *wlr_output; - struct wl_listener frame; - struct timespec last_frame; - struct wl_list link; // roots_desktop:outputs - struct roots_view *fullscreen_view; -}; +#include "rootston/output.h" struct roots_desktop { struct wl_list views; // roots_view::link @@ -64,20 +56,19 @@ struct roots_desktop { struct roots_server; struct roots_desktop *desktop_create(struct roots_server *server, - struct roots_config *config); + struct roots_config *config); void desktop_destroy(struct roots_desktop *desktop); struct roots_output *desktop_output_from_wlr_output( struct roots_desktop *desktop, struct wlr_output *output); struct roots_view *desktop_view_at(struct roots_desktop *desktop, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy); +void desktop_damage_surface(struct roots_desktop *desktop, + struct wlr_surface *surface, double lx, double ly); void view_init(struct roots_view *view, struct roots_desktop *desktop); void view_destroy(struct roots_view *view); void view_activate(struct roots_view *view, bool activate); -void output_add_notify(struct wl_listener *listener, void *data); -void output_remove_notify(struct wl_listener *listener, void *data); - void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); void handle_wl_shell_surface(struct wl_listener *listener, void *data); void handle_xwayland_surface(struct wl_listener *listener, void *data); diff --git a/include/rootston/output.h b/include/rootston/output.h new file mode 100644 index 00000000..e7f49227 --- /dev/null +++ b/include/rootston/output.h @@ -0,0 +1,26 @@ +#ifndef _ROOTSTON_OUTPUT_H +#define _ROOTSTON_OUTPUT_H + +#include +#include +#include + +struct roots_desktop; + +struct roots_output { + struct roots_desktop *desktop; + struct wlr_output *wlr_output; + struct wl_listener frame; + struct timespec last_frame; + struct wl_list link; // roots_desktop:outputs + struct roots_view *fullscreen_view; + pixman_region32_t damage; +}; + +void output_add_notify(struct wl_listener *listener, void *data); +void output_remove_notify(struct wl_listener *listener, void *data); + +void output_damage_surface(struct roots_output *output, + struct wlr_surface *surface, double lx, double ly); + +#endif -- cgit v1.2.3