[cairo] Extending Cairo API to support reusable paths

Matt Woodrow matt.woodrow at gmail.com
Tue Mar 30 13:50:28 PDT 2010

Hi All

As part of my internship at Mozilla, I'm working on extending the Cairo 
API to allow caching of reusable path objects.

On the default backend, these will directly wrap the current 
cairo_path_t objects, and their related functions.
However on Quartz we can include a copy of the CGPath object and on 
direct2d a copy of the ID2D1Geometry to hopefully increase redraw 
performance on these platform.

The API changes I am proposing are:

/* New cairo API */
typedef struct _cairo_retained_path cairo_retained_path_t;

cairo_public cairo_retained_path_t *
cairo_copy_retained_path(cairo_t *cr);

cairo_public void
cairo_append_retained_path(cairo_t *cr, cairo_retained_path_t *path);

cairo_public void
cairo_retained_path_destroy(cairo_retained_path_t *path);

Does anyone have any thoughts, questions or suggestions on this?

The Mozilla bug for this is at 


Matt Woodrow

More information about the cairo mailing list