diff options
author | Zack Rusin <zackr@vmware.com> | 2009-11-12 16:21:00 -0500 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2009-11-13 14:58:35 -0500 |
commit | 654122ba7b813683a893d60d10ca201258deface (patch) | |
tree | 726affa7518305346c32d8265dd71495ef5a764a /src/gallium | |
parent | 43080e40aa0d34423e10f1d50aad15289b2b9aec (diff) |
st/xorg: try to fix non-uniform transforms
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_renderer.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index 05f00710d0..723605312c 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -148,32 +148,42 @@ add_vertex_data1(struct xorg_renderer *r, float width, float height, struct pipe_texture *src, float *src_matrix) { - float s0, t0, s1, t1; - float pt0[2], pt1[2]; + float s0, t0, s1, t1, s2, t2, s3, t3; + float pt0[2], pt1[2], pt2[2], pt3[2]; pt0[0] = srcX; pt0[1] = srcY; pt1[0] = (srcX + width); - pt1[1] = (srcY + height); + pt1[1] = srcY; + pt2[0] = (srcX + width); + pt2[1] = (srcY + height); + pt3[0] = srcX; + pt3[1] = (srcY + height); if (src_matrix) { map_point(src_matrix, pt0[0], pt0[1], &pt0[0], &pt0[1]); map_point(src_matrix, pt1[0], pt1[1], &pt1[0], &pt1[1]); + map_point(src_matrix, pt2[0], pt2[1], &pt2[0], &pt2[1]); + map_point(src_matrix, pt3[0], pt3[1], &pt3[0], &pt3[1]); } s0 = pt0[0] / src->width[0]; s1 = pt1[0] / src->width[0]; + s2 = pt2[0] / src->width[0]; + s3 = pt3[0] / src->width[0]; t0 = pt0[1] / src->height[0]; t1 = pt1[1] / src->height[0]; + t2 = pt2[1] / src->height[0]; + t3 = pt3[1] / src->height[0]; /* 1st vertex */ add_vertex_1tex(r, dstX, dstY, s0, t0); /* 2nd vertex */ - add_vertex_1tex(r, dstX + width, dstY, s1, t0); + add_vertex_1tex(r, dstX + width, dstY, s1, t1); /* 3rd vertex */ - add_vertex_1tex(r, dstX + width, dstY + height, s1, t1); + add_vertex_1tex(r, dstX + width, dstY + height, s2, t2); /* 4th vertex */ - add_vertex_1tex(r, dstX, dstY + height, s0, t1); + add_vertex_1tex(r, dstX, dstY + height, s3, t3); } static struct pipe_buffer * |