[cairo] Re: [Mesa3d-dev] another point in the Glitz paper

Jon Smirl jonsmirl at yahoo.com
Thu Apr 22 10:43:21 PDT 2004

Isn't this an example of a fundamental performance problem in the Cairo API.
Cairo allows non-simple polygons. I agree that this is definitely simpler for
the programmer but it doesn't efficiently accelerate.

To accelerate this the API needs to be split. You need a polygon tesselate
function and a draw simple polygons function. If you don't split the function
the list of polygons has to be sent through the tesselator every time the
polygons are drawn. With the split model you tesselate the list once, if at all,
and then feed the polygons repeatedly to the draw simple polygon function.

--- Brian Paul <brian.paul at tungstengraphics.com> wrote:
> >>I'm not 100% sure what this is trying to acomplish, but this doesn't 
> >>feel like the right way to do it.  Is the idea to stencil one surface 
> >>onto another?  If so, just use the source surface as a texture and draw 
> >>polygons to "cut" the desired portions of that surface onto the destination.
> > 
> > 
> > Not possible as the list of polygons that should be rendered may contain
> > overlapping polygons and we must be able to use various blending
> > operators for blending the source onto the destination.
> Right.  I believe the Glitz/Cairo libraries need to be able to render 
> non-simple polygons.  I'm not sure that's been explicitly stated yet.
> OpenGL's glBegin(GL_POLYGON)/glEnd() can only reliably draw 
> single-contour, convex, non-intersecting polygons.
> To handle multiple contours and/or self-intersection polygons you need 
> to draw them into a temporary raster.  The reason is we only want to 
> apply blending arithmetic to each pixel in the polygon once.  But if 
> the polygon self-intersects and we draw it without a temporary raster, 
> we may touch some pixels many, many times, resulting in the wrong 
> blending result.
> I guess another approach would be to feed such polygons through the 
> GLU tessellator first.
> -Brian

Jon Smirl
jonsmirl at yahoo.com

Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

More information about the cairo mailing list