pixman: Branch 'master' - 4 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Thu Jun 14 21:18:16 PDT 2007


 TODO                           |   72 ++++++++++++++++++++++-------------------
 pixman/pixman-compose.c        |   34 +++++++++----------
 pixman/pixman-compute-region.c |    4 +-
 pixman/pixman-image.c          |   19 +++++-----
 pixman/pixman-private.h        |    2 +
 5 files changed, 69 insertions(+), 62 deletions(-)

New commits:
diff-tree e1dd17451cbe2c7d36205fe2fc4cea0092ee4141 (from 1426483f8af21553bd8b2ad997617680944be420)
Author: Søren Sandmann <sandmann at redhat.com>
Date:   Fri Jun 15 00:15:03 2007 -0400

    Disable source clipping by default

diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c
index 6293ce9..d761e8f 100644
--- a/pixman/pixman-compose.c
+++ b/pixman/pixman-compose.c
@@ -3725,7 +3725,7 @@ static void fbFetchTransformed(bits_imag
     if (pict->common.filter == PIXMAN_FILTER_NEAREST || pict->common.filter == PIXMAN_FILTER_FAST)
     {
         if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) {
-            if (pixman_region_n_rects (&pict->common.clip_region) == 1) {
+            if (pixman_region_n_rects (pict->common.src_clip) == 1) {
 		for (i = 0; i < width; ++i) {
 		    if (!mask || mask[i] & maskBits)
 		    {
@@ -3761,7 +3761,7 @@ static void fbFetchTransformed(bits_imag
 				y = MOD(v.vector[1]>>16, pict->height);
 				x = MOD(v.vector[0]>>16, pict->width);
 			    }
-			    if (pixman_region_contains_point (&pict->common.clip_region, x, y, &box))
+			    if (pixman_region_contains_point (pict->common.src_clip, x, y, &box))
 				*(buffer + i) = fetch ((pixman_image_t *)pict, bits + y*stride, x, indexed);
 			    else
 				*(buffer + i) = 0;
@@ -3774,8 +3774,8 @@ static void fbFetchTransformed(bits_imag
                 }
             }
         } else {
-            if (pixman_region_n_rects(&pict->common.clip_region) == 1) {
-                box = pict->common.clip_region.extents;
+            if (pixman_region_n_rects(pict->common.src_clip) == 1) {
+                box = pict->common.src_clip->extents;
                 for (i = 0; i < width; ++i) {
 		    if (!mask || mask[i] & maskBits)
 		    {
@@ -3811,7 +3811,7 @@ static void fbFetchTransformed(bits_imag
 				y = v.vector[1]>>16;
 				x = v.vector[0]>>16;
 			    }
-			    if (pixman_region_contains_point (&pict->common.clip_region, x, y, &box))
+			    if (pixman_region_contains_point (pict->common.src_clip, x, y, &box))
 				*(buffer + i) = fetch((pixman_image_t *)pict, bits + y*stride, x, indexed);
 			    else
 				*(buffer + i) = 0;
@@ -3834,7 +3834,7 @@ static void fbFetchTransformed(bits_imag
         unit.vector[1] -= unit.vector[2] / 2;
 	
         if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) {
-            if (pixman_region_n_rects(&pict->common.clip_region) == 1) {
+            if (pixman_region_n_rects(pict->common.src_clip) == 1) {
                 for (i = 0; i < width; ++i) {
                     if (!mask || mask[i] & maskBits)
 		    {
@@ -3937,14 +3937,14 @@ static void fbFetchTransformed(bits_imag
 			    
 			    b = bits + y1*stride;
 			    
-			    tl = pixman_region_contains_point(&pict->common.clip_region, x1, y1, &box)
+			    tl = pixman_region_contains_point(pict->common.src_clip, x1, y1, &box)
 				? fetch((pixman_image_t *)pict, b, x1, indexed) : 0;
-			    tr = pixman_region_contains_point(&pict->common.clip_region, x2, y1, &box)
+			    tr = pixman_region_contains_point(pict->common.src_clip, x2, y1, &box)
 				? fetch((pixman_image_t *)pict, b, x2, indexed) : 0;
 			    b = bits + (y2)*stride;
-			    bl = pixman_region_contains_point(&pict->common.clip_region, x1, y2, &box)
+			    bl = pixman_region_contains_point(pict->common.src_clip, x1, y2, &box)
 				? fetch((pixman_image_t *)pict, b, x1, indexed) : 0;
-			    br = pixman_region_contains_point(&pict->common.clip_region, x2, y2, &box)
+			    br = pixman_region_contains_point(pict->common.src_clip, x2, y2, &box)
 				? fetch((pixman_image_t *)pict, b, x2, indexed) : 0;
 			    
 			    ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
@@ -3969,8 +3969,8 @@ static void fbFetchTransformed(bits_imag
                 }
             }
         } else {
-            if (pixman_region_n_rects(&pict->common.clip_region) == 1) {
-                box = pict->common.clip_region.extents;
+            if (pixman_region_n_rects(pict->common.src_clip) == 1) {
+                box = pict->common.src_clip->extents;
                 for (i = 0; i < width; ++i) {
 		    if (!mask || mask[i] & maskBits)
 		    {
@@ -4072,14 +4072,14 @@ static void fbFetchTransformed(bits_imag
 			    b = bits + (y1)*stride;
 			    x_off = x1;
 			    
-			    tl = pixman_region_contains_point(&pict->common.clip_region, x1, y1, &box)
+			    tl = pixman_region_contains_point(pict->common.src_clip, x1, y1, &box)
 				? fetch((pixman_image_t *)pict, b, x_off, indexed) : 0;
-			    tr = pixman_region_contains_point(&pict->common.clip_region, x2, y1, &box)
+			    tr = pixman_region_contains_point(pict->common.src_clip, x2, y1, &box)
 				? fetch((pixman_image_t *)pict, b, x_off + 1, indexed) : 0;
 			    b += stride;
-			    bl = pixman_region_contains_point(&pict->common.clip_region, x1, y2, &box)
+			    bl = pixman_region_contains_point(pict->common.src_clip, x1, y2, &box)
 				? fetch((pixman_image_t *)pict, b, x_off, indexed) : 0;
-			    br = pixman_region_contains_point(&pict->common.clip_region, x2, y2, &box)
+			    br = pixman_region_contains_point(pict->common.src_clip, x2, y2, &box)
 				? fetch((pixman_image_t *)pict, b, x_off + 1, indexed) : 0;
 			    
 			    ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
@@ -4141,7 +4141,7 @@ static void fbFetchTransformed(bits_imag
 			for (x = x1; x < x2; x++) {
 			    if (*p) {
 				int tx = (pict->common.repeat == PIXMAN_REPEAT_NORMAL) ? MOD (x, pict->width) : x;
-				if (pixman_region_contains_point (&pict->common.clip_region, tx, ty, &box)) {
+				if (pixman_region_contains_point (pict->common.src_clip, tx, ty, &box)) {
 				    uint32_t *b = bits + (ty)*stride;
 				    uint32_t c = fetch((pixman_image_t *)pict, b, tx, indexed);
 				    
diff --git a/pixman/pixman-compute-region.c b/pixman/pixman-compute-region.c
index d4e0ed6..f9b9de7 100644
--- a/pixman/pixman-compute-region.c
+++ b/pixman/pixman-compute-region.c
@@ -98,7 +98,7 @@ miClipPictureSrc (pixman_region16_t *	pR
 	    pixman_region_translate ( pRegion, dx, dy);
 	    
 	    if (!pixman_region_intersect (pRegion, pRegion, 
-					  (pixman_region16_t *) &pPicture->common.clip_region))
+					  (pixman_region16_t *) pPicture->common.src_clip))
 		return FALSE;
 	    
 	    pixman_region_translate ( pRegion, -dx, -dy);
@@ -109,7 +109,7 @@ miClipPictureSrc (pixman_region16_t *	pR
     else
     {
 	return miClipPictureReg (pRegion,
-				 &pPicture->common.clip_region,
+				 pPicture->common.src_clip,
 				 dx,
 				 dy);
     }
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 1eee840..8657c31 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -29,12 +29,6 @@
 #include "pixman.h"
 #include "pixman-private.h"
 
-enum
-{
-    PIXMAN_BAD_VALUE,
-    PIXMAN_BAD_ALLOC
-};
-
 static void
 init_source_image (source_image_t *image)
 {
@@ -83,8 +77,10 @@ allocate_image (void)
     if (image)
     {
 	image_common_t *common = &image->common;
-	
+
+	pixman_region_init (&common->full_region);
 	pixman_region_init (&common->clip_region);
+	common->src_clip = &common->full_region;
 	common->has_client_clip = FALSE;
 	common->transform = NULL;
 	common->repeat = PIXMAN_REPEAT_NONE;
@@ -120,6 +116,7 @@ pixman_image_unref (pixman_image_t *imag
     if (common->ref_count == 0)
     {
 	pixman_region_fini (&common->clip_region);
+	pixman_region_fini (&common->full_region);
 
 	if (common->transform)
 	    free (common->transform);
@@ -291,8 +288,7 @@ reset_clip_region (pixman_image_t *image
     if (image->type == BITS)
     {
 	pixman_region_init_rect (&image->common.clip_region, 0, 0,
-				 image->bits.width, image->bits.height);
-	
+				 image->bits.width, image->bits.height);	
     }
     else
     {
@@ -336,8 +332,11 @@ pixman_image_create_bits (pixman_format_
 								  */
     image->bits.indexed = NULL;
 
-    reset_clip_region (image);
+    pixman_region_fini (&image->common.full_region);
+    pixman_region_init_rect (&image->common.full_region, 0, 0,
+			     image->bits.width, image->bits.height);
 
+    reset_clip_region (image);
     return image;
 }
 
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 09969fb..bf0579f 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -147,7 +147,9 @@ struct image_common
 {
     image_type_t		type;
     int32_t			ref_count;
+    pixman_region16_t		full_region;
     pixman_region16_t		clip_region;
+    pixman_region16_t	       *src_clip;
     pixman_bool_t               has_client_clip;
     pixman_transform_t	       *transform;
     pixman_repeat_t		repeat;
diff-tree 1426483f8af21553bd8b2ad997617680944be420 (from 7a8877bc0800ffcfe18bedec49068049c877fa5d)
Author: Søren Sandmann <sandmann at redhat.com>
Date:   Thu Jun 14 17:37:12 2007 -0400

    Update TODO

diff --git a/TODO b/TODO
index fc0b3d1..2e767ab 100644
--- a/TODO
+++ b/TODO
@@ -16,8 +16,6 @@
 
 - Consider whether calling regions region16 is really such a great idea
 
-- Make sure the endian-ness macros are defined correctly.
-
 - Run cairo test suite; fix bugs
 	- one bug in source-scale-clip
 
@@ -32,6 +30,8 @@
 
 done:
 
+- Make sure the endian-ness macros are defined correctly.
+
 - The rectangles in a region probably shouldn't be returned const as
   the X server will be changing them.
 
diff-tree 7a8877bc0800ffcfe18bedec49068049c877fa5d (from a0e161ca9aa562a0f4b55b15b1ab3b9380f0d9bb)
Author: Søren Sandmann <sandmann at redhat.com>
Date:   Thu Jun 14 17:35:28 2007 -0400

    Update TODO

diff --git a/TODO b/TODO
index 06d8b18..fc0b3d1 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,3 @@
-  - Remove the warning suppression in the ACCESS_MEM macro and fix the
-    warnings that are real
-
   - It probably makes sense to move the more strange X region API
     into pixman as well, but guarded with PIXMAN_XORG_COMPATIBILITY
 
@@ -24,10 +21,15 @@
 - Run cairo test suite; fix bugs
 	- one bug in source-scale-clip
 
+ - Remove the warning suppression in the ACCESS_MEM macro and fix the
+    warnings that are real
+
 - Add calls to prepare and finish access where necessary. 
   grep for ACCESS_MEM, and make sure they are correctly wrapped in
   prepare and finish
 
+- Make source clipping optional.
+
 done:
 
 - The rectangles in a region probably shouldn't be returned const as
diff-tree a0e161ca9aa562a0f4b55b15b1ab3b9380f0d9bb (from 596bd530205e9835ede0bc8816c9b2dfff75e921)
Author: Søren Sandmann <sandmann at redhat.com>
Date:   Thu Jun 14 17:34:42 2007 -0400

    Update TODO

diff --git a/TODO b/TODO
index d1beb74..06d8b18 100644
--- a/TODO
+++ b/TODO
@@ -6,6 +6,40 @@
 
   - Go through things marked FIXME
 
+  - Reinstate the FbBits typedef? At the moment we don't
+    even have the FbBits type; we just use uint32_t everywhere.
+
+    Keith says in bug 2335:
+
+        The 64-bit code in fb (pixman) is probably broken; it hasn't been
+        used in quite some time as PCI (and AGP) is 32-bits wide, so
+        doing things 64-bits at a time is a net loss.  To quickly fix
+        this, I suggest just using 32-bit datatypes by setting
+        IC_SHIFT to 5 for all machines.
+
+- Consider whether calling regions region16 is really such a great idea
+
+- Make sure the endian-ness macros are defined correctly.
+
+- Run cairo test suite; fix bugs
+	- one bug in source-scale-clip
+
+- Add calls to prepare and finish access where necessary. 
+  grep for ACCESS_MEM, and make sure they are correctly wrapped in
+  prepare and finish
+
+done:
+
+- The rectangles in a region probably shouldn't be returned const as
+  the X server will be changing them.
+
+- Right now we _always_ have a clip region, which is empty by default.
+  Why does this work at all? It probably doesn't. The server
+  distinguishes two cases, one where nothing is clipped (CT_NONE), and
+  one where there is a clip region (CT_REGION).
+
+- Default clip region should be the full image
+
   - Test if pseudo color still works. It does, but it also shows that
     copying a pixman_indexed_t on every composite operation is not
     going to fly. So, for now set_indexed() does not copy the 
@@ -36,33 +70,3 @@
             etc. instead of the types that are defined in
             renderproto.h
 
-  - Reinstate the FbBits conditional typedef? At the moment we don't
-    even have the FbBits type; we just use uint32_t everywhere.
-
-    Keith says in bug 2335:
-
-        The 64-bit code in fb (pixman) is probably broken; it hasn't been
-        used in quite some time as PCI (and AGP) is 32-bits wide, so
-        doing things 64-bits at a time is a net loss.  To quickly fix
-        this, I suggest just using 32-bit datatypes by setting
-        IC_SHIFT to 5 for all machines.
-
-- Consider whether calling regions region16 is really such a great idea
-
-- Right now we _always_ have a clip region, which is empty by default.
-  Why does this work at all? It probably doesn't. The server
-  distinguishes two cases, one where nothing is clipped (CT_NONE), and
-  one where there is a clip region (CT_REGION).
-
-- The rectangles in a region probably shouldn't be returned const as
-  the X server will be changing them.
-
-- Make sure the endian-ness macros are defined correctly.
-
-- Run cairo test suite; fix bugs
-	- one bug in source-scale-clip
-
-
-done:
-
-- Default clip region should be the full image
\ No newline at end of file


More information about the xorg-commit mailing list