Eliminate all the composite methods.
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Tue, 15 Sep 2009 04:48:12 +0000 (00:48 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Sun, 14 Feb 2010 16:12:38 +0000 (11:12 -0500)
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().

pixman/pixman-arm-neon.c
pixman/pixman-arm-simd.c
pixman/pixman-fast-path.c
pixman/pixman-general.c
pixman/pixman-implementation.c
pixman/pixman-mmx.c
pixman/pixman-private.h
pixman/pixman-sse2.c
pixman/pixman.c

index c0a75d5..557301e 100644 (file)
@@ -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;
 
index 965f810..09a2888 100644 (file)
@@ -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;
 }
index 642848e..4d26b0f 100644 (file)
@@ -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;
index 32afd2e..bddf79a 100644 (file)
@@ -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;
 
index ca1e18f..bc3749e 100644 (file)
 #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,
index 9bbe317..e084e7f 100644 (file)
@@ -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;
 
index 8d29010..435d195 100644 (file)
@@ -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,
index 85fb897..c8481dc 100644 (file)
@@ -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;
 
index f70823e..c49a50b 100644 (file)
@@ -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,