xserver: Branch 'server-1_1-branch' - 2 commits

Kristian Høgsberg krh at kemper.freedesktop.org
Fri Jul 7 00:02:36 EEST 2006


 fb/fbcompose.c |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

New commits:
diff-tree 7c0b0372ad5901ea46ff9eab1d0e36698c663196 (from 080bfebfb88a642cb83579165c3a6856474da654)
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Wed Jun 21 16:22:14 2006 -0400

    Fix #2488 for fb too: sample pixel center when transforming.
    (cherry picked from ed18d776f02e2ab235954501ef64936af9f9d909 commit)

diff --git a/fb/fbcompose.c b/fb/fbcompose.c
index 9031d76..d482f42 100644
--- a/fb/fbcompose.c
+++ b/fb/fbcompose.c
@@ -2726,8 +2726,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))
@@ -2793,8 +2794,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;
@@ -2914,8 +2916,9 @@ static void fbFetchTransformed(PicturePt
     dx = pict->pDrawable->x;
     dy = pict->pDrawable->y;
 
-    v.vector[0] = IntToxFixed(x - dx);
-    v.vector[1] = IntToxFixed(y - dy);
+    /* reference point is the center of the pixel */
+    v.vector[0] = IntToxFixed(x - dx) + xFixed1 / 2;
+    v.vector[1] = IntToxFixed(y - dy) + xFixed1 / 2;
     v.vector[2] = xFixed1;
 
     /* when using convolution filters one might get here without a transform */
@@ -3020,6 +3023,12 @@ static void fbFetchTransformed(PicturePt
             }
         }
     } else if (pict->filter == PictFilterBilinear) {
+        /* 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->repeatType == RepeatNormal) {
             if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
                 for (i = 0; i < width; ++i) {
diff-tree 080bfebfb88a642cb83579165c3a6856474da654 (from 5d3e60552d6040495b772fb8b1bad8b2c5c54eba)
Author: Kristan Høgsberg <krh at redhat.com>
Date:   Mon Jun 19 22:13:22 2006 -0400

    Pull over convolution filter fixes from xgl-0-0-1 branch.
    
    Cherry-picking patches:
    
    	8a5ea68800b9d7dca90ff4e573ad8533852f1ea3 and
    	4d755fe14274a7293748ce9aa666ab85df6297c5
    (cherry picked from 4365d16c8629e824973ee0c357efdfbfd28b672c commit)

diff --git a/fb/fbcompose.c b/fb/fbcompose.c
index 23664d9..9031d76 100644
--- a/fb/fbcompose.c
+++ b/fb/fbcompose.c
@@ -3280,8 +3280,8 @@ static void fbFetchTransformed(PicturePt
         xFixed *params = pict->filter_params;
         INT32 cwidth = xFixedToInt(params[0]);
         INT32 cheight = xFixedToInt(params[1]);
-        int xoff = params[0] >> 1;
-        int yoff = params[1] >> 1;
+        int xoff = (params[0] - xFixed1) >> 1;
+	int yoff = (params[1] - xFixed1) >> 1;
         params += 2;
         for (i = 0; i < width; ++i) {
             if (!v.vector[2]) {
@@ -3325,6 +3325,11 @@ static void fbFetchTransformed(PicturePt
                     }
                 }
 
+		satot >>= 16;
+		srtot >>= 16;
+		sgtot >>= 16;
+		sbtot >>= 16;
+
                 if (satot < 0) satot = 0; else if (satot > 0xff) satot = 0xff;
                 if (srtot < 0) srtot = 0; else if (srtot > 0xff) srtot = 0xff;
                 if (sgtot < 0) sgtot = 0; else if (sgtot > 0xff) sgtot = 0xff;



More information about the xorg-commit mailing list