Patch to fix pixman samping location bug (#2488).

This commit is contained in:
Bertram Felgenhauer 2006-06-13 20:07:28 -04:00 committed by Kristian Høgsberg
parent 0ee64b8468
commit b104a79502
4 changed files with 15 additions and 6 deletions

View file

@ -2814,8 +2814,9 @@ static void fbFetchSourcePict(PicturePtr pict, int x, int y, int width, CARD32 *
xFixed_32_32 l;
xFixed_48_16 dx, dy, a, b, off;
v.vector[0] = IntToxFixed(x);
v.vector[1] = IntToxFixed(y);
/* reference point is the center of the pixel */
v.vector[0] = IntToxFixed(x) + xFixed1/2;
v.vector[1] = IntToxFixed(y) + xFixed1/2;
v.vector[2] = xFixed1;
if (pict->transform) {
if (!PictureTransformPoint3d (pict->transform, &v))
@ -2928,8 +2929,9 @@ static void fbFetchSourcePict(PicturePtr pict, int x, int y, int width, CARD32 *
if (pict->transform) {
PictVector v;
v.vector[0] = IntToxFixed(x);
v.vector[1] = IntToxFixed(y);
/* reference point is the center of the pixel */
v.vector[0] = IntToxFixed(x) + xFixed1/2;
v.vector[1] = IntToxFixed(y) + xFixed1/2;
v.vector[2] = xFixed1;
if (!PictureTransformPoint3d (pict->transform, &v))
return;
@ -3068,8 +3070,9 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
x += xoff;
y += yoff;
v.vector[0] = IntToxFixed(x);
v.vector[1] = IntToxFixed(y);
/* reference point is the center of the pixel */
v.vector[0] = IntToxFixed(x) + xFixed1/2;
v.vector[1] = IntToxFixed(y) + xFixed1/2;
v.vector[2] = xFixed1;
/* when using convolution filters one might get here without a transform */
@ -3184,6 +3187,12 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
}
}
} else if (pict->filter == PIXMAN_FILTER_BILINEAR || pict->filter == PIXMAN_FILTER_GOOD || pict->filter == PIXMAN_FILTER_BEST) {
/* adjust vector for maximum contribution at 0.5, 0.5 of each texel. */
v.vector[0] -= v.vector[2]/2;
v.vector[1] -= v.vector[2]/2;
unit.vector[0] -= unit.vector[2]/2;
unit.vector[1] -= unit.vector[2]/2;
if (pict->repeat == RepeatNormal) {
if (PIXREGION_NUM_RECTS(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B