[Pixman] [PATCH 06/32] pixman-fast-path: Add over_n_8888 fast path

Ben Avison bavison at riscosopen.org
Thu Aug 7 09:50:02 PDT 2014


This is a C fast path, useful for reference or for platforms that don't
have their own fast path for this operation.

lowlevel-blt-bench results on ARMv6:

    Before          After
    Mean   StdDev   Mean   StdDev  Confidence  Change
L1  11.9   0.1      20.4   0.2     100.0%      +71.1%
L2  10.6   0.2      16.5   0.4     100.0%      +55.8%
M   9.4    0.0      13.5   0.0     100.0%      +44.3%
HT  8.4    0.0      12.2   0.1     100.0%      +43.9%
VT  8.3    0.0      11.9   0.1     100.0%      +42.7%
R   8.1    0.0      11.5   0.1     100.0%      +41.3%
RT  5.4    0.1      7.6    0.1     100.0%      +40.3%
---
 pixman/pixman-fast-path.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index c6e43de..0f330da 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1122,6 +1122,37 @@ fast_composite_over_n_1_0565 (pixman_implementation_t *imp,
     }
 }
 
+static void
+fast_composite_over_n_8888 (pixman_implementation_t *imp,
+                            pixman_composite_info_t *info)
+{
+    PIXMAN_COMPOSITE_ARGS (info);
+    uint32_t  src;
+    uint32_t *dst_line, *dst;
+    int       dst_stride;
+    int32_t   w;
+
+    src = _pixman_image_get_solid (imp, src_image, dest_image->bits.format);
+
+    if (src == 0)
+        return;
+
+    PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint32_t, dst_stride, dst_line, 1);
+
+    while (height--)
+    {
+        dst = dst_line;
+        dst_line += dst_stride;
+        w = width;
+
+        while (w--)
+        {
+            *dst = over (src, *dst);
+            dst++;
+        }
+    }
+}
+
 /*
  * Simple bitblt
  */
@@ -1838,9 +1869,13 @@ static const pixman_fast_path_t c_fast_paths[] =
     PIXMAN_STD_FAST_PATH (OVER, x8r8g8b8, a8, a8r8g8b8, fast_composite_over_x888_8_8888),
     PIXMAN_STD_FAST_PATH (OVER, x8b8g8r8, a8, x8b8g8r8, fast_composite_over_x888_8_8888),
     PIXMAN_STD_FAST_PATH (OVER, x8b8g8r8, a8, a8b8g8r8, fast_composite_over_x888_8_8888),
+    PIXMAN_STD_FAST_PATH (OVER, solid, null, a8r8g8b8, fast_composite_over_n_8888),
+    PIXMAN_STD_FAST_PATH (OVER, solid, null, x8r8g8b8, fast_composite_over_n_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, a8r8g8b8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, x8r8g8b8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, r5g6b5, fast_composite_over_8888_0565),
+    PIXMAN_STD_FAST_PATH (OVER, solid, null, a8b8g8r8, fast_composite_over_n_8888),
+    PIXMAN_STD_FAST_PATH (OVER, solid, null, x8b8g8r8, fast_composite_over_n_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, a8b8g8r8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, x8b8g8r8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, b5g6r5, fast_composite_over_8888_0565),
-- 
1.7.5.4



More information about the Pixman mailing list