On Thu, May 02, 2002 at 09:07:38PM -0700, Keith Packard wrote:
> 
> Ok, I spent the afternoon drawing figures on a whiteboard and getting help 
> from the PSU CS department here in Portland.  I have the kernel of a 
> solution, which I'll explore here to see if it solves the general case.

Wow, it looks complicated.

While you're brainstorming, you might want to look at the way Libart
does its exact area computation. There are a few observations there
that might be useful.

First, Libart uses the _edge_ as the primitive, not a filled region
(such as a trapezoid) with a left and a right edge. You treat the left
edge as +1, and the right edge as -1, and sum everything up. This
simplifies your case analysis quite a bit.

In fact, there are only two cases. Either floor(x0) = floor(x1), or not.
In the former case, the area is equivalent to a vertical edge at
0.5(x0+x1). In the latter case, you have a corner triangle at pixel
floor(x0), a corner triangle at pixel floor(x1), and a horizontal
edge at all (>= 0) pixels in between.

All this logic is in art_svp_render_aa.c. A smart guy such as you
should be able to understand it.

It will be very interesting to benchmark Libart against a software
implementation of the Render extension's trapezoid fill. Of course,
a hardware implementation is a different story. I look forward to an
implementation on top of that, as well :)

Raph
_______________________________________________
Render mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/render

Reply via email to