summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-02-02 17:40:34 -0800
committerEric Anholt <eric@anholt.net>2007-02-02 17:41:40 -0800
commit681b91924c364a1c00732f548539f2767929ba0e (patch)
treeb4f01e22461cb758465344e2a2d882f997e74c8c
parent76a4f2eea826036e2ac16b7e8c61ab946038c120 (diff)
Add subpixel offsets to fix accelerated rotated rendering on i915.
This fixes the rendercheck "transformed src/mask coords 2" tests. Previously, the source pixels chosen would be off by one in some cases. The particular values were taken from Mesa, which uses .125 offsets (except apparently broken for y), but the signs are changed. I would be happier if I had better justification for why this worked.
-rw-r--r--src/i830_render.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/i830_render.c b/src/i830_render.c
index 99338439..96aeb3fa 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -557,8 +557,8 @@ i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
OUT_RING(PRIM3D_INLINE | PRIM3D_RECTLIST | (vertex_count-1));
- OUT_RING_F(dstX);
- OUT_RING_F(dstY);
+ OUT_RING_F(-0.125 + dstX);
+ OUT_RING_F(-0.125 + dstY);
OUT_RING_F(src_x[0] / pI830->scale_units[0][0]);
OUT_RING_F(src_y[0] / pI830->scale_units[0][1]);
if (has_mask) {
@@ -566,8 +566,8 @@ i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
OUT_RING_F(mask_y[0] / pI830->scale_units[1][1]);
}
- OUT_RING_F(dstX);
- OUT_RING_F(dstY + h);
+ OUT_RING_F(-0.125 + dstX);
+ OUT_RING_F(-0.125 + dstY + h);
OUT_RING_F(src_x[1] / pI830->scale_units[0][0]);
OUT_RING_F(src_y[1] / pI830->scale_units[0][1]);
if (has_mask) {
@@ -575,8 +575,8 @@ i830_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY,
OUT_RING_F(mask_y[1] / pI830->scale_units[1][1]);
}
- OUT_RING_F(dstX + w);
- OUT_RING_F(dstY + h);
+ OUT_RING_F(-0.125 + dstX + w);
+ OUT_RING_F(-0.125 + dstY + h);
OUT_RING_F(src_x[2] / pI830->scale_units[0][0]);
OUT_RING_F(src_y[2] / pI830->scale_units[0][1]);
if (has_mask) {