On Dec 5, Carl Worth wrote:
 > I've begun some testing of the current implementation of the RENDER's
 > Trapezoids request.

The testing has yield some positive results.

In addition to the issues with the alpha subtraction that I've
recently mentioned, the other major source of differences in the C
vs. reference implementation was the rounding mode used when
intersecting trapezoid lines with the sub-pixel grid.

Now that I've fixed the C implementation to always round down, it
agrees with the reference implementation 99.936% of the time, (eg. 16
failures out of 25,000 random trapezoids).

So, the specification should declare the appropriate rounding mode to
use. Also, here's one more subtle issue related to rounding.

Examine the following diagram which shows a line exiting a pixel
*very* close to the exact corner of the pixel. In fact, it is within
one subpixel width of the corner in each direction.

Pixel boundaries are indicated by double lines, while sub-pixel
boundaries are indicated by single lines:

  \     ||
   \----+|
   |\   ||
   | \  ||
===a==x=b+
   |   \||
   |    x|
   +----+\
        ||\
        || \

The true intersection points of the line with the pixel boundaries are
indicated by the positions marked with 'x'. These two points become
the points 'a' and 'b' when rounded down.

Therefore, there is an ambiguity as to whether the intersection of the
line with the pixel should be the point 'a' or the point 'b'.

Similar ambiguous cases exist for other rounding modes.

Here are a couple of different ways the specification might resolve
the ambiguity:

        Intersections with vertical pixel boundaries are considered
        before horizontal boundaries, (or vice versa).

        Rounded intersections that correspond to true intersections
        within the pixel could be considered in favor of true
        intersections outside the pixel, (eg. the point 'a' would be
        chosen instead of 'b' above since the true intersection for 'b'
        occurs outside the pixel).

At the moment, I have not yet observed the current implementations to
determine the preference they have for resolving this ambiguity.

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

Reply via email to