From b0de4a7d094e16fda4e9124caa867df78b607d8c Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 13 Jan 2005 18:08:57 +0000 Subject: [PATCH] (IcRasterizeTrapezoid): Fix the above correction so that it doesn't force 0 alpha when the left edge is positioned above but slopes so as to contain some of the pixel. --- pixman/ChangeLog | 3 +++ pixman/src/ictrap.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pixman/ChangeLog b/pixman/ChangeLog index 1e9f5fb57..08c5f5778 100644 --- a/pixman/ChangeLog +++ b/pixman/ChangeLog @@ -3,6 +3,9 @@ * 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). + (IcRasterizeTrapezoid): Fix the above correction so that it + doesn't force 0 alpha when the left edge is positioned above but + slopes so as to contain some of the pixel. 2005-01-07 Carl Worth diff --git a/pixman/src/ictrap.c b/pixman/src/ictrap.c index 684d976a5..027647fb9 100644 --- a/pixman/src/ictrap.c +++ b/pixman/src/ictrap.c @@ -1233,8 +1233,12 @@ IcRasterizeTrapezoid (pixman_image_t *pMask, * 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) + * correct alpha == 0 in these cases. + * + * The left edge is entirely "above" if its lower y + * coordinate is less than y, *and* its slope is positive. + */ + if (left.lower.y < y && left.m > 0) alpha = 0; else alpha = (RectAlpha (pixel_y, y, y_next, depth)