Make buffer age not glx specific

Buffer age is not a glx specific concept. xrender backend can have
buffer age too, if double buffering is used (required if we want to use
Present). So, make buffer age a generic concept in compton is required
for further backend improvements.

Moved buffer age based damage aggragation out of glx as well.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-01-08 23:15:00 +00:00
parent 377b18a00f
commit e80ff8530e
6 changed files with 180 additions and 283 deletions

View File

@ -427,9 +427,11 @@ typedef struct session {
/// Program start time.
struct timeval time_start;
/// The region needs to painted on next paint.
region_t all_damage;
region_t *damage;
/// The region damaged on the last paint.
region_t all_damage_last[CGLX_MAX_BUFFER_AGE];
region_t *damage_ring;
/// Number of damage regions we track
int ndamage;
/// Whether all windows are currently redirected.
bool redirected;
/// Pre-generated alpha pictures.
@ -897,15 +899,6 @@ find_focused(session_t *ps) {
return NULL;
}
/**
* Free all regions in ps->all_damage_last .
*/
static inline void
free_all_damage_last(session_t *ps) {
for (int i = 0; i < CGLX_MAX_BUFFER_AGE; ++i)
pixman_region32_clear(&ps->all_damage_last[i]);
}
/**
* Check if a rectangle includes the whole screen.
*/