[Pixman] [PATCH 2/2] sse2: Support 8-bpp blt

Chris Wilson chris at chris-wilson.co.uk
Wed May 4 00:22:03 PDT 2011


---
 pixman/pixman-sse2.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index c39930e..c5cc807 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -4696,7 +4696,14 @@ pixman_blt_sse2 (uint32_t *src_bits,
     if (src_bpp != dst_bpp)
 	return FALSE;
 
-    if (src_bpp == 16)
+    if (src_bpp == 8)
+    {
+	src_stride = src_stride * (int) sizeof (uint32_t);
+	dst_stride = dst_stride * (int) sizeof (uint32_t);
+	src_bytes = ((uint8_t *)src_bits) + src_stride * (src_y) + (src_x);
+	dst_bytes = ((uint8_t *)dst_bits) + dst_stride * (dst_y) + (dst_x);
+    }
+    else if (src_bpp == 16)
     {
 	src_stride = src_stride * (int) sizeof (uint32_t) / 2;
 	dst_stride = dst_stride * (int) sizeof (uint32_t) / 2;
@@ -4735,6 +4742,14 @@ pixman_blt_sse2 (uint32_t *src_bits,
 	dst_bytes += dst_stride;
 	w = width;
 
+	while (w >= 1 && ((unsigned long)d & 1))
+	{
+	    *(uint8_t *)d = *(uint8_t *)s;
+	    w -= 1;
+	    s += 1;
+	    d += 1;
+	}
+
 	while (w >= 2 && ((unsigned long)d & 3))
 	{
 	    *(uint16_t *)d = *(uint16_t *)s;
@@ -4796,6 +4811,14 @@ pixman_blt_sse2 (uint32_t *src_bits,
 	    s += 2;
 	    d += 2;
 	}
+
+	if (w >= 1)
+	{
+	    *(uint8_t *)d = *(uint8_t *)s;
+	    w -= 1;
+	    s += 1;
+	    d += 1;
+	}
     }
 
 
-- 
1.7.4.4



More information about the Pixman mailing list