Re: Trouble in trapezoid land

Keith Packard <[email protected]>
Newsgroups gmane.comp.xfree86.render
Message-ID <E178OxF-00041T-00@localhost>
Around 7 o'clock on May 16, Keith Packard wrote:

> I'm going to run some numbers and see whether I can fix this by changing 
> the precision of various alpha computations

I think this particular problem is occuring because we're losing half a 
bit of alpha in the conversion from area to alpha.  Remember that the
area to alpha computation is currently specified by:

int AreaAlpha (Fixed_1_31 area, int depth)
{
	((area >> depth) * ((1 << depth) - 1)) >> (31 - depth)
}

Rounding instead of truncating in that computation fixes this particular
problem:

int AreaAlpha (Fixed_1_31 area, int depth)
{
	((((area + (1 << (depth - 1)) >> depth) * ((1 << depth) - 1) +
	  (1 << (30 - depth))) >> (31 - depth);
}

I'm going to give that a try.

Keith Packard        XFree86 Core Team        HP Cambridge Research Lab
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.