Il giorno mer, 20/02/2008 alle 19.01 +0100, Denis Oliver Kropp ha scritto: > Michel Dänzer wrote: > > On Sun, 2008-02-17 at 14:51 +0100, Claudio Ciccani wrote: > >> Il giorno sab, 16/02/2008 alle 19.30 +0100, Denis Oliver Kropp ha > >> scritto: > >>> Claudio Ciccani wrote: > >>>> You written FillTrapezoid(), my brain received FillPolygon()!! > >>> FillPolygon() would be the toplevel, but if I made up my UI from a bunch > >>> of quadrangles calling FillQuadrangles(), it would be much more efficient > >>> than a generic FillPolygon() which most likely has to tesselate your > >>> polygon > >>> using triangles, trapezoids or quadrangles. Well, it could be cached, and > >>> end up at the same thing, but if your polygons are changing too much or > >>> you > >>> have a lot of them coming and going, it would be better to use > >>> quadrangles, > >>> which would only need to be splitted in case the hardware only does > >>> triangles, > >>> or split up a second time for trapezoid based rasterizers, like Matrox > >>> G-series. > >>> > >>> Maybe I missed something and hardware directly supports arbitrary > >>> Polygons nowadays. > >> OpenGL 1.1 compliant cards support polygon rendering (GL_POLYGON) and > >> polygon antialiasing (GL_POLYGON_SMOOTH); [...] > > > > Hardware still only supports triangles though. The GL implementation > > decomposes polygons into simpler primitives but only guarantees to do it > > correctly for simple, convex polygons. > > That's what I thought. So still I think adding FillQuadrangles() would be the > best > choice for current hardware and software, e.g. to implement Cairo's > trapezoids. > > SH7722 supports quadrangles directly and for the 3D enhanced DirectFB drivers > it > would be a triangle fan. >
Either if the hardware still only supports triangle primitives and actually has to decompose complex objects into triangles, that doesn't imply that FillQuadrangles() is faster than FillPolygon(). For example, in the Radeon driver I can implement an antialiased polygon by emitting an antialiased line loop (border) and a non-antialiased polygon (contents). Of course, this is faster (and easier) than drawing a bunch of trapezoids! So, to definitively resolve this dispute, why don't we add both these functions? I could use FillQuadrangles in the cairo backend and FillPolygon in my upcoming OpenVG implementation (aka DirectVG)... ;-) -- Claudio Ciccani [EMAIL PROTECTED] [EMAIL PROTECTED] http://directfb.org _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev