summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2016-03-06 17:06:47 -0800
committerSøren Sandmann Pedersen <soren.sandmann@gmail.com>2016-03-11 00:00:46 -0500
commit7dce6261397e7faf34d8c2ce8dc870a2df074abf (patch)
tree62183a63c4f79c2b34421dd44f9d8202ccba2cd5
parent0b7a6ab2382b7f3bd5cdf16a928eab2301a35a69 (diff)
pixman-filter: fix subsample_bits == 0
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@gmail.com>
-rw-r--r--pixman/pixman-filter.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index ac89dda1..f9ad45f5 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)