89 lines
3.1 KiB
Diff
89 lines
3.1 KiB
Diff
From fd9eef74b85d9280c90ba640b939effad9707f57 Mon Sep 17 00:00:00 2001
|
|
From: George Matsumura <gmmatsumura01@bvsd.org>
|
|
Date: Tue, 24 Dec 2019 06:12:01 +0000
|
|
Subject: [PATCH xf86-video-mach64 4/4] 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.
|
|
---
|
|
src/atimach64render.c | 44 +++++++++++++++++++++++--------------------
|
|
1 file changed, 24 insertions(+), 20 deletions(-)
|
|
|
|
diff --git src/atimach64render.c src/atimach64render.c
|
|
index e4ddea8..e172546 100644
|
|
--- src/atimach64render.c
|
|
+++ src/atimach64render.c
|
|
@@ -814,7 +814,10 @@ 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;
|
|
|
|
ATIDRISync(pScreenInfo);
|
|
@@ -830,22 +833,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 (int 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 +861,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);
|
|
--
|
|
2.25.0
|
|
|