xf86-video-mach64: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 26 16:27:45 UTC 2021


 src/atimach64render.c |   45 +++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 20 deletions(-)

New commits:
commit fbe3995a27bdd81701dbb3b5e26556a00cfdf1d3
Author: George Matsumura <gmmatsumura01 at bvsd.org>
Date:   Tue Dec 24 06:12:01 2019 +0000

    Fix compositing rotation
    
    This corrects the composite operation's interpretation of a
    source picture transformation matrix indicating rotation,
    correcting a previous behavior where the source image was simply
    flipped and not rotated. This is done by using a transformed vector
    for each vertex of the source rectangle, instead of just two at
    each of the diagonally opposed corner vertices.

diff --git a/src/atimach64render.c b/src/atimach64render.c
index 8d259fa..39d0c5b 100644
--- a/src/atimach64render.c
+++ b/src/atimach64render.c
@@ -814,8 +814,12 @@ Mach64Composite
     float ooa;
     CARD32 col;
     PictVector v;
-    int srcXend, srcYend;
+    struct vertcoords {
+        int x;
+        int y;
+    } srcvert[4];
     float dxy = 0.0, dwh = 0.0;
+    int i;
 
     ATIDRISync(pScreenInfo);
 
@@ -830,22 +834,23 @@ Mach64Composite
     }
 
     /* Handle transform */
-    srcXend = srcX + w;
-    srcYend = srcY + h;
+    srcvert[0].x = srcX;
+    srcvert[0].y = srcY;
+    srcvert[1].x = srcX + w;
+    srcvert[1].y = srcY;
+    srcvert[2].x = srcX + w;
+    srcvert[2].y = srcY + h;
+    srcvert[3].x = srcX;
+    srcvert[3].y = srcY + h;
     if (m3d->transform) {
-        v.vector[0] = IntToxFixed(srcX);
-        v.vector[1] = IntToxFixed(srcY);
-        v.vector[2] = xFixed1;
-        PictureTransformPoint(m3d->transform, &v);
-        srcX = xFixedToInt(v.vector[0]);
-        srcY = xFixedToInt(v.vector[1]);
-
-        v.vector[0] = IntToxFixed(srcXend);
-        v.vector[1] = IntToxFixed(srcYend);
-        v.vector[2] = xFixed1;
-        PictureTransformPoint(m3d->transform, &v);
-        srcXend = xFixedToInt(v.vector[0]);
-        srcYend = xFixedToInt(v.vector[1]);
+        for (i = 0; i < 4; i++) {
+            v.vector[0] = IntToxFixed(srcvert[i].x);
+            v.vector[1] = IntToxFixed(srcvert[i].y);
+            v.vector[2] = xFixed1;
+            PictureTransformPoint(m3d->transform, &v);
+            srcvert[i].x = xFixedToInt(v.vector[0]);
+            srcvert[i].y = xFixedToInt(v.vector[1]);
+        }
 
 #if 0
         /* Bilinear needs manipulation of texture coordinates */
@@ -857,10 +862,10 @@ Mach64Composite
     }
 
     /* Create vertices in clock-wise order */
-    VTX_SET(v0, col, dstX,     dstY,     srcX, dxy,    srcY, dxy);
-    VTX_SET(v1, col, dstX + w, dstY,     srcXend, dwh, srcY, dxy);
-    VTX_SET(v2, col, dstX + w, dstY + h, srcXend, dwh, srcYend, dwh);
-    VTX_SET(v3, col, dstX,     dstY + h, srcX, dxy,    srcYend, dwh);
+    VTX_SET(v0, col, dstX,     dstY,     srcvert[0].x, dxy, srcvert[0].y, dxy);
+    VTX_SET(v1, col, dstX + w, dstY,     srcvert[1].x, dwh, srcvert[1].y, dxy);
+    VTX_SET(v2, col, dstX + w, dstY + h, srcvert[2].x, dwh, srcvert[2].y, dwh);
+    VTX_SET(v3, col, dstX,     dstY + h, srcvert[3].x, dxy, srcvert[3].y, dwh);
 
     /* Setup upper triangle (v0, v1, v3) */
     VTX_OUT(v0, 1);


More information about the xorg-commit mailing list