diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-16 18:57:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-16 19:21:47 +0100 |
commit | df1b117dedfdda425fbc3e4ee394169902df4716 (patch) | |
tree | 3aecfccff04f30af582cba705b0a53d828bd2fb8 | |
parent | 76ff3c715cf6059316d08217e7e7783ca0388393 (diff) |
sna/accel: convert TRANSLATE_BOX to an inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 7b3bef92..e3adf017 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -833,16 +833,18 @@ static inline void clip_box(BoxPtr box, GCPtr gc) box->y2 = clip->y2; } -#define TRANSLATE_BOX(box, d) do { \ - box.x1 += d->x; \ - box.x2 += d->x; \ - box.y1 += d->y; \ - box.y2 += d->y; \ -} while (0) +static inline void translate_box(BoxPtr box, DrawablePtr d) +{ + box->x1 += d->x; + box->x2 += d->x; + + box->y1 += d->y; + box->y2 += d->y; +} #define TRIM_AND_TRANSLATE_BOX(box, d, gc) do { \ trim_box(&box, d); \ - TRANSLATE_BOX(box, d); \ + translate_box(&box, d); \ clip_box(&box, gc); \ } while (0) @@ -1555,7 +1557,7 @@ sna_spans_extents(DrawablePtr drawable, GCPtr gc, if (gc) { if (!gc->miTranslate) - TRANSLATE_BOX(box, drawable); + translate_box(&box, drawable); clip_box(&box, gc); } *out = box; @@ -2780,7 +2782,7 @@ sna_image_glyph(DrawablePtr drawable, GCPtr gc, trim_box(&box, drawable); if (box_empty(&box)) return; - TRANSLATE_BOX(box, drawable); + translate_box(&box, drawable); DBG(("%s: extents(%d, %d), (%d, %d)\n", __FUNCTION__, box.x1, box.y1, box.x2, box.y2)); @@ -2819,7 +2821,7 @@ sna_poly_glyph(DrawablePtr drawable, GCPtr gc, trim_box(&box, drawable); if (box_empty(&box)) return; - TRANSLATE_BOX(box, drawable); + translate_box(&box, drawable); DBG(("%s: extents(%d, %d), (%d, %d)\n", __FUNCTION__, box.x1, box.y1, box.x2, box.y2)); |