[Pixman] [PATCH 08/32] pixman-fast-path: Add over_n_0565 fast path

Ben Avison bavison at riscosopen.org
Thu Aug 7 09:50:04 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  8.2    0.0      11.3   0.1     100.0%      +38.6%
L2  7.9    0.1      10.5   0.0     100.0%      +33.3%
M   7.3    0.0      10.0   0.0     100.0%      +36.7%
HT  6.9    0.0      9.2    0.0     100.0%      +33.3%
VT  6.8    0.0      9.0    0.0     100.0%      +32.1%
R   6.6    0.1      8.8    0.0     100.0%      +31.8%
RT  4.5    0.1      6.3    0.1     100.0%      +39.7%
---
 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 0f330da..c7ed0f0 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -1035,6 +1035,39 @@ fast_composite_over_n_1_8888 (pixman_implementation_t *imp,
 }
 
 static void
+fast_composite_over_n_0565 (pixman_implementation_t *imp,
+                            pixman_composite_info_t *info)
+{
+    PIXMAN_COMPOSITE_ARGS (info);
+    uint32_t  src;
+    uint16_t *dst_line, *dst;
+    int       dst_stride;
+    int32_t   w;
+    uint32_t  d;
+
+    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, uint16_t, dst_stride, dst_line, 1);
+
+    while (height--)
+    {
+        dst = dst_line;
+        dst_line += dst_stride;
+        w = width;
+
+        while (w--)
+        {
+            d = over (src, convert_0565_to_0888 (*dst));
+            *dst = convert_8888_to_0565 (d);
+            dst++;
+        }
+    }
+}
+
+static void
 fast_composite_over_n_1_0565 (pixman_implementation_t *imp,
                               pixman_composite_info_t *info)
 {
@@ -1845,6 +1878,8 @@ FAST_SIMPLE_ROTATE (8888, uint32_t)
 
 static const pixman_fast_path_t c_fast_paths[] =
 {
+    PIXMAN_STD_FAST_PATH (OVER, solid, null, r5g6b5, fast_composite_over_n_0565),
+    PIXMAN_STD_FAST_PATH (OVER, solid, null, b5g6r5, fast_composite_over_n_0565),
     PIXMAN_STD_FAST_PATH (OVER, solid, a8, r5g6b5, fast_composite_over_n_8_0565),
     PIXMAN_STD_FAST_PATH (OVER, solid, a8, b5g6r5, fast_composite_over_n_8_0565),
     PIXMAN_STD_FAST_PATH (OVER, solid, a8, r8g8b8, fast_composite_over_n_8_0888),
-- 
1.7.5.4



More information about the Pixman mailing list