From 098592ca5d79af2e4bdcd82ee598c4b2ba08df6b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 24 Dec 2011 02:49:24 +0000 Subject: sna: Remove the independent tracking of elts from boxes Following the switch to a global mode for damage, the elts array became redundant and all that is required is the list of boxes. Signed-off-by: Chris Wilson --- src/sna/sna_damage.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/sna/sna_damage.h') diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h index 0e681b79..d74d5de4 100644 --- a/src/sna/sna_damage.h +++ b/src/sna/sna_damage.h @@ -6,7 +6,6 @@ #include "compiler.h" -struct sna_damage_elt; struct sna_damage_box; struct sna_damage { @@ -17,10 +16,13 @@ struct sna_damage { DAMAGE_SUBTRACT, DAMAGE_ALL, } mode; - int n, size; - struct sna_damage_elt *elts; - struct sna_damage_box *last_box; - struct list boxes; + int remain, dirty; + BoxPtr box; + struct { + struct list list; + int size; + BoxRec box[8]; + } embedded_box; }; fastcall struct sna_damage *_sna_damage_add(struct sna_damage *damage, @@ -133,7 +135,7 @@ static inline void sna_damage_reduce(struct sna_damage **damage) if (*damage == NULL) return; - if ((*damage)->n) + if ((*damage)->dirty) *damage = _sna_damage_reduce(*damage); } @@ -145,7 +147,7 @@ static inline void sna_damage_reduce_all(struct sna_damage **damage, if (*damage == NULL) return; - if ((*damage)->n && (*damage = _sna_damage_reduce(*damage)) == NULL) + if ((*damage)->dirty && (*damage = _sna_damage_reduce(*damage)) == NULL) return; if ((*damage)->mode == DAMAGE_ADD && -- cgit v1.2.3