From df1b117dedfdda425fbc3e4ee394169902df4716 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 16 Jun 2011 18:57:38 +0100 Subject: [PATCH] sna/accel: convert TRANSLATE_BOX to an inline function Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 22 ++++++++++++---------- 1 file 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));