output: add damage tracking methods

This commit is contained in:
Jente Hidskes 2020-07-03 21:55:19 +02:00
parent 9b1641aa14
commit 79b81263f4
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA
2 changed files with 21 additions and 1 deletions

View file

@ -30,6 +30,24 @@
#include "renderer.h" #include "renderer.h"
#include "view.h" #include "view.h"
void
cage_output_damage_whole(struct cg_output *output)
{
assert(output != NULL);
wlr_output_damage_add_whole(output->damage);
}
void
cage_output_damage_region(struct cg_output *output, struct wlr_box *region)
{
assert(output != NULL);
assert(region != NULL);
assert(output->wlr_output->enabled);
wlr_output_damage_add_box(output->damage, region);
}
struct send_frame_done_data { struct send_frame_done_data {
struct timespec when; struct timespec when;
}; };
@ -184,7 +202,7 @@ cage_output_enable(struct cg_output *output)
wlr_output_enable(wlr_output, true); wlr_output_enable(wlr_output, true);
wlr_output_commit(wlr_output); wlr_output_commit(wlr_output);
wlr_output_damage_add_whole(output->damage); cage_output_damage_whole(output);
} }
void void

View file

@ -24,6 +24,8 @@ struct cg_output {
struct wl_list link; // cg_server::outputs struct wl_list link; // cg_server::outputs
}; };
void cage_output_damage_whole(struct cg_output *output);
void cage_output_damage_region(struct cg_output *output, struct wlr_box *region);
void cage_output_get_geometry(struct cg_output *output, struct wlr_box *geometry); void cage_output_get_geometry(struct cg_output *output, struct wlr_box *geometry);
void cage_output_disable(struct cg_output *output); void cage_output_disable(struct cg_output *output);
void cage_output_enable(struct cg_output *output); void cage_output_enable(struct cg_output *output);