summaryrefslogtreecommitdiff
path: root/src/sna/sna_damage.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-24 02:49:24 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-24 02:59:21 +0000
commit098592ca5d79af2e4bdcd82ee598c4b2ba08df6b (patch)
tree4f99ddefbd2d23de1893814bb82df139c58bb810 /src/sna/sna_damage.h
parent73df0c7ab7c3a9edf0be2439c7e7ab07c0d75ecf (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_damage.h')
-rw-r--r--src/sna/sna_damage.h16
1 files changed, 9 insertions, 7 deletions
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 &&