diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-03-25 15:09:17 -0400 |
---|---|---|
committer | Søren Sandmann <sandmann@cs.au.dk> | 2011-06-20 02:03:23 -0400 |
commit | a89f8cfaf11d0149b73ce40eca6e8a7f262f305a (patch) | |
tree | 37b27df25cc408028c54dba29ab7de90c1be6e69 /test | |
parent | 99e7d8fab546257ef729ea6db6e9beede984cec1 (diff) | |
download | pixman-a89f8cfaf11d0149b73ce40eca6e8a7f262f305a.tar.gz |
Replace argumentxs to composite functions with a pointer to a struct
This allows more information, such as flags or the composite region,
to be passed to the composite functions.
Diffstat (limited to 'test')
-rw-r--r-- | test/lowlevel-blt-bench.c | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c index 67c845f..d58587d 100644 --- a/test/lowlevel-blt-bench.c +++ b/test/lowlevel-blt-bench.c @@ -89,40 +89,56 @@ bench_memcpy () static void pixman_image_composite_wrapper (pixman_implementation_t *impl, - pixman_op_t op, - pixman_image_t * src_image, - pixman_image_t * mask_image, - pixman_image_t * dst_image, - int32_t src_x, - int32_t src_y, - int32_t mask_x, - int32_t mask_y, - int32_t dest_x, - int32_t dest_y, - int32_t width, - int32_t height) + pixman_composite_info_t *info) { - pixman_image_composite (op, src_image, mask_image, dst_image, src_x, - src_y, mask_x, mask_y, dest_x, dest_y, width, height); + pixman_image_composite (info->op, + info->src_image, info->mask_image, info->dest_image, + info->src_x, info->src_y, + info->mask_x, info->mask_y, + info->dest_x, info->dest_y, + info->width, info->height); } static void pixman_image_composite_empty (pixman_implementation_t *impl, - pixman_op_t op, - pixman_image_t * src_image, - pixman_image_t * mask_image, - pixman_image_t * dst_image, - int32_t src_x, - int32_t src_y, - int32_t mask_x, - int32_t mask_y, - int32_t dest_x, - int32_t dest_y, - int32_t width, - int32_t height) + pixman_composite_info_t *info) { - pixman_image_composite (op, src_image, mask_image, dst_image, 0, - 0, 0, 0, 0, 0, 1, 1); + pixman_image_composite (info->op, + info->src_image, info->mask_image, info->dest_image, + 0, 0, 0, 0, 0, 0, 1, 1); +} + +static inline void +call_func (pixman_composite_func_t func, + pixman_op_t op, + pixman_image_t * src_image, + pixman_image_t * mask_image, + pixman_image_t * dest_image, + int32_t src_x, + int32_t src_y, + int32_t mask_x, + int32_t mask_y, + int32_t dest_x, + int32_t dest_y, + int32_t width, + int32_t height) +{ + pixman_composite_info_t info; + + info.op = op; + info.src_image = src_image; + info.mask_image = mask_image; + info.dest_image = dest_image; + info.src_x = src_x; + info.src_y = src_y; + info.mask_x = mask_x; + info.mask_y = mask_y; + info.dest_x = dest_x; + info.dest_y = dest_y; + info.width = width; + info.height = height; + + func (0, &info); } void @@ -150,7 +166,7 @@ bench_L (pixman_op_t op, } if (++x >= 64) x = 0; - func (0, op, src_img, mask_img, dst_img, x, 0, x, 0, 63 - x, 0, width, lines_count); + call_func (func, op, src_img, mask_img, dst_img, x, 0, x, 0, 63 - x, 0, width, lines_count); } qx = q; } @@ -171,7 +187,7 @@ bench_M (pixman_op_t op, { if (++x >= 64) x = 0; - func (0, op, src_img, mask_img, dst_img, x, 0, x, 0, 1, 0, WIDTH - 64, HEIGHT); + call_func (func, op, src_img, mask_img, dst_img, x, 0, x, 0, 1, 0, WIDTH - 64, HEIGHT); } } @@ -203,7 +219,7 @@ bench_HT (pixman_op_t op, { y = 0; } - func (0, op, src_img, mask_img, dst_img, x, y, x, y, x, y, w, h); + call_func (func, op, src_img, mask_img, dst_img, x, y, x, y, x, y, w, h); x += w; pix_cnt += w * h; } @@ -238,7 +254,7 @@ bench_VT (pixman_op_t op, { x = 0; } - func (0, op, src_img, mask_img, dst_img, x, y, x, y, x, y, w, h); + call_func (func, op, src_img, mask_img, dst_img, x, y, x, y, x, y, w, h); y += h; pix_cnt += w * h; } @@ -274,7 +290,7 @@ bench_R (pixman_op_t op, int sy = rand () % (maxh - TILEWIDTH * 2); int dx = rand () % (maxw - TILEWIDTH * 2); int dy = rand () % (maxh - TILEWIDTH * 2); - func (0, op, src_img, mask_img, dst_img, sx, sy, sx, sy, dx, dy, w, h); + call_func (func, op, src_img, mask_img, dst_img, sx, sy, sx, sy, dx, dy, w, h); pix_cnt += w * h; } return pix_cnt; @@ -309,7 +325,7 @@ bench_RT (pixman_op_t op, int sy = rand () % (maxh - TINYWIDTH * 2); int dx = rand () % (maxw - TINYWIDTH * 2); int dy = rand () % (maxh - TINYWIDTH * 2); - func (0, op, src_img, mask_img, dst_img, sx, sy, sx, sy, dx, dy, w, h); + call_func (func, op, src_img, mask_img, dst_img, sx, sy, sx, sy, dx, dy, w, h); pix_cnt += w * h; } return pix_cnt; |