rsvg-path: New function rsvg_path_builder_add_to_cairo_context()

We'll use this to pass the cairo_path_t from an RsvgPathBuilder
directly into a cairo_t, without copying the path first.
parent 32f2115e
......@@ -200,6 +200,22 @@ rsvg_path_builder_copy_path (RsvgPathBuilder *builder)
return path;
}
void
rsvg_path_builder_add_to_cairo_context (RsvgPathBuilder *builder, cairo_t *cr)
{
cairo_path_t *path;
g_assert (builder != NULL);
g_assert (cr != NULL);
path = rsvg_path_builder_copy_path (builder);
cairo_new_path (cr);
cairo_append_path (cr, path);
rsvg_cairo_path_destroy (path);
}
static void
rsvg_path_arc_segment (RsvgPathBuilder *builder,
double xc, double yc,
......
......@@ -74,6 +74,9 @@ G_GNUC_INTERNAL
void rsvg_path_builder_close_path (RsvgPathBuilder *builder);
G_GNUC_INTERNAL
cairo_path_t *rsvg_path_builder_copy_path (RsvgPathBuilder *builder);
G_GNUC_INTERNAL
void rsvg_path_builder_add_to_cairo_context (RsvgPathBuilder *builder, cairo_t *cr);
G_GNUC_INTERNAL
cairo_path_t *rsvg_parse_path (const char *path_str);
G_GNUC_INTERNAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment