For 1 bit alpha targets, the left and right boundaries of edges were
not rounded correctly.
int lxi;
int rxi;
- /* clip X */
+#if N_BITS == 1
+ /* For the non-antialiased case, round the coordinates up, in effect
+ * sampling the center of the pixel. (The AA case does a similar
+ * adjustment in RenderSamplesX) */
+ lx = l->x + X_FRAC_FIRST(1);
+ rx = r->x + X_FRAC_FIRST(1);
+#else
lx = l->x;
+ rx = r->x;
+#endif
+ /* clip X */
if (lx < 0)
lx = 0;
- rx = r->x;
if (pixman_fixed_to_int (rx) >= width)
rx = pixman_int_to_fixed (width);
#define MAX_ALPHA(n) ((1 << (n)) - 1)
#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1)
-#define N_X_FRAC(n) ((1 << ((n)/2)) + 1)
+#define N_X_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) + 1)
#define STEP_Y_SMALL(n) (pixman_fixed_1 / N_Y_FRAC(n))
#define STEP_Y_BIG(n) (pixman_fixed_1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))