pixman: Branch 'master' - 4 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Mon Jun 22 13:34:47 PDT 2009


 pixman/pixman-fast-path.c |   54 +++++++++++-----------------------------------
 pixman/pixman-mmx.c       |   16 +++++--------
 pixman/pixman-private.h   |   19 ++++------------
 3 files changed, 26 insertions(+), 63 deletions(-)

New commits:
commit 7bb9df038293b591e687cbf3a9830476bef7f9fc
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Mon Jun 22 16:34:15 2009 -0400

    Fix typo in CLIP macro.

diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index b8c4232..8201545 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -706,7 +706,7 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst,
 /* Modulus that produces the remainder wrt. DIV */
 #define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
 
-#define CLIP(v,low,high) ((v) < (low) ? (low) : ((v) > (high) ? (high) : (high)))
+#define CLIP(v,low,high) ((v) < (low) ? (low) : ((v) > (high) ? (high) : (v)))
 
 
 /*
commit 63b050de5b2627aee0d75c66244e55757ba007ab
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Mon Jun 22 16:05:27 2009 -0400

    Turn the FbAdd() macro into an FbIntAdd() which doesn't take a channel.
    
    The only use of the channel argument could be written better with FbByteAdd().

diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 21d6dcb..53f57fd 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -880,8 +880,6 @@ fbCompositeSrcAdd_8888x8888 (pixman_implementation_t *imp,
     int	dstStride, srcStride;
     uint16_t	w;
     uint32_t	s, d;
-    uint16_t	t;
-    uint32_t	m,n,o,p;
 
     fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
     fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
@@ -903,13 +901,7 @@ fbCompositeSrcAdd_8888x8888 (pixman_implementation_t *imp,
 		{
 		    d = *dst;
 		    if (d)
-		    {
-			m = FbAdd(s,d,0,t);
-			n = FbAdd(s,d,8,t);
-			o = FbAdd(s,d,16,t);
-			p = FbAdd(s,d,24,t);
-			s = m|n|o|p;
-		    }
+			FbByteAdd(s,d);
 		}
 		*dst = s;
 	    }
@@ -964,7 +956,7 @@ fbCompositeSrcAdd_8888x8x8 (pixman_implementation_t *imp,
 	    d = *dst;
 
 	    m = FbIntMult (sa, a, tmp);
-	    r = FbAdd (m, d, 0, tmp);
+	    r = FbIntAdd (m, d, tmp);
 
 	    *dst++ = r;
 	}
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 762bf9a..fa1b6f1 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -2646,7 +2646,7 @@ fbCompositeSrcAdd_8888x8x8mmx (pixman_implementation_t *imp,
 	    d = *dst;
 
 	    m = FbIntMult (sa, a, tmp);
-	    r = FbAdd (m, d, 0, tmp);
+	    r = FbIntAdd (m, d, tmp);
 
 	    *dst++ = r;
 	}
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index a7ae410..b8c4232 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -310,6 +310,10 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t       *walker,
 #define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
 #define FbIntDiv(a,b)	 (((uint16_t) (a) * 255) / (b))
 
+#define FbIntAdd(x,y,t) (						\
+	(t) = x + y,							\
+	(uint32_t) (uint8_t) ((t) | (0 - ((t) >> 8))))
+
 #define FbGet8(v,i)   ((uint16_t) (uint8_t) ((v) >> i))
 
 
@@ -328,9 +332,6 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t       *walker,
  * this difference will have two versions using the same convention.
  */
 
-#define FbAdd(x,y,i,t)	((t) = FbGet8(x,i) + FbGet8(y,i),		\
-			 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
-
 #define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
 #define div_65535(x) (((x) + 0x8000 + (((x) + 0x8000) >> 16)) >> 16)
 
commit 026ef583288e1e63e5a84ba998aea2e674f02a17
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Mon Jun 22 15:58:28 2009 -0400

    Delete FbInU macro.
    
    Replace uses of it with FbIntMult().

diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index a2f82c3..21d6dcb 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -963,7 +963,7 @@ fbCompositeSrcAdd_8888x8x8 (pixman_implementation_t *imp,
 	    a = *mask++;
 	    d = *dst;
 
-	    m = FbInU (sa, 0, a, tmp);
+	    m = FbIntMult (sa, a, tmp);
 	    r = FbAdd (m, d, 0, tmp);
 
 	    *dst++ = r;
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 4ad2f3d..762bf9a 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -2497,15 +2497,13 @@ fbCompositeIn_nx8x8mmx (pixman_implementation_t *imp,
 	{
 	    uint16_t	tmp;
 	    uint8_t	a;
-	    uint32_t	m, d;
-	    uint32_t	r;
+	    uint32_t	m;
 
 	    a = *mask++;
-	    d = *dst;
-
-	    m = FbInU (sa, 0, a, tmp);
-	    r = FbInU (m, 0, d, tmp);
 
+	    m = FbIntMult (m, a, tmp);
+	    *dst = FbIntMult (m, *dst, tmp);
+	    
 	    *dst++ = r;
 	}
     }
@@ -2568,7 +2566,7 @@ fbCompositeIn_8x8mmx (pixman_implementation_t *imp,
 	    s = *src;
 	    d = *dst;
 
-	    *dst = FbInU (s, 0, d, tmp);
+	    *dst = FbIntMult (s, d, tmp);
 
 	    src++;
 	    dst++;
@@ -2647,7 +2645,7 @@ fbCompositeSrcAdd_8888x8x8mmx (pixman_implementation_t *imp,
 	    a = *mask++;
 	    d = *dst;
 
-	    m = FbInU (sa, 0, a, tmp);
+	    m = FbIntMult (sa, a, tmp);
 	    r = FbAdd (m, d, 0, tmp);
 
 	    *dst++ = r;
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index cbd31e0..a7ae410 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -328,8 +328,6 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t       *walker,
  * this difference will have two versions using the same convention.
  */
 
-#define FbInU(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),(a),(t)) << (i))
-
 #define FbAdd(x,y,i,t)	((t) = FbGet8(x,i) + FbGet8(y,i),		\
 			 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
 
commit 5028c1599ad9119dbb7b58d2f93e60c857aec769
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Mon Jun 22 15:21:40 2009 -0400

    Use fbOver() instead of fbOver24.
    
    fbOver() is faster anyway, and this lets us get rid of fbOverU.
    
    Also use FbByteMul() in fbIn instead of four times FbInU.
    
    Finally, delete FbOverC and FbInC since they weren't used.

diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 4c04d60..a2f82c3 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -85,30 +85,13 @@ fbOver (uint32_t src, uint32_t dest)
 }
 
 static uint32_t
-fbOver24 (uint32_t x, uint32_t y)
-{
-    uint16_t  a = ~x >> 24;
-    uint16_t  t;
-    uint32_t  m,n,o;
-
-    m = FbOverU(x,y,0,a,t);
-    n = FbOverU(x,y,8,a,t);
-    o = FbOverU(x,y,16,a,t);
-    return m|n|o;
-}
-
-static uint32_t
 fbIn (uint32_t x, uint8_t y)
 {
     uint16_t  a = y;
-    uint16_t  t;
-    uint32_t  m,n,o,p;
-
-    m = FbInU(x,0,a,t);
-    n = FbInU(x,8,a,t);
-    o = FbInU(x,16,a,t);
-    p = FbInU(x,24,a,t);
-    return m|n|o|p;
+
+    FbByteMul (x, a);
+
+    return x;
 }
 
 /*
@@ -116,7 +99,6 @@ fbIn (uint32_t x, uint8_t y)
  *
  *  opSRCxMASKxDST
  */
-
 static void
 fbCompositeOver_x888x8x8888 (pixman_implementation_t *imp,
 			     pixman_op_t      op,
@@ -486,13 +468,13 @@ fbCompositeSolidMask_nx8x0888 (pixman_implementation_t *imp,
 		else
 		{
 		    d = Fetch24(dst);
-		    d = fbOver24 (src, d);
+		    d = fbOver (src, d);
 		}
 		Store24(dst, d);
 	    }
 	    else if (m)
 	    {
-		d = fbOver24 (fbIn(src,m), Fetch24(dst));
+		d = fbOver (fbIn(src,m), Fetch24(dst));
 		Store24(dst, d);
 	    }
 	    dst += 3;
@@ -549,14 +531,14 @@ fbCompositeSolidMask_nx8x0565 (pixman_implementation_t *imp,
 		else
 		{
 		    d = *dst;
-		    d = fbOver24 (src, cvt0565to0888(d));
+		    d = fbOver (src, cvt0565to0888(d));
 		}
 		*dst = cvt8888to0565(d);
 	    }
 	    else if (m)
 	    {
 		d = *dst;
-		d = fbOver24 (fbIn(src,m), cvt0565to0888(d));
+		d = fbOver (fbIn(src,m), cvt0565to0888(d));
 		*dst = cvt8888to0565(d);
 	    }
 	    dst++;
@@ -619,7 +601,7 @@ fbCompositeSolidMask_nx8888x0565C (pixman_implementation_t *imp,
 		else
 		{
 		    d = *dst;
-		    d = fbOver24 (src, cvt0565to0888(d));
+		    d = fbOver (src, cvt0565to0888(d));
 		    *dst = cvt8888to0565(d);
 		}
 	    }
@@ -725,7 +707,7 @@ fbCompositeSrc_8888x0888 (pixman_implementation_t *imp,
 		if (a == 0xff)
 		    d = s;
 		else
-		    d = fbOver24 (s, Fetch24(dst));
+		    d = fbOver (s, Fetch24(dst));
 
 		Store24(dst, d);
 	    }
@@ -778,7 +760,7 @@ fbCompositeSrc_8888x0565 (pixman_implementation_t *imp,
 		else
 		{
 		    d = *dst;
-		    d = fbOver24 (s, cvt0565to0888(d));
+		    d = fbOver (s, cvt0565to0888(d));
 		}
 		*dst = cvt8888to0565(d);
 	    }
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 34775d4..cbd31e0 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -328,16 +328,8 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t       *walker,
  * this difference will have two versions using the same convention.
  */
 
-#define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i),	\
-			    (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
-
-#define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i),	\
-			    (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
-
 #define FbInU(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),(a),(t)) << (i))
 
-#define FbInC(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i))
-
 #define FbAdd(x,y,i,t)	((t) = FbGet8(x,i) + FbGet8(y,i),		\
 			 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
 


More information about the xorg-commit mailing list