[Pixman] [PATCH v14 12/22] pixman-filter: fix subsample_bits == 0
spitzak at gmail.com
spitzak at gmail.com
Mon Mar 7 01:06:47 UTC 2016
From: Bill Spitzak <spitzak at gmail.com>
The position of only one subsample was wrong as ceil() was done on an integer.
Use a different function for all odd numbers of subsamples that gets this right.
Signed-off-by: Bill Spitzak <spitzak at gmail.com>
---
pixman/pixman-filter.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index ac89dda..f9ad45f 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -252,7 +252,10 @@ create_1d_filter (int width,
* and sample positions.
*/
- pos = ceil (frac - width / 2.0 - 0.5) + 0.5 - frac;
+ if (n_phases & 1)
+ pos = frac - width / 2.0;
+ else
+ pos = ceil (frac - width / 2.0 - 0.5) + 0.5 - frac;
total = 0;
for (x = 0; x < width; ++x, ++pos)
--
1.9.1
More information about the Pixman
mailing list