diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-02-09 09:38:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 09:38:48 -0500 |
commit | 34489dca16ef9e7fd05c161b8b4f2fd5ce5e4ef0 (patch) | |
tree | 2a90beb98aacd85bbc5bd30df998b4e7c92ec3e7 /include/rootston/output.h | |
parent | 09c2626e32fd0eadc4b95a4f36b34f6bde79f6f4 (diff) | |
parent | cdd55b5d19470981ad71f8e6d31bd8152e44364b (diff) |
Merge pull request #571 from emersion/output-damage
Output damage tracking
Diffstat (limited to 'include/rootston/output.h')
-rw-r--r-- | include/rootston/output.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/rootston/output.h b/include/rootston/output.h new file mode 100644 index 00000000..3a6d3cc7 --- /dev/null +++ b/include/rootston/output.h @@ -0,0 +1,50 @@ +#ifndef _ROOTSTON_OUTPUT_H +#define _ROOTSTON_OUTPUT_H + +#include <time.h> +#include <pixman.h> +#include <wayland-server.h> + +/** + * Damage tracking requires to keep track of previous frames' damage. To allow + * damage tracking to work with triple buffering, a history of two frames is + * required. + */ +#define ROOTS_OUTPUT_PREVIOUS_DAMAGE_LEN 2 + +struct roots_desktop; + +struct roots_output { + struct roots_desktop *desktop; + struct wlr_output *wlr_output; + struct wl_list link; // roots_desktop:outputs + + struct roots_view *fullscreen_view; + + struct timespec last_frame; + pixman_region32_t damage; // in ouput-local coordinates + + // circular queue for previous damage + pixman_region32_t previous_damage[ROOTS_OUTPUT_PREVIOUS_DAMAGE_LEN]; + size_t previous_damage_idx; + + struct wl_listener frame; + struct wl_listener mode; + struct wl_listener needs_swap; +}; + +void output_add_notify(struct wl_listener *listener, void *data); +void output_remove_notify(struct wl_listener *listener, void *data); + +struct roots_view; +struct roots_drag_icon; + +void output_damage_whole(struct roots_output *output); +void output_damage_whole_view(struct roots_output *output, + struct roots_view *view); +void output_damage_from_view(struct roots_output *output, + struct roots_view *view); +void output_damage_whole_drag_icon(struct roots_output *output, + struct roots_drag_icon *icon); + +#endif |