pixman: Branch 'master' - 4 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Tue Nov 13 16:34:26 PST 2012


 pixman/pixman-matrix.c |   15 +++++++++------
 pixman/pixman-ppc.c    |    6 +++---
 pixman/pixman.c        |    2 +-
 pixman/pixman.h        |    3 +++
 4 files changed, 16 insertions(+), 10 deletions(-)

New commits:
commit d881e1f5801ca0aefecccb43db05db539b3080d5
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Sun Nov 11 14:05:54 2012 -0500

    Allow src and dst to be identical in pixman_f_transform_invert()
    
    It is useful to be able to invert a matrix in place, but currently
    pixman_f_transform_invert() will produce wrong results if you pass the
    same matrix as both source and destination.
    
    Fix that by inverting into a temporary matrix and then copying that to
    the destination.

diff --git a/pixman/pixman-matrix.c b/pixman/pixman-matrix.c
index a029ab7..d2ab609 100644
--- a/pixman/pixman-matrix.c
+++ b/pixman/pixman-matrix.c
@@ -336,14 +336,14 @@ PIXMAN_EXPORT pixman_bool_t
 pixman_transform_invert (struct pixman_transform *      dst,
                          const struct pixman_transform *src)
 {
-    struct pixman_f_transform m, r;
+    struct pixman_f_transform m;
 
     pixman_f_transform_from_pixman_transform (&m, src);
 
-    if (!pixman_f_transform_invert (&r, &m))
+    if (!pixman_f_transform_invert (&m, &m))
 	return FALSE;
 
-    if (!pixman_transform_from_pixman_f_transform (dst, &r))
+    if (!pixman_transform_from_pixman_f_transform (dst, &m))
 	return FALSE;
 
     return TRUE;
@@ -469,10 +469,11 @@ PIXMAN_EXPORT pixman_bool_t
 pixman_f_transform_invert (struct pixman_f_transform *      dst,
                            const struct pixman_f_transform *src)
 {
-    double det;
-    int i, j;
     static const int a[3] = { 2, 2, 1 };
     static const int b[3] = { 1, 0, 0 };
+    pixman_f_transform_t d;
+    double det;
+    int i, j;
 
     det = 0;
     for (i = 0; i < 3; i++)
@@ -507,10 +508,12 @@ pixman_f_transform_invert (struct pixman_f_transform *      dst,
 	    if (((i + j) & 1) != 0)
 		p = -p;
 	    
-	    dst->m[j][i] = det * p;
+	    d.m[j][i] = det * p;
 	}
     }
 
+    *dst = d;
+
     return TRUE;
 }
 
commit 614e7aaf14652c726b067bbc7562ef237dcd50de
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Thu Nov 8 03:11:51 2012 -0500

    pixman.h: Add typedefs for pixman_f_transform and pixman_f_vector

diff --git a/pixman/pixman.h b/pixman/pixman.h
index c8723cf..33ebf3f 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -226,6 +226,9 @@ pixman_bool_t pixman_transform_is_inverse       (const struct pixman_transform *
 /*
  * Floating point matrices
  */
+typedef struct pixman_f_transform pixman_f_transform_t;
+typedef struct pixman_f_vector pixman_f_vector_t;
+
 struct pixman_f_vector
 {
     double  v[3];
commit b2e0e240fec4a8eaa7fe8da3a6807bcb8ac97edf
Author: Joshua Root <jmr at macports.org>
Date:   Fri Nov 9 14:39:14 2012 +1100

    Fix undeclared variable use and sysctlbyname error handling on ppc
    
    Fixes bug 56889.

diff --git a/pixman/pixman-ppc.c b/pixman/pixman-ppc.c
index f1bea1e..a6e7bb0 100644
--- a/pixman/pixman-ppc.c
+++ b/pixman/pixman-ppc.c
@@ -37,10 +37,10 @@
 static pixman_bool_t
 pixman_have_vmx (void)
 {
+    int error, have_vmx;
     size_t length = sizeof(have_vmx);
-    int error, have_mmx;
 
-    sysctlbyname ("hw.optional.altivec", &have_vmx, &length, NULL, 0);
+    error = sysctlbyname ("hw.optional.altivec", &have_vmx, &length, NULL, 0);
 
     if (error)
 	return FALSE;
@@ -56,9 +56,9 @@ pixman_have_vmx (void)
 static pixman_bool_t
 pixman_have_vmx (void)
 {
+    int error, have_vmx;
     int mib[2] = { CTL_MACHDEP, CPU_ALTIVEC };
     size_t length = sizeof(have_vmx);
-    int error, have_vmx;
 
     error = sysctl (mib, 2, &have_vmx, &length, NULL, 0);
 
commit 400436dc52450359de35cac9efa6aea631cf34e9
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Wed Oct 31 13:14:07 2012 -0400

    pixman_image_composite: Reduce opaque masks to NULL
    
    When the mask is known to be opaque, we might as well reduce it to
    NULL to take advantage of the various fast paths that operate on NULL
    masks.

diff --git a/pixman/pixman.c b/pixman/pixman.c
index e3b6516..e0ccd87 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -587,7 +587,7 @@ pixman_image_composite32 (pixman_op_t      op,
     src_format = src->common.extended_format_code;
     src_flags = src->common.flags;
 
-    if (mask)
+    if (mask && !(mask->common.flags & FAST_PATH_IS_OPAQUE))
     {
 	mask_format = mask->common.extended_format_code;
 	mask_flags = mask->common.flags;


More information about the xorg-commit mailing list