[cairo] cairo_fill and cairo_stroke to use DFB hw acceleration

Carl Worth cworth at cworth.org
Mon Oct 20 13:35:31 PDT 2008


On Mon, 2008-10-20 at 07:58 +0200, haithem rahmani wrote:
 
> Is it possible to modify the cairo_stroke() and the cairo_fill()
> functions to make them use the DirectFB hw acceleration for specific
> paths such as rectangles, lines or triangles?

I don't know if the DirectFB primitives for rectangles, lines, or
triangles are appropriate for what cairo needs, but you can certainly
try them and find out.

What you'll want to do is to modify cairo-directfb-surface.c and look at
the initialization of:

static cairo_surface_backend_t cairo_directfb_surface_backend = {

and specifically the following two functions:

        NULL, /* stroke */
        NULL, /* fill */

There, instead of NULL, you could put two new functions
_cairo_directfb_surface_stroke and _cairo_directfb_surface_fill which
you would also have to write.

Those functions would then determine if the DirectFB primitives are
appropriate, and if so, call them. Otherwise, they would return
CAIRO_INT_STATUS_UNSUPPORTED so that fallbacks would be used, (which is
exactly what is happening today with the NULL function pointers here).

Then, finally, you'll want to check with cairo's test suite, (available
by calling "make test" and look into test/ and test/README for more
details), that things are still working as well as before.

Note that I don't think anyone has yet done the work to make sure that
cairo-directfb passes the test suite entirely. That would also be a
useful thing to do. It's independent of what you're asking for, but it
would simplify the criterion for verifying your new work here.

I hope that helps, and I hope you have lots of fun playing with cairo!

-Carl
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.cairographics.org/archives/cairo/attachments/20081020/115678c1/attachment.pgp 


More information about the cairo mailing list