[xorg-x11-server] * Wed Apr 20 2011 Soren Sandmann <ssp at redhat.com> 1.10.99.1-3.20110418 - xserver-1.10-fix-trapezoids

Soren Sandmann Pedersen ssp at fedoraproject.org
Wed Apr 20 08:02:37 UTC 2011


commit 37c46bcf8e67426d14a14f2b9ba16f079819003f
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Wed Apr 20 04:05:14 2011 -0400

    * Wed Apr 20 2011 Soren Sandmann <ssp at redhat.com> 1.10.99.1-3.20110418
    - xserver-1.10-fix-trapezoids.patch: this patch is necessary to prevent
      trap corruption with pixman 0.21.8.

 xorg-x11-server.spec              |    5 +
 xserver-1.10-fix-trapezoids.patch |  177 +++++++++++++++++++++++++++++++++++++
 2 files changed, 182 insertions(+), 0 deletions(-)
---
diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec
index 7f62db5..3d705ba 100644
--- a/xorg-x11-server.spec
+++ b/xorg-x11-server.spec
@@ -85,6 +85,7 @@ Patch6053: xserver-1.8-disable-vboxvideo.patch
 Patch7005: xserver-1.9.0-qxl-fallback.patch
 
 Patch7006: xserver-1.10-pointer-barriers.patch
+Patch7007: xserver-1.10-fix-trapezoids.patch
 # from ajax/xserver-next
 Patch7008: xserver-1.10-glx-pixmap-crash.patch
 Patch7009: xserver-1.10-bg-none-revert.patch
@@ -552,6 +553,10 @@ rm -rf $RPM_BUILD_ROOT
 %{xserver_source_dir}
 
 %changelog
+* Wed Apr 20 2011 Soren Sandmann <ssp at redhat.com> 1.10.99.1-3.20110418
+- xserver-1.10-fix-trapezoids.patch: this patch is necessary to prevent
+  trap corruption with pixman 0.21.8.
+
 * Tue Apr 19 2011 Peter Hutterer <peter.hutterer at redhat.com> 1.10.99.1-2.20110418
 - rebase all patches
 - xserver-1.10-vbe-malloc.patch: drop, d8caa782009abf4d
diff --git a/xserver-1.10-fix-trapezoids.patch b/xserver-1.10-fix-trapezoids.patch
new file mode 100644
index 0000000..a2a301b
--- /dev/null
+++ b/xserver-1.10-fix-trapezoids.patch
@@ -0,0 +1,177 @@
+From c8ba57820c6349e48e7de7d6c038a215caedca1c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp at redhat.com>
+Date: Mon, 28 Mar 2011 13:30:52 -0400
+Subject: [PATCH] Fix trapezoid and triangle rendering to windows
+
+For fbAdd{Traps,Triangles}() and fbRasterizeTrapezoid() this is just a
+matter of adding the image offsets to the trap offsets.
+
+For fbShapes, the story is more complicated:
+
+The recently added pixman API did not allow offsetting
+trapezoids. Instead, it would use x_dst and y_dst in such a way that
+the effect was to only offset the source image.
+
+In pixman 0.21.8, this API has changed such that all the traps are
+conceptually rendered to an infinitely big image, and the source and
+destination coordinates are then aligned with (0, 0) of that
+image. This means offsetting dst_x and dst_y will now offset the
+entire drawing, which is similar to how other composite functions
+work.
+
+This patch then changes fbComposite{Triangles,Traps} such that the
+source image is aligned with the shapes, and the destination
+coordinates offset according to drawable->{x, y}.
+
+Signed-off-by: Soren Sandmann <ssp at redhat.com>
+---
+ configure.ac |    2 +-
+ fb/fbtrap.c  |   56 +++++++++++++++++++++++++++-----------------------------
+ 2 files changed, 28 insertions(+), 30 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9e04ff0..8714c93 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -795,7 +795,7 @@ LIBGLIB="glib-2.0 >= 2.16"
+ LIBUDEV="libudev >= 143"
+ LIBSELINUX="libselinux >= 2.0.86"
+ LIBDBUS="dbus-1 >= 1.0"
+-LIBPIXMAN="pixman-1 >= 0.21.6"
++LIBPIXMAN="pixman-1 >= 0.21.8"
+ 
+ dnl Pixman is always required, but we separate it out so we can link
+ dnl specific modules against it
+diff --git a/fb/fbtrap.c b/fb/fbtrap.c
+index 2554fcc..dbd59ed 100644
+--- a/fb/fbtrap.c
++++ b/fb/fbtrap.c
+@@ -37,13 +37,14 @@ fbAddTraps (PicturePtr	pPicture,
+ 	    int		ntrap,
+ 	    xTrap	*traps)
+ {
+-    int image_xoff, image_yoff;
+-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
++    pixman_image_t *image;
++    int dst_xoff, dst_yoff;
+ 
+-    if (!image)
++    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+ 	return;
+     
+-    pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
++    pixman_add_traps (image, x_off + dst_xoff, y_off + dst_yoff,
++		      ntrap, (pixman_trap_t *)traps);
+ 
+     free_pixman_pict (pPicture, image);
+ }
+@@ -54,13 +55,15 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
+ 		      int	    x_off,
+ 		      int	    y_off)
+ {
+-    int	mask_xoff, mask_yoff;
+-    pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
++    pixman_image_t *image;
++    int	dst_xoff, dst_yoff;
+ 
+-    if (!image)
++    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+ 	return;
+ 
+-    pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
++    pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap,
++				x_off + dst_xoff,
++				y_off + dst_yoff);
+ 
+     free_pixman_pict (pPicture, image);
+ }
+@@ -72,14 +75,15 @@ fbAddTriangles (PicturePtr  pPicture,
+ 		int	    ntri,
+ 		xTriangle *tris)
+ {
+-    int image_xoff, image_yoff;
+-    pixman_image_t *image =
+-	image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
++    pixman_image_t *image;
++    int dst_xoff, dst_yoff;
+ 
+-    if (!image)
++    if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
+ 	return;
+     
+-    pixman_add_triangles (image, x_off, y_off, ntri, (pixman_triangle_t *)tris);
++    pixman_add_triangles (image,
++			  dst_xoff + x_off, dst_yoff + y_off,
++			  ntri, (pixman_triangle_t *)tris);
+ 
+     free_pixman_pict (pPicture, image);
+ }
+@@ -100,8 +104,6 @@ fbShapes (CompositeShapesFunc	composite,
+ 	  PictFormatPtr		maskFormat,
+ 	  int16_t		xSrc,
+ 	  int16_t		ySrc,
+-	  int16_t		xDst,
+-	  int16_t		yDst,
+ 	  int			nshapes,
+ 	  int			shape_size,
+ 	  const uint8_t *	shapes)
+@@ -131,8 +133,8 @@ fbShapes (CompositeShapesFunc	composite,
+ 		composite (op, src, dst, format,
+ 			   xSrc + src_xoff,
+ 			   ySrc + src_yoff,
+-			   xDst + dst_xoff,
+-			   yDst + dst_yoff,
++			   dst_xoff,
++			   dst_yoff,
+ 			   1, shapes + i * shape_size);
+ 	    }
+ 	}
+@@ -157,8 +159,8 @@ fbShapes (CompositeShapesFunc	composite,
+ 	    composite (op, src, dst, format,
+ 		       xSrc + src_xoff,
+ 		       ySrc + src_yoff,
+-		       xDst + dst_xoff,
+-		       yDst + dst_yoff,
++		       dst_xoff,
++		       dst_yoff,
+ 		       nshapes, shapes);
+ 	}
+     }
+@@ -177,14 +179,12 @@ fbTrapezoids (CARD8	    op,
+ 	      int	    ntrap,
+ 	      xTrapezoid    *traps)
+ {
+-    int xDst, yDst;
+-
+-    xDst = traps[0].left.p1.x >> 16;
+-    yDst = traps[0].left.p1.y >> 16;
++    xSrc -= (traps[0].left.p1.x >> 16);
++    ySrc -= (traps[0].left.p1.y >> 16);
+     
+     fbShapes ((CompositeShapesFunc)pixman_composite_trapezoids,
+ 	      op, pSrc, pDst, maskFormat,
+-	      xSrc, ySrc, xDst, yDst,
++	      xSrc, ySrc,
+ 	      ntrap, sizeof (xTrapezoid), (const uint8_t *)traps);
+ }
+ 
+@@ -198,13 +198,11 @@ fbTriangles (CARD8	    op,
+ 	     int	    ntris,
+ 	     xTriangle    *tris)
+ { 
+-    int xDst, yDst;
+-
+-    xDst = tris[0].p1.x >> 16;
+-    yDst = tris[0].p1.y >> 16;
++    xSrc -= (tris[0].p1.x >> 16);
++    ySrc -= (tris[0].p1.y >> 16);
+     
+     fbShapes ((CompositeShapesFunc)pixman_composite_triangles,
+ 	      op, pSrc, pDst, maskFormat,
+-	      xSrc, ySrc, xDst, yDst,
++	      xSrc, ySrc,
+ 	      ntris, sizeof (xTriangle), (const uint8_t *)tris);
+ }
+-- 
+1.7.4
+


More information about the scm-commits mailing list