summaryrefslogtreecommitdiff
path: root/src/i915_render.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-03-21 03:08:24 -0700
committerKeith Packard <keithp@keithp.com>2008-03-21 03:12:36 -0700
commit645980596450ed21c3b8927410a6bfe38a0c55d1 (patch)
treedd5ab9dbbc1786fd5c631d2a181aaaa9b3f1c39a /src/i915_render.c
parentbf725b92cf93d74a6f414f81f319dddbc2c78525 (diff)
Transformed coord computed using floats. Don't move bilinear composite dst.
The homogeneous coordinate computation in the core server cannot be used for many legal matrices as it overflows. Just use floats in the driver; faster and avoids troubles. When compositing with bilinear filter, don't push the dst coordinates around as that makes the output blurry when pixels are aligned.
Diffstat (limited to 'src/i915_render.c')
-rw-r--r--src/i915_render.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/i915_render.c b/src/i915_render.c
index 9c6da095..2b9ed04e 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -321,6 +321,7 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
int out_reg = FS_OC;
FS_LOCALS(20);
Bool is_affine_src, is_affine_mask;
+ Bool is_nearest = FALSE;
IntelEmitInvarientState(pScrn);
*pI830->last_3d = LAST_3D_RENDER;
@@ -332,9 +333,13 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
if (!i915_texture_setup(pSrcPicture, pSrc, 0))
I830FALLBACK("fail to setup src texture\n");
+ if (pSrcPicture->filter == PictFilterNearest)
+ is_nearest = TRUE;
if (pMask != NULL) {
if (!i915_texture_setup(pMaskPicture, pMask, 1))
I830FALLBACK("fail to setup mask texture\n");
+ if (pMaskPicture->filter == PictFilterNearest)
+ is_nearest = TRUE;
} else {
pI830->transform[1] = NULL;
pI830->scale_units[1][0] = -1;
@@ -343,6 +348,11 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture,
is_affine_src = i830_transform_is_affine (pI830->transform[0]);
is_affine_mask = i830_transform_is_affine (pI830->transform[1]);
+ if (is_nearest)
+ pI830->coord_adjust = -0.125;
+ else
+ pI830->coord_adjust = 0;
+
if (pMask == NULL) {
BEGIN_BATCH(10);
OUT_BATCH(_3DSTATE_MAP_STATE | 3);