diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-11 10:08:42 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-11 10:56:38 +0100 |
commit | 208fa8e6b88daf8446239a1a001a68ceb7d02e76 (patch) | |
tree | 2d6a0869a862f8014f442f132d4ca936d4bbe6f1 | |
parent | 5050fead0ef81785a2a9be735852921463377e04 (diff) |
sna/trapezoid: Perform the NULL check for damage in the caller
Save the function call overhead in the common case.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_trapezoids.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 86593a9b..b0331cb2 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -110,13 +110,10 @@ static void apply_damage(struct sna_composite_op *op, RegionPtr region) sna_damage_add(op->damage, region); } -static void apply_damage_box(struct sna_composite_op *op, const BoxRec *box) +static void _apply_damage_box(struct sna_composite_op *op, const BoxRec *box) { BoxRec r; - if (op->damage == NULL) - return; - r.x1 = box->x1 + op->dst.x; r.x2 = box->x2 + op->dst.x; r.y1 = box->y1 + op->dst.y; @@ -126,6 +123,12 @@ static void apply_damage_box(struct sna_composite_op *op, const BoxRec *box) sna_damage_add_box(op->damage, &r); } +inline static void apply_damage_box(struct sna_composite_op *op, const BoxRec *box) +{ + if (op->damage) + _apply_damage_box(op, box); +} + typedef int grid_scaled_x_t; typedef int grid_scaled_y_t; |