From 4365d16c8629e824973ee0c357efdfbfd28b672c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristan=20H=C3=B8gsberg?= Date: Mon, 19 Jun 2006 22:13:22 -0400 Subject: [PATCH] Pull over convolution filter fixes from xgl-0-0-1 branch. Cherry-picking patches: 8a5ea68800b9d7dca90ff4e573ad8533852f1ea3 and 4d755fe14274a7293748ce9aa666ab85df6297c5 --- fb/fbcompose.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fb/fbcompose.c b/fb/fbcompose.c index 41fff7b8a..6f7e3e6ec 100644 --- a/fb/fbcompose.c +++ b/fb/fbcompose.c @@ -3280,8 +3280,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 xFixed *params = pict->filter_params; INT32 cwidth = xFixedToInt(params[0]); INT32 cheight = xFixedToInt(params[1]); - int xoff = params[0] >> 1; - int yoff = params[1] >> 1; + int xoff = (params[0] - xFixed1) >> 1; + int yoff = (params[1] - xFixed1) >> 1; params += 2; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -3325,6 +3325,11 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 } } + satot >>= 16; + srtot >>= 16; + sgtot >>= 16; + sbtot >>= 16; + if (satot < 0) satot = 0; else if (satot > 0xff) satot = 0xff; if (srtot < 0) srtot = 0; else if (srtot > 0xff) srtot = 0xff; if (sgtot < 0) sgtot = 0; else if (sgtot > 0xff) sgtot = 0xff;