[cairo-commit] libpixman/src ictrap.c,1.13,1.14
Carl Worth
commit at pdx.freedesktop.org
Thu Jan 13 14:53:16 PST 2005
Committed by: cworth
Update of /cvs/cairo/libpixman/src
In directory gabe:/tmp/cvs-serv4218/src
Modified Files:
ictrap.c
Log Message:
* src/ictrap.c (IcRasterizeTrapezoid): Force alpha to 0 when the
left edge is entirely above top. (This is a workaround for some
bizarre edge effects in the current algorithm).
Index: ictrap.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/ictrap.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ictrap.c 16 Apr 2004 15:32:53 -0000 1.13
+++ ictrap.c 13 Jan 2005 22:53:14 -0000 1.14
@@ -1227,8 +1227,18 @@
*/
while (left.row.top.y == pixel_y && pixel_x < first_right_x)
{
- alpha = (RectAlpha (pixel_y, y, y_next, depth)
- - PixelAlpha(pixel_x, pixel_y, y, y_next, &left, depth));
+ /* When the left edge is entirely above top we "know" the
+ * alpha is 0. Due to a subtle edge effect, the
+ * calculations below return a non-zero result in some
+ * situations. This defect in the algorithm is bad enough
+ * that we plan to discard the current approach
+ * entirely. But in the meantime, we do want to have the
+ * correct alpha == 0 in these cases. */
+ if (left.lower.y < y)
+ alpha = 0;
+ else
+ alpha = (RectAlpha (pixel_y, y, y_next, depth)
+ - PixelAlpha(pixel_x, pixel_y, y, y_next, &left, depth));
if (alpha > 0)
{
if (0 <= pixel_x && pixel_x < buf_width_fixed)
More information about the cairo-commit
mailing list