mirror of https://github.com/yshui/picom.git
win: keep track of per-window damage
This is not used anywhere yet, but is intended for damage calculation refactor. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
3cd107a29c
commit
9210536db1
10
src/event.c
10
src/event.c
|
@ -704,11 +704,17 @@ static inline void repair_win(session_t *ps, struct managed_win *w) {
|
|||
}
|
||||
|
||||
// Remove the part in the damage area that could be ignored
|
||||
region_t without_ignored;
|
||||
pixman_region32_init(&without_ignored);
|
||||
if (w->reg_ignore && win_is_region_ignore_valid(ps, w)) {
|
||||
pixman_region32_subtract(&parts, &parts, w->reg_ignore);
|
||||
pixman_region32_subtract(&without_ignored, &parts, w->reg_ignore);
|
||||
}
|
||||
|
||||
add_damage(ps, &parts);
|
||||
add_damage(ps, &without_ignored);
|
||||
pixman_region32_fini(&without_ignored);
|
||||
|
||||
pixman_region32_translate(&parts, -w->g.x, -w->g.y);
|
||||
pixman_region32_copy(&w->damaged, &parts);
|
||||
pixman_region32_fini(&parts);
|
||||
}
|
||||
|
||||
|
|
|
@ -1805,6 +1805,7 @@ struct win *attr_ret_nonnull maybe_allocate_managed_win(session_t *ps, struct wi
|
|||
};
|
||||
win_set_properties_stale(new, init_stale_props, ARR_SIZE(init_stale_props));
|
||||
c2_window_state_init(ps->c2_state, &new->c2_state);
|
||||
pixman_region32_init(&new->damaged);
|
||||
|
||||
return &new->base;
|
||||
}
|
||||
|
@ -2179,6 +2180,7 @@ void destroy_win_finish(session_t *ps, struct win *w) {
|
|||
w2->prev_trans = NULL;
|
||||
}
|
||||
}
|
||||
pixman_region32_fini(&mw->damaged);
|
||||
}
|
||||
|
||||
free(w);
|
||||
|
|
|
@ -299,6 +299,9 @@ struct managed_win {
|
|||
/// Background texture of the window
|
||||
glx_texture_t *glx_texture_bg;
|
||||
#endif
|
||||
|
||||
/// The damaged region of the window, in window local coordinates.
|
||||
region_t damaged;
|
||||
};
|
||||
|
||||
/// Process pending updates/images flags on a window. Has to be called in X critical
|
||||
|
|
Loading…
Reference in New Issue