mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-31 22:25:27 -04:00
output: add cage_output_damage_surface
This commit is contained in:
parent
5feeb33505
commit
0e9dae18e6
3 changed files with 30 additions and 19 deletions
|
|
@ -70,25 +70,7 @@ static void
|
|||
damage_surface_iterator(struct wlr_surface *surface, int sx, int sy, void *user_data)
|
||||
{
|
||||
struct cg_view *view = (struct cg_view *) surface->data;
|
||||
struct cg_output *output = view->output;
|
||||
struct wlr_output *wlr_output = output->wlr_output;
|
||||
|
||||
if (pixman_region32_not_empty(&surface->buffer_damage)) {
|
||||
pixman_region32_t damage;
|
||||
pixman_region32_init(&damage);
|
||||
wlr_surface_get_effective_damage(surface, &damage);
|
||||
|
||||
wlr_region_scale(&damage, &damage, wlr_output->scale);
|
||||
if (ceil(wlr_output->scale) > surface->current.scale) {
|
||||
/* When scaling up a surface it'll become
|
||||
blurry, so we need to expand the damage
|
||||
region. */
|
||||
wlr_region_expand(&damage, &damage, ceil(wlr_output->scale) - surface->current.scale);
|
||||
}
|
||||
pixman_region32_translate(&damage, sx, sy);
|
||||
wlr_output_damage_add(output->damage, &damage);
|
||||
pixman_region32_fini(&damage);
|
||||
}
|
||||
cage_output_damage_surface(view->output, surface, sx, sy);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue