From bee5549f6b469989a45cb3bcd4a916a6799c182d Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Wed, 13 May 2009 09:26:42 -0400 Subject: [PATCH] Add _pixman_choose_implementation --- pixman/pixman-cpu.c | 16 ++++++++++++++++ pixman/pixman-pict.c | 2 +- pixman/pixman-private.h | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c index dc68b31..96c62a6 100644 --- a/pixman/pixman-cpu.c +++ b/pixman/pixman-cpu.c @@ -496,3 +496,19 @@ pixman_have_sse2 (void) #endif /* __amd64__ */ #endif + +pixman_implementation_t * +_pixman_choose_implementation (void) +{ +#ifdef USE_SSE2 + if (pixman_have_sse2 ()) + return _pixman_implementation_create_sse2 (NULL); +#endif +#ifdef USE_MMX + if (pixman_have_mmx()) + return _pixman_implementation_create_mmx (NULL); +#endif + return _pixman_implementation_create_fast_path (NULL); +} + + diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c index 18ec4f8..2c738f3 100644 --- a/pixman/pixman-pict.c +++ b/pixman/pixman-pict.c @@ -127,7 +127,7 @@ pixman_image_composite (pixman_op_t op, return; if (!imp) - imp = _pixman_implementation_create_fast_path (NULL); + imp = _pixman_choose_implementation(); _pixman_implementation_composite (imp, op, src, mask, dest, diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index c5e9288..8694501 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -1021,4 +1021,7 @@ _pixman_lookup_fast_path (const FastPathInfo *paths, int32_t mask_x, int32_t mask_y); +pixman_implementation_t * +_pixman_choose_implementation (void); + #endif /* PIXMAN_PRIVATE_H */ -- 2.7.4