diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-09-15 00:48:12 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2010-02-14 11:12:38 -0500 |
commit | fa4df6225d4fa0b740c0ce69361e2f7cee1686f9 (patch) | |
tree | 7ee619cd62723df8fc2ec1e70ad7ea3c6c81468c | |
parent | c3d7b5125585a7d974ccd904100777a0e18d425f (diff) |
Eliminate all the composite methods.
They are no longer necessary because we will just walk the fast path
tables, and the general composite path is treated as another fast
path.
This unfortunately means that sse2_composite() can no longer be
responsible for realigning the stack to 16 bytes, so we have to move
that to pixman_image_composite().
-rw-r--r-- | pixman/pixman-arm-neon.c | 34 | ||||
-rw-r--r-- | pixman/pixman-arm-simd.c | 35 | ||||
-rw-r--r-- | pixman/pixman-fast-path.c | 34 | ||||
-rw-r--r-- | pixman/pixman-general.c | 28 | ||||
-rw-r--r-- | pixman/pixman-implementation.c | 46 | ||||
-rw-r--r-- | pixman/pixman-mmx.c | 32 | ||||
-rw-r--r-- | pixman/pixman-private.h | 18 | ||||
-rw-r--r-- | pixman/pixman-sse2.c | 56 | ||||
-rw-r--r-- | pixman/pixman.c | 19 |
9 files changed, 20 insertions, 282 deletions
diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c index c0a75d58..557301e3 100644 --- a/pixman/pixman-arm-neon.c +++ b/pixman/pixman-arm-neon.c @@ -435,39 +435,6 @@ static const pixman_fast_path_t arm_neon_fast_paths[] = { PIXMAN_OP_NONE }, }; -static void -arm_neon_composite (pixman_implementation_t *imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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) -{ - if (_pixman_run_fast_path (arm_neon_fast_paths, imp, - op, src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height)) - { - return; - } - - _pixman_implementation_composite (imp->delegate, op, - src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height); -} - static pixman_bool_t arm_neon_blt (pixman_implementation_t *imp, uint32_t * src_bits, @@ -555,7 +522,6 @@ _pixman_implementation_create_arm_neon (void) imp->combine_32[PIXMAN_OP_OVER] = neon_combine_over_u; imp->combine_32[PIXMAN_OP_ADD] = neon_combine_add_u; - imp->composite = arm_neon_composite; imp->blt = arm_neon_blt; imp->fill = arm_neon_fill; diff --git a/pixman/pixman-arm-simd.c b/pixman/pixman-arm-simd.c index 965f810b..09a28883 100644 --- a/pixman/pixman-arm-simd.c +++ b/pixman/pixman-arm-simd.c @@ -438,46 +438,11 @@ static const pixman_fast_path_t arm_simd_fast_paths[] = { PIXMAN_OP_NONE }, }; -static void -arm_simd_composite (pixman_implementation_t *imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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) -{ - if (_pixman_run_fast_path (arm_simd_fast_paths, imp, - op, src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height)) - { - return; - } - - _pixman_implementation_composite (imp->delegate, op, - src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height); -} - pixman_implementation_t * _pixman_implementation_create_arm_simd (void) { pixman_implementation_t *general = _pixman_implementation_create_fast_path (); pixman_implementation_t *imp = _pixman_implementation_create (general, arm_simd_fast_paths); - imp->composite = arm_simd_composite; - return imp; } diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index 642848ef..4d26b0fa 100644 --- a/pixman/pixman-fast-path.c +++ b/pixman/pixman-fast-path.c @@ -1627,39 +1627,6 @@ static const pixman_fast_path_t c_fast_paths[] = }; static void -fast_path_composite (pixman_implementation_t *imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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) -{ - if (_pixman_run_fast_path (c_fast_paths, imp, - op, src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height)) - { - return; - } - - _pixman_implementation_composite (imp->delegate, op, - src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height); -} - -static void pixman_fill8 (uint32_t *bits, int stride, int x, @@ -1772,7 +1739,6 @@ _pixman_implementation_create_fast_path (void) pixman_implementation_t *general = _pixman_implementation_create_general (); pixman_implementation_t *imp = _pixman_implementation_create (general, c_fast_paths); - imp->composite = fast_path_composite; imp->fill = fast_path_fill; return imp; diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c index 32afd2e4..bddf79aa 100644 --- a/pixman/pixman-general.c +++ b/pixman/pixman-general.c @@ -270,33 +270,6 @@ static const pixman_fast_path_t general_fast_path[] = { PIXMAN_OP_NONE } }; -static void -general_composite (pixman_implementation_t * imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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_bool_t result; - - result = _pixman_run_fast_path (general_fast_path, imp, - op, src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height); - - assert (result); -} - static pixman_bool_t general_blt (pixman_implementation_t *imp, uint32_t * src_bits, @@ -339,7 +312,6 @@ _pixman_implementation_create_general (void) _pixman_setup_combiner_functions_32 (imp); _pixman_setup_combiner_functions_64 (imp); - imp->composite = general_composite; imp->blt = general_blt; imp->fill = general_fill; diff --git a/pixman/pixman-implementation.c b/pixman/pixman-implementation.c index ca1e18f3..bc3749ef 100644 --- a/pixman/pixman-implementation.c +++ b/pixman/pixman-implementation.c @@ -28,30 +28,6 @@ #include "pixman-private.h" static void -delegate_composite (pixman_implementation_t * imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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_implementation_composite (imp->delegate, - op, - src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height); -} - -static void delegate_combine_32 (pixman_implementation_t * imp, pixman_op_t op, uint32_t * dest, @@ -155,7 +131,6 @@ _pixman_implementation_create (pixman_implementation_t *delegate, /* Fill out function pointers with ones that just delegate */ - imp->composite = delegate_composite; imp->blt = delegate_blt; imp->fill = delegate_fill; @@ -216,27 +191,6 @@ _pixman_implementation_combine_64_ca (pixman_implementation_t * imp, (*imp->combine_64_ca[op]) (imp, op, dest, src, mask, width); } -void -_pixman_implementation_composite (pixman_implementation_t * imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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) -{ - (*imp->composite) (imp, op, - src, mask, dest, - src_x, src_y, mask_x, mask_y, dest_x, dest_y, - width, height); -} - pixman_bool_t _pixman_implementation_blt (pixman_implementation_t * imp, uint32_t * src_bits, diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 9bbe3179..e084e7ff 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -3288,37 +3288,6 @@ static const pixman_fast_path_t mmx_fast_paths[] = { PIXMAN_OP_NONE }, }; -static void -mmx_composite (pixman_implementation_t *imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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) -{ - if (_pixman_run_fast_path (mmx_fast_paths, imp, - op, src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height)) - { - return; - } - - _pixman_implementation_composite (imp->delegate, - op, src, mask, dest, src_x, src_y, - mask_x, mask_y, dest_x, dest_y, - width, height); -} - static pixman_bool_t mmx_blt (pixman_implementation_t *imp, uint32_t * src_bits, @@ -3398,7 +3367,6 @@ _pixman_implementation_create_mmx (void) imp->combine_32_ca[PIXMAN_OP_XOR] = mmx_combine_xor_ca; imp->combine_32_ca[PIXMAN_OP_ADD] = mmx_combine_add_ca; - imp->composite = mmx_composite; imp->blt = mmx_blt; imp->fill = mmx_fill; diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 8d290106..435d1955 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -444,8 +444,7 @@ struct pixman_implementation_t pixman_implementation_t * toplevel; pixman_implementation_t * delegate; const pixman_fast_path_t * fast_paths; - - pixman_composite_func_t composite; + pixman_blt_func_t blt; pixman_fill_func_t fill; @@ -487,21 +486,6 @@ _pixman_implementation_combine_64_ca (pixman_implementation_t *imp, const uint64_t * src, const uint64_t * mask, int width); -void -_pixman_implementation_composite (pixman_implementation_t *imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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_bool_t _pixman_implementation_blt (pixman_implementation_t *imp, diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 85fb8971..c8481dc0 100644 --- a/pixman/pixman-sse2.c +++ b/pixman/pixman-sse2.c @@ -5842,61 +5842,6 @@ static const pixman_fast_path_t sse2_fast_paths[] = { PIXMAN_OP_NONE }, }; -/* - * Work around GCC bug causing crashes in Mozilla with SSE2 - * - * When using -msse, gcc generates movdqa instructions assuming that - * the stack is 16 byte aligned. Unfortunately some applications, such - * as Mozilla and Mono, end up aligning the stack to 4 bytes, which - * causes the movdqa instructions to fail. - * - * The __force_align_arg_pointer__ makes gcc generate a prologue that - * realigns the stack pointer to 16 bytes. - * - * On x86-64 this is not necessary because the standard ABI already - * calls for a 16 byte aligned stack. - * - * See https://bugs.freedesktop.org/show_bug.cgi?id=15693 - */ -#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) -__attribute__((__force_align_arg_pointer__)) -#endif -static void -sse2_composite (pixman_implementation_t *imp, - pixman_op_t op, - pixman_image_t * src, - pixman_image_t * mask, - pixman_image_t * dest, - 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) -{ - if (_pixman_run_fast_path (sse2_fast_paths, imp, - op, src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height)) - { - return; - } - - _pixman_implementation_composite (imp->delegate, op, - src, mask, dest, - src_x, src_y, - mask_x, mask_y, - dest_x, dest_y, - width, height); -} - -#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) -__attribute__((__force_align_arg_pointer__)) -#endif static pixman_bool_t sse2_blt (pixman_implementation_t *imp, uint32_t * src_bits, @@ -6014,7 +5959,6 @@ _pixman_implementation_create_sse2 (void) imp->combine_32_ca[PIXMAN_OP_XOR] = sse2_combine_xor_ca; imp->combine_32_ca[PIXMAN_OP_ADD] = sse2_combine_add_ca; - imp->composite = sse2_composite; imp->blt = sse2_blt; imp->fill = sse2_fill; diff --git a/pixman/pixman.c b/pixman/pixman.c index f70823e9..c49a50b8 100644 --- a/pixman/pixman.c +++ b/pixman/pixman.c @@ -154,6 +154,25 @@ unapply_workaround (pixman_image_t *image, uint32_t *bits, int dx, int dy) pixman_region32_translate (&image->common.clip_region, dx, dy); } +/* + * Work around GCC bug causing crashes in Mozilla with SSE2 + * + * When using -msse, gcc generates movdqa instructions assuming that + * the stack is 16 byte aligned. Unfortunately some applications, such + * as Mozilla and Mono, end up aligning the stack to 4 bytes, which + * causes the movdqa instructions to fail. + * + * The __force_align_arg_pointer__ makes gcc generate a prologue that + * realigns the stack pointer to 16 bytes. + * + * On x86-64 this is not necessary because the standard ABI already + * calls for a 16 byte aligned stack. + * + * See https://bugs.freedesktop.org/show_bug.cgi?id=15693 + */ +#if defined (USE_SSE2) && defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) +__attribute__((__force_align_arg_pointer__)) +#endif PIXMAN_EXPORT void pixman_image_composite (pixman_op_t op, pixman_image_t * src, |