pixman: Branch 'master' - 3 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Wed Sep 8 17:28:47 PDT 2010


 pixman/pixman-access.c |   10 +++++-----
 pixman/pixman.c        |   17 ++++-------------
 test/composite.c       |    1 +
 3 files changed, 10 insertions(+), 18 deletions(-)

New commits:
commit e29d9dfcb5935777333f6239b95c18c3da697ab2
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Thu Sep 2 19:43:08 2010 -0400

    Silence some warnings about uninitialized variables
    
    Neither were real problems, but GCC was complaining about them.

diff --git a/pixman/pixman.c b/pixman/pixman.c
index 62b58b8..47ffdd6 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -613,6 +613,9 @@ compute_sample_extents (pixman_transform_t *transform,
     {
 	int i;
 
+	/* Silence GCC */
+	tx1 = ty1 = tx2 = ty2 = 0;
+    
 	for (i = 0; i < 4; ++i)
 	{
 	    pixman_fixed_48_16_t tx, ty;
diff --git a/test/composite.c b/test/composite.c
index 0624cd3..b530a20 100644
--- a/test/composite.c
+++ b/test/composite.c
@@ -882,6 +882,7 @@ main (void)
 						 mask.size? TRUE : FALSE);
 			    break;
                         default:
+			    ok = FALSE; /* Silence GCC */
                             break;
 			}
 			group_ok = group_ok && ok;
commit 27f7852b5ac8d137c917e653fb7113f419a4c77a
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Tue Aug 31 00:30:54 2010 -0400

    When pixman_compute_composite_region32() returns FALSE, don't fini the region.
    
    The rule is that the region passed in must be initialized and that the
    region returned will still be valid. Ie., the lifecycle is the
    responsibility of the caller, regardless of what the function returns.
    
    Previously, compute_composite_region32() would finalize the region and
    then return FALSE, and then the caller would finalize the region
    again, leading to memory corruption in some cases.

diff --git a/pixman/pixman.c b/pixman/pixman.c
index 402c72c..62b58b8 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -302,17 +302,13 @@ pixman_compute_composite_region32 (pixman_region32_t * region,
     if (region->extents.x1 >= region->extents.x2 ||
         region->extents.y1 >= region->extents.y2)
     {
-	pixman_region32_init (region);
 	return FALSE;
     }
 
     if (dst_image->common.have_clip_region)
     {
 	if (!clip_general_image (region, &dst_image->common.clip_region, 0, 0))
-	{
-	    pixman_region32_fini (region);
 	    return FALSE;
-	}
     }
 
     if (dst_image->common.alpha_map && dst_image->common.alpha_map->common.have_clip_region)
@@ -321,7 +317,6 @@ pixman_compute_composite_region32 (pixman_region32_t * region,
 	                         -dst_image->common.alpha_origin_x,
 	                         -dst_image->common.alpha_origin_y))
 	{
-	    pixman_region32_fini (region);
 	    return FALSE;
 	}
     }
@@ -330,10 +325,7 @@ pixman_compute_composite_region32 (pixman_region32_t * region,
     if (src_image->common.have_clip_region)
     {
 	if (!clip_source_image (region, src_image, dest_x - src_x, dest_y - src_y))
-	{
-	    pixman_region32_fini (region);
 	    return FALSE;
-	}
     }
     if (src_image->common.alpha_map && src_image->common.alpha_map->common.have_clip_region)
     {
@@ -341,7 +333,6 @@ pixman_compute_composite_region32 (pixman_region32_t * region,
 	                        dest_x - (src_x - src_image->common.alpha_origin_x),
 	                        dest_y - (src_y - src_image->common.alpha_origin_y)))
 	{
-	    pixman_region32_fini (region);
 	    return FALSE;
 	}
     }
@@ -349,17 +340,14 @@ pixman_compute_composite_region32 (pixman_region32_t * region,
     if (mask_image && mask_image->common.have_clip_region)
     {
 	if (!clip_source_image (region, mask_image, dest_x - mask_x, dest_y - mask_y))
-	{
-	    pixman_region32_fini (region);
 	    return FALSE;
-	}
+
 	if (mask_image->common.alpha_map && mask_image->common.alpha_map->common.have_clip_region)
 	{
 	    if (!clip_source_image (region, (pixman_image_t *)mask_image->common.alpha_map,
 	                            dest_x - (mask_x - mask_image->common.alpha_origin_x),
 	                            dest_y - (mask_y - mask_image->common.alpha_origin_y)))
 	    {
-		pixman_region32_fini (region);
 		return FALSE;
 	    }
 	}
commit df6dbc90248a41b5b8362010e5b8d34358688786
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Mon Aug 30 00:16:07 2010 -0400

    Store a2b2g2r2 pixel through the WRITE macro
    
    Otherwise, accessor functions won't work.

diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
index 56de711..f1ce0ba 100644
--- a/pixman/pixman-access.c
+++ b/pixman/pixman-access.c
@@ -2425,11 +2425,11 @@ store_scanline_a2b2g2r2 (bits_image_t *  image,
     {
 	SPLIT_A (values[i]);
 	
-	*(pixel++) =
-	    ((a     ) & 0xc0) |
-	    ((b >> 2) & 0x30) |
-	    ((g >> 4) & 0x0c) |
-	    ((r >> 6)       );
+	WRITE (image, pixel++,
+	       ((a     ) & 0xc0) |
+	       ((b >> 2) & 0x30) |
+	       ((g >> 4) & 0x0c) |
+	       ((r >> 6)       ));
     }
 }
 


More information about the xorg-commit mailing list