summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-11-10 11:17:23 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-11-10 15:30:49 +0000
commit14109abf285866ad4cd99d0cd16b0954a0a73a62 (patch)
tree63f3d65bdaa9a4b16419d579838ec7a1b63e6deb /src
parente581ceb7381e29ecc1a172597d258824f6a1d2d3 (diff)
i915: Fix texture sampling coordinates.
RENDER specifies that texels should sampled from the pixel centre. This corrects a number of failures in the cairo test suite and a few off-by-one bug reports. Grey border around images https://bugs.freedesktop.org/show_bug.cgi?id=21523 Note that the earlier attempt to fix this was subverted by the buggy use of 1x1R textures for solid sources -- which caused the majority of text to disappear. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/i915_render.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/i915_render.c b/src/i915_render.c
index db0daf02..f64e0316 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -135,6 +135,9 @@ static uint32_t i915_get_blend_cntl(int op, PicturePtr mask,
(dblend << S6_CBUF_DST_BLEND_FACT_SHIFT);
}
+#define DSTORG_HORT_BIAS(x) ((x)<<20)
+#define DSTORG_VERT_BIAS(x) ((x)<<16)
+
static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
{
ScrnInfoPtr scrn;
@@ -165,6 +168,7 @@ static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
(int)dest_picture->format);
return FALSE;
}
+ *dst_format |= DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8);
return TRUE;
}
@@ -416,7 +420,7 @@ i915_prepare_composite(int op, PicturePtr source_picture,
}
if (source_picture->filter == PictFilterNearest)
- intel->dst_coord_adjust = -0.125;
+ intel->src_coord_adjust = 0.375;
}
if (mask != NULL) {
@@ -428,7 +432,7 @@ i915_prepare_composite(int op, PicturePtr source_picture,
}
if (mask_picture->filter == PictFilterNearest)
- intel->dst_coord_adjust = -0.125;
+ intel->mask_coord_adjust = 0.375;
}
}