summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-30 15:24:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-30 15:24:21 +0000
commit23b314729c43101e515e2625db2a2401c72c2596 (patch)
tree22bcf7f9f5a758e16d2243ce060992dd8eb90ed2
parent427622aca31b7463eb2dcd52e352dc8997e84baa (diff)
sna: Rewrite box32_add_rect() to enable int32_t promotion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index d227184c..36665448 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1077,15 +1077,17 @@ static inline void box32_add_rect(Box32Rec *box, const xRectangle *r)
{
int32_t v;
- if (box->x1 > r->x)
- box->x1 = r->x;
- v = r->x + r->width;
+ v = r->x;
+ if (box->x1 > v)
+ box->x1 = v;
+ v += r->width;
if (box->x2 < v)
box->x2 = v;
- if (box->y1 > r->y)
- box->y1 = r->y;
- v = r->y + r->height;
+ v = r->y;
+ if (box->y1 > v)
+ box->y1 = ;
+ v += r->height;
if (box->y2 < v)
box->y2 = v;
}