[cairo] cairo_append_path performance
Vladimir Vukicevic
vladimirv at gmail.com
Fri Sep 1 22:11:46 PDT 2006
On 9/1/06, Mike Emmel <mike.emmel at gmail.com> wrote:
> Most graphics systems have the concept of a path as a first class object.
>
> In cairo we expose a path structure but its not the same as the one
> used internally.
>
> And you don't have access to many operations your would like to
> perform on a path.
> For example hit tests.
>
> My solution is to use a cairo_t with a 1 pixel surface to represent a
> path this gives
> a nice api for paths except for one problem.
>
> To copy this path to the real surface for rendering involves copying
> it out into a cairo_path_t
> then appending it to the real surface resulting in a path copy and a
> performance problem
> for large paths.
>
> Can a new public method be added to do the copy using the internal
> structure removing this
> extra allocation ?
>
> void cairo_append_path_from(to_cr,from_cr);
I'd personally rather see paths as real first-class objects, e.g.
cairo_path_create()
cairo_path_move_to()
cairo_path_line_to() etc.
and then cairo_append_path()/cairo_replace_path() or somesuch for
getting a cairo_path_t * into a cairo_t as the current path
efficiently.
- Vlad
More information about the cairo
mailing list