[cairo-commit] pixman/src test/pixman-rotate-rgb24-ref.png test/pixman-rotate-svg-argb32-ref.png test/pixman-rotate-svg-rgb24-ref.png

Kristian Høgsberg krh at kemper.freedesktop.org
Tue Jun 13 17:13:12 PDT 2006


 pixman/src/fbcompose.c                |   21 +++++++++++++++------
 test/pixman-rotate-rgb24-ref.png      |binary
 test/pixman-rotate-svg-argb32-ref.png |binary
 test/pixman-rotate-svg-rgb24-ref.png  |binary
 4 files changed, 15 insertions(+), 6 deletions(-)

New commits:
diff-tree b104a79502e2c01c508e40d83613ecfa001a2a4e (from 0ee64b84689c22bba1d9bb2758170bbc104f5cf1)
Author: Bertram Felgenhauer <int-e at gmx.de>
Date:   Tue Jun 13 20:07:28 2006 -0400

    Patch to fix pixman samping location bug (#2488).

diff --git a/pixman/src/fbcompose.c b/pixman/src/fbcompose.c
index 9515edd..46a34ec 100644
--- a/pixman/src/fbcompose.c
+++ b/pixman/src/fbcompose.c
@@ -2814,8 +2814,9 @@ static void fbFetchSourcePict(PicturePtr
         xFixed_32_32 l;
         xFixed_48_16 dx, dy, a, b, off;
 
-        v.vector[0] = IntToxFixed(x);
-        v.vector[1] = IntToxFixed(y);
+        /* reference point is the center of the pixel */
+        v.vector[0] = IntToxFixed(x) + xFixed1/2;
+        v.vector[1] = IntToxFixed(y) + xFixed1/2;
         v.vector[2] = xFixed1;
         if (pict->transform) {
             if (!PictureTransformPoint3d (pict->transform, &v))
@@ -2928,8 +2929,9 @@ static void fbFetchSourcePict(PicturePtr
 
         if (pict->transform) {
             PictVector v;
-            v.vector[0] = IntToxFixed(x);
-            v.vector[1] = IntToxFixed(y);
+            /* reference point is the center of the pixel */
+            v.vector[0] = IntToxFixed(x) + xFixed1/2;
+            v.vector[1] = IntToxFixed(y) + xFixed1/2;
             v.vector[2] = xFixed1;
             if (!PictureTransformPoint3d (pict->transform, &v))
                 return;
@@ -3068,8 +3070,9 @@ static void fbFetchTransformed(PicturePt
     x += xoff;
     y += yoff;
 
-    v.vector[0] = IntToxFixed(x);
-    v.vector[1] = IntToxFixed(y);
+    /* reference point is the center of the pixel */
+    v.vector[0] = IntToxFixed(x) + xFixed1/2;
+    v.vector[1] = IntToxFixed(y) + xFixed1/2;
     v.vector[2] = xFixed1;
 
     /* when using convolution filters one might get here without a transform */
@@ -3184,6 +3187,12 @@ static void fbFetchTransformed(PicturePt
             }
         }
     } else if (pict->filter == PIXMAN_FILTER_BILINEAR || pict->filter == PIXMAN_FILTER_GOOD || pict->filter == PIXMAN_FILTER_BEST) {
+        /* adjust vector for maximum contribution at 0.5, 0.5 of each texel. */
+        v.vector[0] -= v.vector[2]/2;
+        v.vector[1] -= v.vector[2]/2;
+        unit.vector[0] -= unit.vector[2]/2;
+        unit.vector[1] -= unit.vector[2]/2;
+
         if (pict->repeat == RepeatNormal) {
             if (PIXREGION_NUM_RECTS(pict->pCompositeClip) == 1) {
                 box = pict->pCompositeClip->extents;
diff --git a/test/pixman-rotate-rgb24-ref.png b/test/pixman-rotate-rgb24-ref.png
index c9d00fd..60d9b1c 100644
Binary files a/test/pixman-rotate-rgb24-ref.png and b/test/pixman-rotate-rgb24-ref.png differ
diff --git a/test/pixman-rotate-svg-argb32-ref.png b/test/pixman-rotate-svg-argb32-ref.png
new file mode 100644
index 0000000..08d750b
Binary files /dev/null and b/test/pixman-rotate-svg-argb32-ref.png differ
diff --git a/test/pixman-rotate-svg-rgb24-ref.png b/test/pixman-rotate-svg-rgb24-ref.png
new file mode 100644
index 0000000..349fd5c
Binary files /dev/null and b/test/pixman-rotate-svg-rgb24-ref.png differ


More information about the cairo-commit mailing list