pixman: Branch 'master' - 3 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Thu Jul 9 01:19:02 PDT 2009


 pixman/pixman-region.c |    4 +---
 test/Makefile.am       |    4 ++--
 test/oob-test.c        |    1 -
 test/region-test.c     |   30 ++++++++++++++++++++++++++++++
 test/scaling-test.c    |    3 ++-
 5 files changed, 35 insertions(+), 7 deletions(-)

New commits:
commit 6b34482870fd53a9285f795f47656ac73fd706b0
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Thu Jul 9 04:04:00 2009 -0400

    Update the CRC value in scaling-test.c.
    
    The changes in pixman behavior justifying this are:
    
    - New clipping rules
    
    - Bug fixes in region code. In particular, when
      pixman_region_init_rects() is called on these two boxes:
    
    	{ 2, 6, 7, 6 }
    	{ 4, 1, 6, 7 }
    
      it now ignores the first one, which is empty and produces
    
    	{ 4, 1, 6, 7 }
    
      Previously, it would produce:
    
    	{ 2, 1, 7, 7 }
    
      for some reason.

diff --git a/test/scaling-test.c b/test/scaling-test.c
index c85908d..1919d5f 100644
--- a/test/scaling-test.c
+++ b/test/scaling-test.c
@@ -329,7 +329,8 @@ int main(int argc, char *argv[])
         if (n == 3000000) {
             /* predefined value for running with all the fastpath functions disabled  */
             /* it needs to be updated every time changes are introduced to this program! */
-            if (crc == 0xC950E5BB) {
+
+	    if (crc == 0x0B633CF4) {
                 printf("scaling test passed\n");
             } else {
                 printf("scaling test failed!\n");
commit 4c60ed5ec662e2d7088a7800dd7c71d3926c42a4
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Thu Jul 9 04:00:19 2009 -0400

    Fix bug in pixman-region.c where empty regions would not be properly initialized.
    
    Also add a couple more tests to region-test.c.

diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 3d6c0ef..d7b1180 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -2142,9 +2142,7 @@ PREFIX(_init_rects) (region_type_t *region,
     if (region->data->numRects == 0)
     {
 	FREE_DATA (region);
-	region->data = NULL;
-
-	GOOD (region);
+	PREFIX(_init) (region);
 	
 	return TRUE;
     }
diff --git a/test/region-test.c b/test/region-test.c
index e9a6421..3568969 100644
--- a/test/region-test.c
+++ b/test/region-test.c
@@ -14,6 +14,14 @@ main ()
 	{ 30, 30, 30, 40 },
 	{ 50, 45, 60, 44 },
     };
+    pixman_box32_t boxes2[] = {
+	{ 2, 6, 7, 6 },
+	{ 4, 1, 6, 7 },
+    };
+    pixman_box32_t boxes3[] = {
+	{ 2, 6, 7, 6 },
+	{ 4, 1, 6, 1 },
+    };
     int i;
     pixman_box32_t *b;
 
@@ -44,5 +52,27 @@ main ()
 	assert (b[i].y1 < b[i].y2);
     }
 
+    /* This would produce a rectangle containing the bounding box
+     * of the two rectangles. The correct result is to eliminate
+     * the broken rectangle.
+     */
+    pixman_region32_init_rects (&r1, boxes2, 2);
+
+    b = pixman_region32_rectangles (&r1, &i);
+
+    assert (i == 1);
+
+    assert (b[0].x1 == 4);
+    assert (b[0].y1 == 1);
+    assert (b[0].x2 == 6);
+    assert (b[0].y2 == 7);
+
+    /* This should produce an empty region */
+    pixman_region32_init_rects (&r1, boxes3, 2);
+
+    b = pixman_region32_rectangles (&r1, &i);
+
+    assert (i == 0);
+
     return 0;
 }
commit bcf01c21d704717264011182e71cfaaf6922a437
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Thu Jul 9 01:47:19 2009 -0400

    Fix a couple of problems with the tests when HAVE_GTK is not defined.
    
    - Make sure the non-gtk+ test programs are added to noinst_PROGRAMS
      when HAVE_GTK is not set.
    
    - Don't include glib.h in oob-test.c

diff --git a/test/Makefile.am b/test/Makefile.am
index cfe367e..d44e526 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -30,8 +30,6 @@ TESTPROGRAMS +=			\
 	convolution-test	\
 	trap-test
 
-noinst_PROGRAMS = $(TESTPROGRAMS)
-
 INCLUDES += $(GTK_CFLAGS)
 
 gradient_test_LDADD = $(GTK_LDADD)
@@ -60,3 +58,5 @@ convolution_test_SOURCES = convolution-test.c utils.c utils.h
 
 endif
 
+noinst_PROGRAMS = $(TESTPROGRAMS)
+
diff --git a/test/oob-test.c b/test/oob-test.c
index a4afc95..4f9e5a2 100644
--- a/test/oob-test.c
+++ b/test/oob-test.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "pixman.h"
-#include "utils.h"
 
 typedef struct
 {


More information about the xorg-commit mailing list