Add _pixman_choose_implementation
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Wed, 13 May 2009 13:26:42 +0000 (09:26 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Sat, 23 May 2009 16:05:01 +0000 (12:05 -0400)
pixman/pixman-cpu.c
pixman/pixman-pict.c
pixman/pixman-private.h

index dc68b31..96c62a6 100644 (file)
@@ -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);
+}
+
+
index 18ec4f8..2c738f3 100644 (file)
@@ -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,
index c5e9288..8694501 100644 (file)
@@ -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 */